合并掌静脉功能,此版本数据库有变动

This commit is contained in:
gaoben 2024-07-23 11:14:47 +08:00
parent ff404b2eb2
commit 55c6235a1c
8 changed files with 628 additions and 0 deletions

View File

@ -390,6 +390,12 @@ public class HttpApiController {
// }
// }
//--------掌静脉特征
puser.setPvLeft(p.getPvLeft());
puser.setPvRight(p.getPvRight());
puser.setFeatureType(p.getFeatureType());
//------------------------------------------------------------------
if(p.getSourceFile()!=null){
puser.setSourceFile(globalValue.getMinioEndpoint()+"/"
+ globalValue.getMinioBucketName()+"/"
@ -1270,4 +1276,414 @@ public class HttpApiController {
return R.ok();
}
@PostMapping("/updatePerson")
@ApiOperation("设备修改人员")
@ApiImplicitParams({
@ApiImplicitParam(name = "dev_id", value = "sn", paramType = "query", dataType = "String", required = true),
@ApiImplicitParam(name = "appKey", value = "appkey", paramType = "query", dataType = "String", required = true),
@ApiImplicitParam(name = "timestamp", value = "timestamp", paramType = "query", dataType = "String", required = true),
@ApiImplicitParam(name = "sign", value = "sign", paramType = "query", dataType = "String", required = true),
})
public R updatePerson(@RequestParam("jsonString") String jsonString, @RequestParam(value = "orgImage",required = false) MultipartFile orgImage, @RequestParam(value = "sourceFile",required = false) MultipartFile sourceFile,@RequestParam("thdFeature") String thdFeature) {
JSONObject jsonContent = JSONObject.parseObject(jsonString);
String sn = jsonContent.getString("dev_id");
String appKey = jsonContent.getString("appKey");
String timestamp = jsonContent.getString("timestamp");
String sign = jsonContent.getString("sign");
//鉴权
R res = authService.auth(sn,appKey,timestamp,sign);
if((Integer) res.get("code") != 0){
return res;
}
log.debug("设备端修改人员:"+sn);
TenDeviceEntity deviceEntity = tenDeviceService.findBySn(sn);
//----------------------------------------以下业务-----------------------------------------------------
JSONObject personJson = jsonContent.getJSONObject("data");
TenPersonEntity tenPerson = JSONObject.toJavaObject(personJson,TenPersonEntity.class);
tenPerson.setThdFeature(thdFeature);
tenPerson.setPersonId(personJson.getLong("uid"));
if(tenPerson.getIdCard()!=null){
if(tenPerson.getIdCard().length() == 15){
String id18 = Convert.toEighteen(tenPerson.getIdCard());
tenPerson.setIdCard(id18);
}
}
// if(tenPerson.getDeptId()!=null){
// int c = tenPersonService.checkByIdCardDept(tenPerson.getIdCard(),tenPerson.getDeptId());
// if(c>0){
// return R.error("身份证在组织已存在");
// }
// }else{
// int p = tenPersonService.checkByIdCardCell(tenPerson.getIdCard(),deviceEntity.getCellId());
// if(p>0){
// return R.error("身份证在小区已存在");
// }
// }
if (tenPerson.getRoomId()!=null) {
TenRoomEntity roomEntity = tenRoomService.getById(tenPerson.getRoomId(),tenPerson.getCellId());
if(roomEntity!=null){
tenPerson.setBuildId(roomEntity.getBuildId());
}
}
Date now = new Date();
// long id = new SnowflakeIdWorker().nextId();
// tenPerson.setPersonId(id);
// tenPerson.setUuid(UUIDUtil.uuid());
tenPerson.setTenantId(deviceEntity.getTenantId());
// tenPerson.setCreateBy(sn);
// tenPerson.setRegisterType(Constant.RESGISTER_TYPE_Device);
// tenPerson.setStatus(Constant.PESON_SUATUS_NOMOR);
// tenPerson.setCreateTime(now);
tenPerson.setLastUpdateTime(now);
tenPerson.setCellId(deviceEntity.getCellId());
if(orgImage!=null && !orgImage.isEmpty() && orgImage.getSize() != 0){
try {
//保存原始图片
String userFileUrl = globalValue.getImagesDir() + "/" +
tenPerson.getCellId().toString() + "/" +
tenPerson.getPersonId().toString() + "/";
String orgImageFileName = userFileUrl + "o_" + UUIDUtil.uuid() + ".jpg";
InputStream inputStream = orgImage.getInputStream();
PutObjectOptions putObjectOptions = new PutObjectOptions(inputStream.available(), -1);
putObjectOptions.setContentType(orgImage.getContentType());
minioClient.putObject(
minioConfig.getBucketName(), orgImageFileName, inputStream, putObjectOptions);
inputStream.close();
tenPerson.setOrgImage(orgImageFileName);
tenPerson.setFaceImage(orgImageFileName);
} catch (Exception e) {
return R.error(e.getMessage());
}
}
if(sourceFile!=null && !sourceFile.isEmpty() && sourceFile.getSize() != 0){
try {
//保存sourceFiile
String userFileUrl = globalValue.getImagesDir() + "/" +
tenPerson.getCellId().toString() + "/" +
tenPerson.getPersonId().toString() + "/";
String sourceFileName = userFileUrl + "p_" + UUIDUtil.uuid() + ".zip";
InputStream inputStream = sourceFile.getInputStream();
PutObjectOptions putObjectOptions = new PutObjectOptions(inputStream.available(), -1);
putObjectOptions.setContentType(sourceFile.getContentType());
minioClient.putObject(
minioConfig.getBucketName(), sourceFileName, inputStream, putObjectOptions);
inputStream.close();
tenPerson.setSourceFile(sourceFileName);
} catch (Exception e) {
return R.error(e.getMessage());
}
}
//处理类型
//1. 不是固定类型给一个默认的家属类型
if(tenPerson.getPersonType()>10000){
tenPerson.setLabelId(tenPerson.getPersonType());
tenPerson.setPersonType(Constant.PERSON_TYPE_MEMBER);//
} else if (tenPerson.getPersonType() == Constant.PERSON_TYPE_OWNER
|| tenPerson.getPersonType() == Constant.PERSON_TYPE_TENANT
|| tenPerson.getPersonType() == Constant.PERSON_TYPE_MEMBER) {
TenLabelEntity labelEntity = tenLabelService.getOne(new QueryWrapper<TenLabelEntity>()
.eq("type",tenPerson.getPersonType())
.eq("tenant_id",deviceEntity.getTenantId()));
if(labelEntity!=null){
tenPerson.setLabelId(labelEntity.getLabelId().intValue());
}
}
int resSave = tenPersonService.update3d(tenPerson);
if (resSave==1) {
return R.error("修改失败");
}
JSONObject personRes = new JSONObject();
personRes.put("uid",tenPerson.getPersonId());
personRes.put("last_update_stamp",DateUtils.format(tenPerson.getLastUpdateTime(),DateUtils.DATE_TIME_PATTERN));
return R.ok().put("data",personRes);
}
// @PostMapping("/addPersonV2")
// @ApiOperation("设备添加人员")
// @ApiImplicitParams({
// @ApiImplicitParam(name = "dev_id", value = "sn", paramType = "query", dataType = "String", required = true),
// @ApiImplicitParam(name = "appKey", value = "appkey", paramType = "query", dataType = "String", required = true),
// @ApiImplicitParam(name = "timestamp", value = "timestamp", paramType = "query", dataType = "String", required = true),
// @ApiImplicitParam(name = "sign", value = "sign", paramType = "query", dataType = "String", required = true),
// })
// public R addPersonV2(@RequestBody JSONObject jsonContent) {
// String sn = jsonContent.getString("dev_id");
// String appKey = jsonContent.getString("appKey");
// String timestamp = jsonContent.getString("timestamp");
// String sign = jsonContent.getString("sign");
// //鉴权
// R res = authService.auth(sn,appKey,timestamp,sign);
// if((Integer) res.get("code") != 0){
// return res;
// }
// log.debug("设备端添加人员:"+sn);
// TenDeviceEntity deviceEntity = tenDeviceService.findBySn(sn);
////----------------------------------------以下业务-----------------------------------------------------
// JSONObject personJson = jsonContent.getJSONObject("data");
//// tenPerson.setCellId(personJson.getLong("cellId"));
//// tenPerson.setRoomId(personJson.getLong("roomId"));
//// tenPerson.setPersonType(personJson.getInteger("personType"));
//// tenPerson.setName(personJson.getString("name"));
//// tenPerson.setMobile(personJson.getString("mobile"));
//// tenPerson.setIdCard(personJson.getString("idCard"));
//// tenPerson.setGender(personJson.getInteger("gender"));
//
// TenPersonEntity tenPerson = JSONObject.toJavaObject(personJson,TenPersonEntity.class);
//
//// tenPerson.setThdFeature(thdFeature);
//
// //------------------------获取掌静脉数据---------------------------
//// String pvLeft = jsonContent.getString("pvLeft");
//// String pvRight = jsonContent.getString("pvRight");
//// Integer featureType = jsonContent.getInteger("featureType");
//
// if(tenPerson.getIdCard()!=null){
// if(tenPerson.getIdCard().length() == 15){
// String id18 = Convert.toEighteen(tenPerson.getIdCard());
// tenPerson.setIdCard(id18);
// }
// }
//
//// TenPersonEntity tenPersonEntity = tenPersonService.findByName(tenPerson.getName(),
//// tenPerson.getRoomId(),tenPerson.getCellId());
//// if(tenPersonEntity!=null){
//// return R.error("姓名在此组织已存在");
//// }
//
//
//// if(tenPerson.getIdCard()!=null){
//// TenPersonEntity tenPersonIdcard = tenPersonService.findByIdCard(tenPerson.getIdCard(),
//// tenPerson.getRoomId(),tenPerson.getCellId());
//// if(tenPersonIdcard!=null){
//// return R.error("身份证在此组织已存在");
//// }
//// }
//
// if(tenPerson.getDeptId()!=null){
// int c = tenPersonService.checkByIdCardDept(tenPerson.getIdCard(),tenPerson.getDeptId());
// if(c>0){
// return R.error("身份证在组织已存在");
// }
// }else{
// int p = tenPersonService.checkByIdCardCell(tenPerson.getIdCard(),deviceEntity.getCellId());
// if(p>0){
// return R.error("身份证在小区已存在");
// }
// }
//
//// if(tenPerson.getPersonType()!=Constant.PERSON_TYPE_PROPERTY){
//// int c = tenPersonService.checkByIdCardDept(tenPerson.getIdCard(),tenPerson.getDeptId());
//// if(c>0){
//// return R.error("身份证在组织已存在");
//// }
//// }else{
//// int p = tenPersonService.checkByIdCardCell(tenPerson.getIdCard(),deviceEntity.getCellId());
//// if(p>0){
//// return R.error("身份证在小区已存在");
//// }
//// }
//
// if (tenPerson.getRoomId()!=null) {
// TenRoomEntity roomEntity = tenRoomService.getById(tenPerson.getRoomId(),tenPerson.getCellId());
// if(roomEntity!=null){
// tenPerson.setBuildId(roomEntity.getBuildId());
// }
// }
//
// Date now = new Date();
// long id = new SnowflakeIdWorker().nextId();
// tenPerson.setPersonId(id);
// tenPerson.setUuid(UUIDUtil.uuid());
// tenPerson.setTenantId(deviceEntity.getTenantId());
// tenPerson.setCreateBy(sn);
// tenPerson.setRegisterType(Constant.RESGISTER_TYPE_Device);
// tenPerson.setStatus(Constant.PESON_SUATUS_NOMOR);
// tenPerson.setCreateTime(now);
// tenPerson.setLastUpdateTime(now);
//
// tenPerson.setCellId(deviceEntity.getCellId());
//
//
// String orgImageBase64 = personJson.getString("orgImageBase64");
// if(orgImageBase64!=null && orgImageBase64.length()>0){
// try {
// //保存原始图片
// String userFileUrl = globalValue.getImagesDir() + "/" +
// tenPerson.getCellId().toString() + "/" +
// tenPerson.getPersonId().toString() + "/";
// String orgImageFileName = userFileUrl + "o_" + UUIDUtil.uuid() + ".jpg";
//
// byte[] b = Base64.getDecoder().decode(orgImageBase64.replace("\n",""));
// InputStream inputStream = new ByteArrayInputStream(b);
// PutObjectOptions putObjectOptions = new PutObjectOptions(inputStream.available(), -1);
// putObjectOptions.setContentType("image/jpeg");
// minioClient.putObject(
// minioConfig.getBucketName(), orgImageFileName, inputStream, putObjectOptions);
// inputStream.close();
//
// tenPerson.setOrgImage(orgImageFileName);
// tenPerson.setFaceImage(orgImageFileName);
//
// } catch (Exception e) {
// return R.error(e.getMessage());
// }
// }
//
// //处理类型
// //1. 不是固定类型给一个默认的家属类型
// if(tenPerson.getPersonType()>10000){
// tenPerson.setLabelId(tenPerson.getPersonType());
// tenPerson.setPersonType(Constant.PERSON_TYPE_MEMBER);//
// } else if (tenPerson.getPersonType() == Constant.PERSON_TYPE_OWNER
// || tenPerson.getPersonType() == Constant.PERSON_TYPE_TENANT
// || tenPerson.getPersonType() == Constant.PERSON_TYPE_MEMBER) {
// TenLabelEntity labelEntity = tenLabelService.getOne(new QueryWrapper<TenLabelEntity>()
// .eq("type",tenPerson.getPersonType())
// .eq("tenant_id",deviceEntity.getTenantId()));
// if(labelEntity!=null){
// tenPerson.setLabelId(labelEntity.getLabelId().intValue());
// }
// }
// int resSave = tenPersonService.save3d(tenPerson);
// if (resSave==1) {
// return R.error("添加失败");
// }
// JSONObject personRes = new JSONObject();
// personRes.put("uid",tenPerson.getPersonId());
// personRes.put("last_update_stamp",DateUtils.format(tenPerson.getLastUpdateTime(),DateUtils.DATE_TIME_PATTERN));
// return R.ok().put("data",personRes);
//
// }
// @PostMapping("/updatePersonV2")
// @ApiOperation("设备添加人员")
// @ApiImplicitParams({
// @ApiImplicitParam(name = "dev_id", value = "sn", paramType = "query", dataType = "String", required = true),
// @ApiImplicitParam(name = "appKey", value = "appkey", paramType = "query", dataType = "String", required = true),
// @ApiImplicitParam(name = "timestamp", value = "timestamp", paramType = "query", dataType = "String", required = true),
// @ApiImplicitParam(name = "sign", value = "sign", paramType = "query", dataType = "String", required = true),
// })
// public R updatePersonV2(@RequestBody JSONObject jsonContent) {
// String sn = jsonContent.getString("dev_id");
// String appKey = jsonContent.getString("appKey");
// String timestamp = jsonContent.getString("timestamp");
// String sign = jsonContent.getString("sign");
// //鉴权
// R res = authService.auth(sn,appKey,timestamp,sign);
// if((Integer) res.get("code") != 0){
// return res;
// }
// log.debug("设备端修改人员:"+sn);
// TenDeviceEntity deviceEntity = tenDeviceService.findBySn(sn);
////----------------------------------------以下业务-----------------------------------------------------
// JSONObject personJson = jsonContent.getJSONObject("data");
//
//
// TenPersonEntity tenPerson = JSONObject.toJavaObject(personJson,TenPersonEntity.class);
// tenPerson.setPersonId(personJson.getLong("uid"));
//
// if(tenPerson.getIdCard()!=null){
// if(tenPerson.getIdCard().length() == 15){
// String id18 = Convert.toEighteen(tenPerson.getIdCard());
// tenPerson.setIdCard(id18);
// }
// }
//
// if (tenPerson.getRoomId()!=null) {
// TenRoomEntity roomEntity = tenRoomService.getById(tenPerson.getRoomId(),tenPerson.getCellId());
// if(roomEntity!=null){
// tenPerson.setBuildId(roomEntity.getBuildId());
// }
// }
//
// Date now = new Date();
//// long id = new SnowflakeIdWorker().nextId();
//// tenPerson.setPersonId(id);
//// tenPerson.setUuid(UUIDUtil.uuid());
// tenPerson.setTenantId(deviceEntity.getTenantId());
//// tenPerson.setCreateBy(sn);
//// tenPerson.setRegisterType(Constant.RESGISTER_TYPE_Device);
// tenPerson.setStatus(Constant.PESON_SUATUS_NOMOR);
//// tenPerson.setCreateTime(now);
// tenPerson.setLastUpdateTime(now);
//
// tenPerson.setCellId(deviceEntity.getCellId());
//
//
// String orgImageBase64 = personJson.getString("orgImageBase64");
// if(orgImageBase64!=null && orgImageBase64.length()>0){
// try {
// //保存原始图片
// String userFileUrl = globalValue.getImagesDir() + "/" +
// tenPerson.getCellId().toString() + "/" +
// tenPerson.getPersonId().toString() + "/";
// String orgImageFileName = userFileUrl + "o_" + UUIDUtil.uuid() + ".jpg";
//
// byte[] b = Base64.getDecoder().decode(orgImageBase64.replace("\n",""));
// InputStream inputStream = new ByteArrayInputStream(b);
// PutObjectOptions putObjectOptions = new PutObjectOptions(inputStream.available(), -1);
// putObjectOptions.setContentType("image/jpeg");
// minioClient.putObject(
// minioConfig.getBucketName(), orgImageFileName, inputStream, putObjectOptions);
// inputStream.close();
//
// tenPerson.setOrgImage(orgImageFileName);
// tenPerson.setFaceImage(orgImageFileName);
//
// } catch (Exception e) {
// return R.error(e.getMessage());
// }
// }
//
// //处理类型
// //1. 不是固定类型给一个默认的家属类型
// if(tenPerson.getPersonType()>10000){
// tenPerson.setLabelId(tenPerson.getPersonType());
// tenPerson.setPersonType(Constant.PERSON_TYPE_MEMBER);//
// } else if (tenPerson.getPersonType() == Constant.PERSON_TYPE_OWNER
// || tenPerson.getPersonType() == Constant.PERSON_TYPE_TENANT
// || tenPerson.getPersonType() == Constant.PERSON_TYPE_MEMBER) {
// TenLabelEntity labelEntity = tenLabelService.getOne(new QueryWrapper<TenLabelEntity>()
// .eq("type",tenPerson.getPersonType())
// .eq("tenant_id",deviceEntity.getTenantId()));
// if(labelEntity!=null){
// tenPerson.setLabelId(labelEntity.getLabelId().intValue());
// }
// }
// int resSave = tenPersonService.update3d(tenPerson);
// if (resSave==1) {
// return R.error("添加失败");
// }
// JSONObject personRes = new JSONObject();
// personRes.put("uid",tenPerson.getPersonId());
// personRes.put("last_update_stamp",DateUtils.format(tenPerson.getLastUpdateTime(),DateUtils.DATE_TIME_PATTERN));
// return R.ok().put("data",personRes);
//
// }
}

View File

@ -360,4 +360,10 @@ public class TenPersonEntity extends BaseEntity implements Serializable {
@TableField(exist = false)
private String deptAllName;
//--------v10掌静脉---------------
private String pvLeft;
private String pvRight;
private Integer featureType;
}

View File

@ -56,6 +56,8 @@ public class TenRecordEntity implements Serializable {
private Long roomId;
/**
* 开门方式
* ['刷卡开门', '刷脸开门', '密码开门', '远程开门', '二维码开门','指纹识别','掌静脉识别']
* 1-7
*/
@ApiModelProperty("开门方式1人脸识别2远程一键开门")
private Integer openType;

View File

@ -29,6 +29,7 @@ public interface TenPersonService {
int save(TenPersonEntity entity);
int save3d(TenPersonEntity entity);
int update3d(TenPersonEntity entity);
boolean saveOtherRoom(TenPersonEntity entity);
// boolean removeById(Long roomId,Long cellId);

View File

@ -534,6 +534,38 @@ public class TenPersonServiceImpl implements TenPersonService {
@Override
@Transactional(rollbackFor = Exception.class)
@CacheEvict(value = "TenPerson", allEntries = true)
public int update3d(TenPersonEntity entity) {
int flag = tenPersonDao.updateById(entity);
if (flag == 1) {
//发送设备通知
//配置同步数据
List<TenPersonSyncEntity> syncEntitys = tenPersonSyncService.findByPersonId(entity.getPersonId(), entity.getTenantId());
for (TenPersonSyncEntity syncEn : syncEntitys) {
syncEn.setLastUpdateTime(entity.getLastUpdateTime());
syncEn.setState(2);
tenPersonSyncService.updateById(syncEn);
//下发通知
List<TenPersonOperationVo> list = new ArrayList<>();
TenPersonOperationVo vo = new TenPersonOperationVo();
vo.setUid(entity.getPersonId());
vo.setOperation(2);
vo.setLast_update_stamp(entity.getLastUpdateTime());
list.add(vo);
serverApiService.personOperation(syncEn.getDeviceSn(), list);
}
return 0;
}
return 1;
}
//添加多个房产

View File

@ -44,5 +44,10 @@ public class TenUserVo {
private Integer labelId;
private String labelName;
//--------v10掌静脉---------------
private String pvLeft;
private String pvRight;
private Integer featureType;
}

View File

@ -54,6 +54,10 @@
<result column="camera_param" jdbcType="VARCHAR" property="cameraParam" />
<result column="dept_id" jdbcType="BIGINT" property="deptId" />
<result column="pv_left" jdbcType="VARCHAR" property="pvLeft" />
<result column="pv_right" jdbcType="VARCHAR" property="pvRight" />
<result column="feature_type" jdbcType="TINYINT" property="featureType" />
<association property="cellName" javaType="String"
select="net.shapelight.modules.ten.dao.TenCellDao.getCellName"
column="cellId=cell_id">
@ -259,6 +263,16 @@
dept_id,
</if>
<if test="pvLeft != null">
pv_left,
</if>
<if test="pvRight != null">
pv_right,
</if>
<if test="featureType != null">
feature_type,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
@ -408,6 +422,17 @@
<if test="deptId != null">
#{deptId,jdbcType=BIGINT},
</if>
<if test="pvLeft != null">
#{pvLeft},
</if>
<if test="pvRight != null">
#{pvRight},
</if>
<if test="featureType != null">
#{featureType},
</if>
</trim>
</insert>
@ -563,6 +588,16 @@
dept_id = #{deptId,jdbcType=BIGINT},
</if>
<if test="pvLeft != null">
pv_left = #{pvLeft},
</if>
<if test="pvRight != null">
pv_right = #{pvRight},
</if>
<if test="featureType != null">
feature_type = #{featureType},
</if>
</set>
where person_id = #{personId,jdbcType=BIGINT}

131
version-face-model-pv.txt Normal file
View File

@ -0,0 +1,131 @@
v4.0
1.sys_device_type表 启用other字段0表示2d,1表示3dv4.0加入空表示2d
2.ten_device表增加两个字段识别阈值recognize_score_3d,检测方式detection_type
3.ten_person表增加5个字段depth,face_model,source_file,camera_param
4.ten_record表增加8个字段depth,source_file,duration,threshold,distance,score3d,temperature,camera_param
v4.0 数据库修改内容
alter table ten_device_copy1
ADD COLUMN recognize_score3d varchar(30) DEFAULT '62,65' COMMENT '3d识别阈值',
ADD COLUMN detection_type tinyint(1) DEFAULT 0 COMMENT '0默认2d检测 13d检测';
alter table ten_person_copy1
ADD COLUMN depth varchar(200) COMMENT '深度图片',
ADD COLUMN face_model varchar(200) COMMENT '脸模',
ADD COLUMN source_file varchar(200) COMMENT '源文件',
ADD COLUMN camera_param varchar(200) COMMENT '相机参数';
alter table ten_record_9999999999999
ADD COLUMN depth varchar(200) COMMENT '深度图片',
ADD COLUMN source_file varchar(200) COMMENT '源文件',
ADD COLUMN camera_param varchar(200) COMMENT '相机参数',
ADD COLUMN duration int(11) COMMENT '耗时',
ADD COLUMN threshold varchar(50) COMMENT '阈值',
ADD COLUMN distance float COMMENT '距离',
ADD COLUMN score3d varchar(50) COMMENT '分数',
ADD COLUMN temperature float COMMENT '体温';
------------------------v8.0 http协议版本数据库更新说明先执行以下sql语句在跑批处理程序-----------------
1.ten_device表增加字段app_language,lat,lon
2.ten_person表增加字段thd_feature,dept_id
3.ten_person表person_type字段默认5000
4.sys_menu表增加4条参数20012002,2003,2004
5.ten_company表增加type_id字段关联
6.ten_label表type字段类型修改为int
7.增加表 ten_cell_dept
8.增加表 ten_device_operate_log
9.增加表 ten_company_type
10.页面修改角色
alter table ten_device ADD COLUMN app_language tinyint(1) DEFAULT 0 COMMENT 'app版本';
alter table ten_device ADD COLUMN lat varchar(50) DEFAULT '' COMMENT '纬度';
alter table ten_device ADD COLUMN lon varchar(50) DEFAULT '' COMMENT '经度';
alter table ten_person ADD COLUMN thd_feature varchar(10240) COMMENT '3d特征';
alter table ten_person ADD COLUMN dept_id bigint(20) COMMENT '部门id';
alter table ten_person ALTER COLUMN person_type SET DEFAULT 5000;
INSERT INTO `sys_menu` VALUES (2001, 3, '设备Log', 'sys/deviceLog', 'sys:devicelog', 1, 'shebei', 6, 'system_devicelog');
INSERT INTO `sys_menu` VALUES (2002, 1210, '操作记录', 'ten/deviceoperatelog', 'ten:deviceoperatelog', 1, 'shebei', 6, 'tenant_deviceoperatelog');
INSERT INTO `sys_menu` VALUES (2003, 1234, '组织管理', 'ten/celldept', 'ten:celldept', 1, 'shebei', 6, 'tenant_celldept');
INSERT INTO `sys_menu` VALUES (2004, 1220, '单位类别', 'ten/companytype', 'ten:companytype', 1, 'shebei', 6, 'tenant_companytype');
alter table ten_company ADD COLUMN type_id bigint(20) COMMENT '类别id';
ALTER TABLE ten_label MODIFY COLUMN type INT(11);
CREATE TABLE `ten_cell_dept` (
`dept_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '部门/楼栋',
`parent_id` bigint(20) DEFAULT NULL COMMENT '父级目录',
`cell_id` bigint(20) NOT NULL COMMENT '小区ID',
`name` varchar(200) DEFAULT NULL COMMENT '名称',
`lable` varchar(100) DEFAULT NULL COMMENT '标签',
`lat` varchar(50) DEFAULT '' COMMENT '纬度',
`lon` varchar(50) DEFAULT '' COMMENT '经度',
`other` varchar(200) DEFAULT '' COMMENT '其他',
`remark` varchar(100) DEFAULT '' COMMENT '备注',
`picture` varchar(1024) DEFAULT '' COMMENT '照片',
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`create_by` varchar(100) DEFAULT '' COMMENT '创建人',
`last_update_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
`last_update_by` varchar(100) DEFAULT '' COMMENT '更新人',
`delete_flag` tinyint(1) DEFAULT '0' COMMENT '0未删除1删除',
`tenant_id` bigint(20) unsigned zerofill DEFAULT '00000000000000000000' COMMENT '运营商ID',
`xa_sync` tinyint(1) DEFAULT '0' COMMENT '第三方是否同步1是0否默认0',
`p_id` int(18) DEFAULT NULL COMMENT '地址序号',
`dzbm` varchar(100) DEFAULT NULL COMMENT '地址编码',
`is_room` tinyint(1) DEFAULT '0' COMMENT '是否是户室0否1是',
`room_type` tinyint(1) DEFAULT '0' COMMENT '类型:自住,出租',
PRIMARY KEY (`dept_id`)
) ENGINE=InnoDB AUTO_INCREMENT=37291 DEFAULT CHARSET=utf8mb4;
CREATE TABLE `ten_company_type` (
`type_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`name` varchar(100) DEFAULT '' COMMENT '标签名称',
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`create_by` varchar(100) DEFAULT '' COMMENT '创建人',
`last_update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`last_update_by` varchar(100) DEFAULT '' COMMENT '更新人',
`delete_flag` tinyint(1) DEFAULT '0' COMMENT '0未删除1删除',
`tenant_id` bigint(20) NOT NULL COMMENT '运营商ID',
PRIMARY KEY (`type_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=10033 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='标签';
CREATE TABLE `ten_device_operate_log` (
`log_id` bigint(20) NOT NULL AUTO_INCREMENT,
`sn` varchar(100) DEFAULT NULL,
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`operation` varchar(200) DEFAULT NULL COMMENT '用户操作',
`tenant_id` bigint(20) DEFAULT NULL COMMENT '运营商Id',
PRIMARY KEY (`log_id`)
) ENGINE=InnoDB AUTO_INCREMENT=667 DEFAULT CHARSET=utf8mb4;
CREATE TABLE `sys_device_log` (
`log_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`sn` varchar(50) DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
`log` varchar(16000) DEFAULT NULL,
PRIMARY KEY (`log_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=418 DEFAULT CHARSET=utf8mb4;
------------------------v9.0 考勤版本-----------------
1.增加表ten_rule
2.增加表ten_schedule
3.增加表ten_check
4.增加表ten_check_schedule
5.menu表增加2010,2011,2012,2013,2014五条记录
------------------------掌静脉支持,人员表增加三个字段-----------------
alter table ten_person ADD COLUMN pv_left text COMMENT '左手';
alter table ten_person ADD COLUMN pv_right text COMMENT '右手';
alter table ten_person ADD COLUMN feature_type tinyint(2) COMMENT '特征类型12d23d3掌静脉';