智慧校园
This commit is contained in:
parent
7a60125f71
commit
23f214d1d0
|
@ -0,0 +1,20 @@
|
||||||
|
# 使用官方Java运行环境作为基础镜像
|
||||||
|
FROM openjdk:1.8-jre-slim
|
||||||
|
|
||||||
|
# 指定维护者信息
|
||||||
|
LABEL maintainer="zhangbo"
|
||||||
|
|
||||||
|
# 在镜像中创建一个目录存放我们的Spring Boot应用
|
||||||
|
VOLUME /tmp
|
||||||
|
|
||||||
|
# 将jar包添加到容器中并更名为app.jar
|
||||||
|
ADD shapelight-admin/target/shapelight-admin.jar app.jar
|
||||||
|
|
||||||
|
# 暴露容器内的端口给外部访问
|
||||||
|
EXPOSE 8018
|
||||||
|
|
||||||
|
# 定义环境变量
|
||||||
|
ENV JAVA_OPTS=""
|
||||||
|
|
||||||
|
# 在容器启动时运行jar包
|
||||||
|
ENTRYPOINT exec java $JAVA_OPTS -Djava.security.egd=file:/dev/./cell -jar /app.jar
|
|
@ -23700,7 +23700,7 @@ COMMIT;
|
||||||
-- Table structure for ten_person_sync_823856146077974529
|
-- Table structure for ten_person_sync_823856146077974529
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
DROP TABLE IF EXISTS `ten_person_sync_823856146077974529`;
|
DROP TABLE IF EXISTS `ten_person_sync_823856146077974529`;
|
||||||
CREATE TABLE `ten_person_sync_823856146077974529` (
|
CREATE TABLE `ten_person_sync_1298283126102949890` (
|
||||||
`person_sync_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
|
`person_sync_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
|
||||||
`device_id` bigint(20) DEFAULT NULL COMMENT '设备id',
|
`device_id` bigint(20) DEFAULT NULL COMMENT '设备id',
|
||||||
`device_sn` varchar(200) DEFAULT NULL COMMENT '设备sn',
|
`device_sn` varchar(200) DEFAULT NULL COMMENT '设备sn',
|
||||||
|
@ -23737,7 +23737,7 @@ COMMIT;
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Table structure for ten_person_sync_823877891644194818
|
-- Table structure for ten_person_sync_823877891644194818
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
DROP TABLE IF EXISTS `ten_person_sync_823877891644194818`;
|
DROP TABLE IF EXISTS `ten_person_sync_1298283126102949890`;
|
||||||
CREATE TABLE `ten_person_sync_823877891644194818` (
|
CREATE TABLE `ten_person_sync_823877891644194818` (
|
||||||
`person_sync_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
|
`person_sync_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
|
||||||
`device_id` bigint(20) DEFAULT NULL COMMENT '设备id',
|
`device_id` bigint(20) DEFAULT NULL COMMENT '设备id',
|
||||||
|
|
14
pom.xml
14
pom.xml
|
@ -45,8 +45,22 @@
|
||||||
<gson.version>2.8.5</gson.version>
|
<gson.version>2.8.5</gson.version>
|
||||||
<!--<sharding.jdbc.version>3.0.0</sharding.jdbc.version>-->
|
<!--<sharding.jdbc.version>3.0.0</sharding.jdbc.version>-->
|
||||||
<sharding.jdbc.version>2.0.3</sharding.jdbc.version>
|
<sharding.jdbc.version>2.0.3</sharding.jdbc.version>
|
||||||
|
<spring-cloud.version>Greenwich.SR1</spring-cloud.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
<dependencyManagement>
|
||||||
|
<dependencies>
|
||||||
|
<!-- SpringCloud 版本依赖 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-dependencies</artifactId>
|
||||||
|
<version>${spring-cloud.version}</version>
|
||||||
|
<type>pom</type>
|
||||||
|
<scope>import</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</dependencyManagement>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>junit</groupId>
|
<groupId>junit</groupId>
|
||||||
|
|
|
@ -32,6 +32,11 @@
|
||||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- <dependency>-->
|
<!-- <dependency>-->
|
||||||
<!-- <groupId>redis.clients</groupId>-->
|
<!-- <groupId>redis.clients</groupId>-->
|
||||||
<!-- <artifactId>jedis</artifactId>-->
|
<!-- <artifactId>jedis</artifactId>-->
|
||||||
|
|
|
@ -11,6 +11,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||||
import org.springframework.boot.web.servlet.ServletComponentScan;
|
import org.springframework.boot.web.servlet.ServletComponentScan;
|
||||||
import org.springframework.cache.annotation.EnableCaching;
|
import org.springframework.cache.annotation.EnableCaching;
|
||||||
|
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||||
import org.springframework.context.annotation.ImportResource;
|
import org.springframework.context.annotation.ImportResource;
|
||||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||||
|
|
||||||
|
@ -20,6 +21,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||||
@EnableCaching
|
@EnableCaching
|
||||||
@EnableTransactionManagement
|
@EnableTransactionManagement
|
||||||
@ServletComponentScan
|
@ServletComponentScan
|
||||||
|
@EnableFeignClients
|
||||||
//@MapperScan("net.shapelight.modules.sys.dao")
|
//@MapperScan("net.shapelight.modules.sys.dao")
|
||||||
public class AdminApplication {
|
public class AdminApplication {
|
||||||
|
|
||||||
|
@ -27,8 +29,8 @@ public class AdminApplication {
|
||||||
SpringApplication.run(AdminApplication.class, args);
|
SpringApplication.run(AdminApplication.class, args);
|
||||||
|
|
||||||
//初始化掌静脉sdk
|
//初始化掌静脉sdk
|
||||||
int initCode = PalmSDK.init();
|
//int initCode = PalmSDK.init();
|
||||||
log.debug("掌静脉sdk初始化。。。。。。。。。。:"+initCode);
|
//log.debug("掌静脉sdk初始化。。。。。。。。。。:"+initCode);
|
||||||
// //mqtt服务启动
|
// //mqtt服务启动
|
||||||
// MqttClientUtil.createClient();
|
// MqttClientUtil.createClient();
|
||||||
//
|
//
|
||||||
|
|
|
@ -98,5 +98,8 @@ public class GlobalValue {
|
||||||
@Value("${global.app.secret}")
|
@Value("${global.app.secret}")
|
||||||
private String appSecret;
|
private String appSecret;
|
||||||
|
|
||||||
|
@Value("${global.qingju.accountNumber}")
|
||||||
|
public String accountNumber;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,13 +30,15 @@ public class Constant {
|
||||||
public static final int ROLE_TEN_CELL = 3000; //小区主管 添加楼栋
|
public static final int ROLE_TEN_CELL = 3000; //小区主管 添加楼栋
|
||||||
//public static final int ROLE_TEN_BUILD = 4000; //楼栋管理 只能管理某些楼栋
|
//public static final int ROLE_TEN_BUILD = 4000; //楼栋管理 只能管理某些楼栋
|
||||||
|
|
||||||
public static final int PERSON_TYPE_OWNER = 5000; //业主
|
public static final int PERSON_TYPE_OWNER = 5000; //学生
|
||||||
public static final int PERSON_TYPE_MEMBER = 5001; //家属住户
|
public static final int PERSON_TYPE_MEMBER = 5001; //
|
||||||
public static final int PERSON_TYPE_TENANT = 5002; //租户
|
public static final int PERSON_TYPE_TENANT = 5002; //
|
||||||
public static final int PERSON_TYPE_GUEST = 5005; //访客
|
public static final int PERSON_TYPE_GUEST = 5005; //访客
|
||||||
public static final int PERSON_TYPE_PROPERTY = 5006; //物业人员
|
public static final int PERSON_TYPE_PROPERTY = 5006; //教职工
|
||||||
|
public static final int PERSON_TYPE_PARENT = 5007; //家长
|
||||||
public static final int PERSON_TYPE_WHITE = 5007; //白名单
|
public static final int PERSON_TYPE_WHITE = 5007; //白名单
|
||||||
public static final int PERSON_TYPE_BLACK = 5008; //黑名单
|
public static final int PERSON_TYPE_BLACK = 5008; //黑名单
|
||||||
|
public static final int PERSON_TYPE_STUDENT = 5008; //黑名单
|
||||||
|
|
||||||
public static final int USER_STATUS_NOMOR = 1; //用户状态,正常
|
public static final int USER_STATUS_NOMOR = 1; //用户状态,正常
|
||||||
public static final int USER_STATUS_DESABLE = 0; //用户状态,禁用
|
public static final int USER_STATUS_DESABLE = 0; //用户状态,禁用
|
||||||
|
|
|
@ -3,6 +3,8 @@ package net.shapelight.modules.app.controller;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
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 io.minio.MinioClient;
|
import io.minio.MinioClient;
|
||||||
import io.minio.PutObjectOptions;
|
import io.minio.PutObjectOptions;
|
||||||
|
@ -18,6 +20,7 @@ import net.shapelight.modules.app.entity.AppUserScopeEntity;
|
||||||
import net.shapelight.modules.app.service.AppUserScopeService;
|
import net.shapelight.modules.app.service.AppUserScopeService;
|
||||||
import net.shapelight.modules.app.service.AppUserService;
|
import net.shapelight.modules.app.service.AppUserService;
|
||||||
//import net.shapelight.modules.dev.mqtt.CmdProcess;
|
//import net.shapelight.modules.dev.mqtt.CmdProcess;
|
||||||
|
import net.shapelight.modules.job.entity.KeysEntity;
|
||||||
import net.shapelight.modules.nettyapi.service.ServerApiService;
|
import net.shapelight.modules.nettyapi.service.ServerApiService;
|
||||||
import net.shapelight.modules.sys.entity.*;
|
import net.shapelight.modules.sys.entity.*;
|
||||||
import net.shapelight.modules.sys.service.*;
|
import net.shapelight.modules.sys.service.*;
|
||||||
|
@ -25,16 +28,21 @@ import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import net.shapelight.modules.ten.entity.*;
|
import net.shapelight.modules.ten.entity.*;
|
||||||
import net.shapelight.modules.ten.service.*;
|
import net.shapelight.modules.ten.service.*;
|
||||||
|
import net.shapelight.modules.tripartitePlatform.operatorPlatform.OpFeignClient;
|
||||||
import net.shapelight.modules.vo.TenCelldeptSelectVo;
|
import net.shapelight.modules.vo.TenCelldeptSelectVo;
|
||||||
import net.shapelight.modules.vo.TenCelldeptWeVo;
|
import net.shapelight.modules.vo.TenCelldeptWeVo;
|
||||||
import net.shapelight.modules.vo.TenDeviceVo;
|
import net.shapelight.modules.vo.TenDeviceVo;
|
||||||
|
import org.apache.commons.codec.digest.DigestUtils;
|
||||||
import org.apache.commons.io.FilenameUtils;
|
import org.apache.commons.io.FilenameUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* APP测试接口
|
* APP测试接口
|
||||||
|
@ -84,6 +92,13 @@ public class AppApiController {
|
||||||
private TenLabelService tenLabelService;
|
private TenLabelService tenLabelService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private RedisUtils redisUtils;
|
private RedisUtils redisUtils;
|
||||||
|
@Autowired
|
||||||
|
private TenParentService tenParentService;
|
||||||
|
@Autowired
|
||||||
|
private TenRelationService relationService;
|
||||||
|
@Qualifier("net.shapelight.modules.tripartitePlatform.operatorPlatform.OpFeignClient")
|
||||||
|
@Autowired
|
||||||
|
private OpFeignClient opFeignClient;
|
||||||
|
|
||||||
|
|
||||||
@Login
|
@Login
|
||||||
|
@ -106,9 +121,11 @@ public class AppApiController {
|
||||||
public R checkCellAdmin(@RequestBody Map params) {
|
public R checkCellAdmin(@RequestBody Map params) {
|
||||||
String adminMobile = (String) params.get("adminMobile");
|
String adminMobile = (String) params.get("adminMobile");
|
||||||
String cellId = appUserService.checkCellAdmin(adminMobile);
|
String cellId = appUserService.checkCellAdmin(adminMobile);
|
||||||
|
String tenantId = String.valueOf(tenCellService.getById(cellId).getTenantId());
|
||||||
if (cellId != null && !cellId.isEmpty()) {
|
if (cellId != null && !cellId.isEmpty()) {
|
||||||
Map<String, Object> cellMap = new HashMap<>();
|
Map<String, Object> cellMap = new HashMap<>();
|
||||||
cellMap.put("cellId", cellId);
|
cellMap.put("cellId", cellId);
|
||||||
|
cellMap.put("tenantId",tenantId);
|
||||||
return R.ok().put("data", cellMap);
|
return R.ok().put("data", cellMap);
|
||||||
} else {
|
} else {
|
||||||
return R.error("验证失败,请检查输入是否正确或者联系小区管理员");
|
return R.error("验证失败,请检查输入是否正确或者联系小区管理员");
|
||||||
|
@ -118,6 +135,7 @@ public class AppApiController {
|
||||||
|
|
||||||
@PostMapping("/registerUser")
|
@PostMapping("/registerUser")
|
||||||
@ApiOperation("注册用户")
|
@ApiOperation("注册用户")
|
||||||
|
@Transactional
|
||||||
public R registerUser(@RequestBody TenPersonEntity tenPerson) {
|
public R registerUser(@RequestBody TenPersonEntity tenPerson) {
|
||||||
//验证app人员是否注册
|
//验证app人员是否注册
|
||||||
// if (tenPerson.getAppFlag() == Constant.APP_LOGIN_YES) {
|
// if (tenPerson.getAppFlag() == Constant.APP_LOGIN_YES) {
|
||||||
|
@ -131,8 +149,34 @@ public class AppApiController {
|
||||||
if (appUser != null) {
|
if (appUser != null) {
|
||||||
return R.error("手机号已经注册");
|
return R.error("手机号已经注册");
|
||||||
}
|
}
|
||||||
|
AppUserEntity appUser1 = new AppUserEntity();
|
||||||
|
appUser1.setUsername(tenPerson.getUsername());
|
||||||
|
appUser1.setMobile(tenPerson.getMobile());
|
||||||
|
//sha256加密
|
||||||
|
// String salt = RandomStringUtils.randomAlphanumeric(20);
|
||||||
|
// appUser.setPassword(new Sha256Hash(entity.getPassword(), salt).toHex());
|
||||||
|
// appUser.setSalt(salt);
|
||||||
|
appUser1.setPassword(DigestUtils.sha256Hex(tenPerson.getPassword()));
|
||||||
|
appUser1.setCreateTime(new Date());
|
||||||
|
appUser1.setTenantId(tenPerson.getTenantId());
|
||||||
|
appUserService.save(appUser1);
|
||||||
|
AppUserScopeEntity appScope = new AppUserScopeEntity();
|
||||||
|
appScope.setPersonId(tenPerson.getPersonId());
|
||||||
|
appScope.setCellId(tenPerson.getCellId());
|
||||||
|
appScope.setUserId(appUser1.getUserId());
|
||||||
|
appScope.setRoleId(Constant.PERSON_TYPE_PARENT);
|
||||||
|
appUserScopeService.save(appScope);
|
||||||
|
|
||||||
TenCellEntity cell = tenCellService.getById(tenPerson.getCellId());
|
appUser1.setCurrentScopeId(appScope.getUserScopeId());
|
||||||
|
appUserService.updateById(appUser1);
|
||||||
|
TenParent tenParent = new TenParent();
|
||||||
|
tenParent.setName(tenPerson.getName());
|
||||||
|
tenParent.setGender(tenPerson.getGender());
|
||||||
|
tenParent.setIdCard(tenPerson.getIdCard());
|
||||||
|
tenParent.setRegisterType(Constant.RESGISTER_TYPE_APP);
|
||||||
|
tenParent.setUserId(appUser1.getUserId());
|
||||||
|
tenParentService.save(tenParent);
|
||||||
|
/*TenCellEntity cell = tenCellService.getById(tenPerson.getCellId());
|
||||||
long id = new SnowflakeIdWorker().nextId();
|
long id = new SnowflakeIdWorker().nextId();
|
||||||
tenPerson.setPersonId(id);
|
tenPerson.setPersonId(id);
|
||||||
tenPerson.setUuid(UUIDUtil.uuid());
|
tenPerson.setUuid(UUIDUtil.uuid());
|
||||||
|
@ -143,13 +187,6 @@ public class AppApiController {
|
||||||
tenPerson.setAppFlag(Constant.APP_LOGIN_YES);
|
tenPerson.setAppFlag(Constant.APP_LOGIN_YES);
|
||||||
tenPerson.setStatus(Constant.PESON_SUATUS_WAITREVIEW);
|
tenPerson.setStatus(Constant.PESON_SUATUS_WAITREVIEW);
|
||||||
|
|
||||||
if(tenPerson.getIdCard()!=null){
|
|
||||||
if(tenPerson.getIdCard().length() == 15){
|
|
||||||
String id18 = Convert.toEighteen(tenPerson.getIdCard());
|
|
||||||
tenPerson.setIdCard(id18);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
TenPersonEntity tenPersonEntity = tenPersonService.findByName(tenPerson.getName(),
|
TenPersonEntity tenPersonEntity = tenPersonService.findByName(tenPerson.getName(),
|
||||||
tenPerson.getRoomId(),tenPerson.getCellId());
|
tenPerson.getRoomId(),tenPerson.getCellId());
|
||||||
|
@ -157,32 +194,12 @@ public class AppApiController {
|
||||||
return R.error("姓名在此房间已存在");
|
return R.error("姓名在此房间已存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(tenPerson.getIdCard()!=null){
|
|
||||||
// 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("身份证在此组织已存在");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tenPerson.setPersonType(5000);
|
|
||||||
if(tenPerson.getPersonType() == 5000 || tenPerson.getPersonType() == 5001 || tenPerson.getPersonType() == 5002){
|
|
||||||
TenLabelEntity labelEntity = tenLabelService.getOne(new QueryWrapper<TenLabelEntity>()
|
|
||||||
.eq("type",tenPerson.getPersonType())
|
|
||||||
.eq("tenant_id",tenPerson.getTenantId()));
|
|
||||||
if(labelEntity!=null){
|
|
||||||
tenPerson.setLabelId(labelEntity.getLabelId().intValue());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int res = tenPersonService.save(tenPerson);
|
int res = tenPersonService.save(tenPerson);
|
||||||
if (res==2) {
|
if (res==2) {
|
||||||
return R.error("照片未检测到人脸");
|
return R.error("照片未检测到人脸");
|
||||||
}
|
}*/
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -288,47 +305,53 @@ public class AppApiController {
|
||||||
Long cellId = Long.parseLong((String) params.get("cellId"));
|
Long cellId = Long.parseLong((String) params.get("cellId"));
|
||||||
Long buildId = Long.parseLong((String) params.get("buildId"));
|
Long buildId = Long.parseLong((String) params.get("buildId"));
|
||||||
Integer layer = Integer.parseInt((String) params.get("layer"));
|
Integer layer = Integer.parseInt((String) params.get("layer"));
|
||||||
List<TenRoomEntity> buildList = tenRoomService.getLayerRooms(layer, buildId, cellId);
|
List<TenRoomEntity> buildList = tenRoomService.getLayerRooms(buildId, cellId);
|
||||||
return R.ok().put("data", buildList);
|
return R.ok().put("data", buildList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Login
|
||||||
@PostMapping("addVisitor")
|
@PostMapping("addVisitor")
|
||||||
@ApiOperation("添加访客")
|
@ApiOperation("添加访客")
|
||||||
public R addVisitor(@RequestBody TenPersonEntity tenPerson) {
|
public R addVisitor(@LoginUser AppUserEntity user,@RequestBody TenPersonEntity tenPerson) throws Exception {
|
||||||
|
|
||||||
// public static final int PERSON_TYPE_OWNER = 5000; //业主
|
// public static final int PERSON_TYPE_OWNER = 5000; //业主
|
||||||
// public static final int PERSON_TYPE_MEMBER = 5001; //家属住户
|
// public static final int PERSON_TYPE_MEMBER = 5001; //家属住户
|
||||||
// public static final int PERSON_TYPE_TENANT = 5002; //租户
|
// public static final int PERSON_TYPE_TENANT = 5002; //租户
|
||||||
// public static final int PERSON_TYPE_GUEST = 5005; //访客
|
// public static final int PERSON_TYPE_GUEST = 5005; //访客
|
||||||
tenPerson.setPersonType(Constant.PERSON_TYPE_GUEST);
|
tenPerson.setLabelId(Constant.PERSON_TYPE_GUEST);
|
||||||
tenPerson.setAppFlag(Constant.APP_LOGIN_NO);
|
tenPerson.setAppFlag(Constant.APP_LOGIN_NO);
|
||||||
tenPerson.setStatus(Constant.PESON_SUATUS_NOMOR);
|
|
||||||
|
|
||||||
// TenPersonEntity tenPersonEntity = tenPersonService.findByName(tenPerson.getName(),
|
// TenPersonEntity tenPersonEntity = tenPersonService.findByName(tenPerson.getName(),
|
||||||
// tenPerson.getRoomId(),tenPerson.getCellId());
|
// tenPerson.getRoomId(),tenPerson.getCellId());
|
||||||
// if(tenPersonEntity!=null){
|
// if(tenPersonEntity!=null){
|
||||||
// return R.error("姓名在此房间已存在");
|
// return R.error("姓名在此房间已存在");
|
||||||
// }
|
// }
|
||||||
if(tenPerson.getIdCard()!=null){
|
AppUserScopeEntity appUserScopeEntity = appUserScopeService.getById(user.getCurrentScopeId());
|
||||||
if(tenPerson.getIdCard().length() == 15){
|
|
||||||
String id18 = Convert.toEighteen(tenPerson.getIdCard());
|
|
||||||
tenPerson.setIdCard(id18);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
TenCellEntity cell= tenCellService.getById(tenPerson.getCellId());
|
|
||||||
|
|
||||||
long id = new SnowflakeIdWorker().nextId();
|
long id = new SnowflakeIdWorker().nextId();
|
||||||
tenPerson.setPersonId(id);
|
tenPerson.setPersonId(id);
|
||||||
tenPerson.setUuid(UUIDUtil.uuid());
|
tenPerson.setUuid(UUIDUtil.uuid());
|
||||||
tenPerson.setTenantId(cell.getTenantId());
|
tenPerson.setCellId(appUserScopeEntity.getCellId());
|
||||||
|
//tenPerson.setTenantId(appUserScopeEntity.get());
|
||||||
// tenPerson.setCreateBy(user.getUsername());
|
// tenPerson.setCreateBy(user.getUsername());
|
||||||
tenPerson.setCreateTime(new Date());
|
tenPerson.setCreateTime(new Date());
|
||||||
tenPerson.setRegisterType(Constant.RESGISTER_TYPE_APP);
|
tenPerson.setRegisterType(Constant.RESGISTER_TYPE_APP);
|
||||||
Date now = new Date();
|
/*Date now = new Date();
|
||||||
tenPerson.setLiveStart(now);
|
tenPerson.setLiveStart(new Date());
|
||||||
tenPerson.setLiveEnd(new Date(now.getTime()+3600000L));
|
tenPerson.setLiveEnd(new Date(now.getTime()+3600000L));*/
|
||||||
int res = tenPersonService.save(tenPerson);
|
tenPerson.setCreateBy(user.getUserId().toString());
|
||||||
|
tenPerson.setStatus(2);
|
||||||
|
tenPerson.setPersonType(Constant.PERSON_TYPE_GUEST);
|
||||||
|
tenPerson.setTenantId(user.getTenantId());
|
||||||
|
int res;
|
||||||
|
try {
|
||||||
|
res = tenPersonService.save(tenPerson);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return R.error(e.getMessage());
|
||||||
|
}
|
||||||
if (res==2) {
|
if (res==2) {
|
||||||
return R.error("照片未检测到人脸");
|
return R.error("照片未检测到人脸");
|
||||||
}else if(res == 10){
|
}else if(res == 10){
|
||||||
|
@ -353,7 +376,7 @@ public class AppApiController {
|
||||||
PutObjectOptions putObjectOptions = new PutObjectOptions(inputStream.available(), -1);
|
PutObjectOptions putObjectOptions = new PutObjectOptions(inputStream.available(), -1);
|
||||||
putObjectOptions.setContentType(file.getContentType());
|
putObjectOptions.setContentType(file.getContentType());
|
||||||
minioClient.putObject(
|
minioClient.putObject(
|
||||||
minioConfig.getBucketName(), fileName, inputStream, putObjectOptions);
|
minioConfig.getBucketName(), fileName, inputStream, putObjectOptions) ;
|
||||||
inputStream.close();
|
inputStream.close();
|
||||||
return R.ok().put("data", fileName);
|
return R.ok().put("data", fileName);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -366,69 +389,10 @@ public class AppApiController {
|
||||||
@PostMapping("getCurrentScope")
|
@PostMapping("getCurrentScope")
|
||||||
@ApiOperation("获取当前管理房间")
|
@ApiOperation("获取当前管理房间")
|
||||||
public R getCurrentScope(@LoginUser AppUserEntity user) {
|
public R getCurrentScope(@LoginUser AppUserEntity user) {
|
||||||
if(user == null){
|
|
||||||
return R.error("用户不存在");
|
|
||||||
}
|
|
||||||
AppUserScopeEntity scope = new AppUserScopeEntity();
|
AppUserScopeEntity scope = new AppUserScopeEntity();
|
||||||
//有当前登录
|
//有当前登录
|
||||||
if (user.getCurrentScopeId() != null) {
|
|
||||||
scope = appUserScopeService.getById(user.getCurrentScopeId());
|
scope = appUserScopeService.getById(user.getCurrentScopeId());
|
||||||
//记录的当前登录已经不存在了
|
|
||||||
if(scope==null){
|
|
||||||
//没有当前登录,重新找
|
|
||||||
List<AppUserScopeEntity> scopes = appUserScopeService.list(new QueryWrapper<AppUserScopeEntity>()
|
|
||||||
.eq("user_id", user.getUserId()));
|
|
||||||
if (scopes.size() != 0) {
|
|
||||||
scope = scopes.get(0);
|
|
||||||
TenPersonEntity personEntity = tenPersonService.getById(scope.getPersonId(), scope.getCellId());
|
|
||||||
scope.setPerson(personEntity);
|
|
||||||
scope.setCellName(tenCellService.getCellName(scope.getCellId().toString()));
|
scope.setCellName(tenCellService.getCellName(scope.getCellId().toString()));
|
||||||
|
|
||||||
user.setCurrentScopeId(scope.getUserScopeId());
|
|
||||||
appUserService.updateById(user);
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
TenPersonEntity personEntity = tenPersonService.getById(scope.getPersonId(), scope.getCellId());
|
|
||||||
scope.setPerson(personEntity);
|
|
||||||
scope.setCellName(tenCellService.getCellName(scope.getCellId().toString()));
|
|
||||||
if(personEntity!=null){
|
|
||||||
if(personEntity.getDeptId()!=null){
|
|
||||||
TenCellDeptEntity dept = tenCellDeptService.getById(personEntity.getDeptId());
|
|
||||||
if(dept!=null){
|
|
||||||
personEntity.setDeptName(dept.getName());
|
|
||||||
String deptAllName = tenCellDeptService.getAllParentName(dept.getParentId());
|
|
||||||
personEntity.setDeptAllName(deptAllName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
|
||||||
//没有当前登录
|
|
||||||
List<AppUserScopeEntity> scopes = appUserScopeService.list(new QueryWrapper<AppUserScopeEntity>()
|
|
||||||
.eq("user_id", user.getUserId()));
|
|
||||||
if (scopes.size() != 0) {
|
|
||||||
scope = scopes.get(0);
|
|
||||||
TenPersonEntity personEntity = tenPersonService.getById(scope.getPersonId(), scope.getCellId());
|
|
||||||
scope.setPerson(personEntity);
|
|
||||||
scope.setCellName(tenCellService.getCellName(scope.getCellId().toString()));
|
|
||||||
|
|
||||||
user.setCurrentScopeId(scope.getUserScopeId());
|
|
||||||
appUserService.updateById(user);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(scope.getPerson()==null){
|
|
||||||
if (scope.getRoleId().intValue() == Constant.ROLE_TEN_CELL) {
|
|
||||||
SysUserEntity sysUserEntity = sysUserService.getById(user.getSysUserId());
|
|
||||||
if(sysUserEntity==null){
|
|
||||||
return R.error("用户无效");
|
|
||||||
}
|
|
||||||
scope.setSysUserRealName(sysUserEntity.getRealName());
|
|
||||||
}else{
|
|
||||||
return R.error("用户无效");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return R.ok().put("data", scope);
|
return R.ok().put("data", scope);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -535,7 +499,7 @@ public class AppApiController {
|
||||||
@Login
|
@Login
|
||||||
@PostMapping("addPerson")
|
@PostMapping("addPerson")
|
||||||
@ApiOperation("管理员添加人员")
|
@ApiOperation("管理员添加人员")
|
||||||
public R addPerson(@LoginUser AppUserEntity user, @RequestBody TenPersonEntity tenPerson) {
|
public R addPerson(@LoginUser AppUserEntity user, @RequestBody TenPersonEntity tenPerson) throws Exception {
|
||||||
if(user == null){
|
if(user == null){
|
||||||
return R.error("用户不存在");
|
return R.error("用户不存在");
|
||||||
}
|
}
|
||||||
|
@ -602,7 +566,12 @@ public class AppApiController {
|
||||||
tenPerson.setCreateTime(new Date());
|
tenPerson.setCreateTime(new Date());
|
||||||
tenPerson.setRegisterType(Constant.RESGISTER_TYPE_APP);
|
tenPerson.setRegisterType(Constant.RESGISTER_TYPE_APP);
|
||||||
tenPerson.setStatus(Constant.PESON_SUATUS_NOMOR);
|
tenPerson.setStatus(Constant.PESON_SUATUS_NOMOR);
|
||||||
int res = tenPersonService.save(tenPerson);
|
int res = 10;
|
||||||
|
try {
|
||||||
|
res = tenPersonService.save(tenPerson);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return R.error(e.getMessage());
|
||||||
|
}
|
||||||
if (res==2) {
|
if (res==2) {
|
||||||
return R.error("照片未检测到人脸");
|
return R.error("照片未检测到人脸");
|
||||||
}
|
}
|
||||||
|
@ -614,7 +583,7 @@ public class AppApiController {
|
||||||
@Login
|
@Login
|
||||||
@PostMapping("addMember")
|
@PostMapping("addMember")
|
||||||
@ApiOperation("业主添加成员")
|
@ApiOperation("业主添加成员")
|
||||||
public R addMember(@LoginUser AppUserEntity user, @RequestBody TenPersonEntity tenPerson) {
|
public R addMember(@LoginUser AppUserEntity user, @RequestBody TenPersonEntity tenPerson) throws Exception {
|
||||||
if(user == null){
|
if(user == null){
|
||||||
return R.error("用户不存在");
|
return R.error("用户不存在");
|
||||||
}
|
}
|
||||||
|
@ -693,7 +662,12 @@ public class AppApiController {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int res = tenPersonService.save(tenPerson);
|
int res;
|
||||||
|
try {
|
||||||
|
res = tenPersonService.save(tenPerson);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return R.error(e.getMessage());
|
||||||
|
}
|
||||||
if (res==2) {
|
if (res==2) {
|
||||||
return R.error("照片未检测到人脸");
|
return R.error("照片未检测到人脸");
|
||||||
}
|
}
|
||||||
|
@ -711,12 +685,12 @@ public class AppApiController {
|
||||||
})
|
})
|
||||||
|
|
||||||
public R getPersons(@LoginUser AppUserEntity user, @RequestBody Map<String, Object> params) {
|
public R getPersons(@LoginUser AppUserEntity user, @RequestBody Map<String, Object> params) {
|
||||||
if(user == null){
|
|
||||||
return R.error("用户不存在");
|
|
||||||
}
|
|
||||||
String key = (String)params.get("key");
|
String key = (String)params.get("key");
|
||||||
|
|
||||||
AppUserScopeEntity scope = appUserScopeService.getById(user.getCurrentScopeId());
|
AppUserScopeEntity scope = appUserScopeService.getById(user.getCurrentScopeId());
|
||||||
|
/*if(scope.getCellId() == 766326638739718144l ){
|
||||||
|
return R.error(AppComm.NOTICE_MOVE);
|
||||||
|
}
|
||||||
|
|
||||||
///小区管理员获取所有人员
|
///小区管理员获取所有人员
|
||||||
// List<TenPersonEntity> pList = new ArrayList<>();
|
// List<TenPersonEntity> pList = new ArrayList<>();
|
||||||
|
@ -724,16 +698,7 @@ public class AppApiController {
|
||||||
// pList = tenPersonService.getByCellId(scope.getCellId(),key);
|
// pList = tenPersonService.getByCellId(scope.getCellId(),key);
|
||||||
params.put("cellId",scope.getCellId().toString());
|
params.put("cellId",scope.getCellId().toString());
|
||||||
PageUtils page = tenPersonService.getByCellIdQueryPage(params);
|
PageUtils page = tenPersonService.getByCellIdQueryPage(params);
|
||||||
for(TenPersonEntity person: (List<TenPersonEntity>)page.getList()){
|
|
||||||
if(person.getDeptId()!=null){
|
|
||||||
TenCellDeptEntity dept = tenCellDeptService.getById(person.getDeptId());
|
|
||||||
if(dept!=null){
|
|
||||||
person.setDeptName(dept.getName());
|
|
||||||
String deptAllName = tenCellDeptService.getAllParentName(dept.getParentId());
|
|
||||||
person.setDeptAllName(deptAllName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return R.ok().put("data", page);
|
return R.ok().put("data", page);
|
||||||
}
|
}
|
||||||
//业主获取家庭成员,业主,租户,家庭成员
|
//业主获取家庭成员,业主,租户,家庭成员
|
||||||
|
@ -743,22 +708,28 @@ public class AppApiController {
|
||||||
TenPersonEntity personEntity = tenPersonService.getById(scope.getPersonId(),scope.getCellId());
|
TenPersonEntity personEntity = tenPersonService.getById(scope.getPersonId(),scope.getCellId());
|
||||||
// pList = tenPersonService.getByRoomId(personEntity.getRoomId(),scope.getCellId(),key);
|
// pList = tenPersonService.getByRoomId(personEntity.getRoomId(),scope.getCellId(),key);
|
||||||
params.put("cellId",scope.getCellId().toString());
|
params.put("cellId",scope.getCellId().toString());
|
||||||
// params.put("roomId",personEntity.getRoomId().toString());
|
params.put("roomId",personEntity.getRoomId().toString());
|
||||||
params.put("deptId",personEntity.getDeptId().toString());
|
PageUtils page = tenPersonService.selectByRoomIdQueryPage(params);
|
||||||
// PageUtils page = tenPersonService.selectByRoomIdQueryPage(params);
|
|
||||||
PageUtils page = tenPersonService.selectByDeptIdQueryPage(params);
|
|
||||||
for(TenPersonEntity person: (List<TenPersonEntity>)page.getList()){
|
|
||||||
if(person.getDeptId()!=null){
|
|
||||||
TenCellDeptEntity dept = tenCellDeptService.getById(person.getDeptId());
|
|
||||||
if(dept!=null){
|
|
||||||
person.setDeptName(dept.getName());
|
|
||||||
String deptAllName = tenCellDeptService.getAllParentName(dept.getParentId());
|
|
||||||
person.setDeptAllName(deptAllName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return R.ok().put("data", page);
|
return R.ok().put("data", page);
|
||||||
|
}*/
|
||||||
|
List<TenRelation> relationList = null;
|
||||||
|
if(params.get("status")!=null) {
|
||||||
|
relationList = relationService.list(new LambdaQueryWrapper<TenRelation>()
|
||||||
|
.eq(TenRelation::getParentId,user.getUserId())
|
||||||
|
.eq(TenRelation::getStatus,params.get("status")));
|
||||||
|
} else {
|
||||||
|
relationList = relationService.list(new LambdaQueryWrapper<TenRelation>()
|
||||||
|
.eq(TenRelation::getParentId,user.getUserId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(!relationList.isEmpty()) {
|
||||||
|
List<Long> list = relationList.stream().map(TenRelation::getStudentId).collect(Collectors.toList());
|
||||||
|
params.put("cellId",scope.getCellId());
|
||||||
|
params.put("personIds",list.stream().distinct().collect(Collectors.toList()));
|
||||||
|
PageUtils page = tenPersonService.selectBypersonIds(params);
|
||||||
|
return R.ok().put("data",page);
|
||||||
}
|
}
|
||||||
return R.ok().put("data",new PageUtils(new ArrayList<>(),0,0,0));
|
return R.ok().put("data",new PageUtils(new ArrayList<>(),0,0,0));
|
||||||
|
|
||||||
|
@ -776,39 +747,13 @@ public class AppApiController {
|
||||||
})
|
})
|
||||||
|
|
||||||
public R getGuest(@LoginUser AppUserEntity user, @RequestBody Map<String, Object> params) {
|
public R getGuest(@LoginUser AppUserEntity user, @RequestBody Map<String, Object> params) {
|
||||||
if(user == null){
|
|
||||||
return R.error("用户不存在");
|
|
||||||
}
|
|
||||||
String key = (String)params.get("key");
|
String key = (String)params.get("key");
|
||||||
|
|
||||||
AppUserScopeEntity scope = appUserScopeService.getById(user.getCurrentScopeId());
|
AppUserScopeEntity scope = appUserScopeService.getById(user.getCurrentScopeId());
|
||||||
|
params.put("cellId", scope.getCellId().toString());
|
||||||
//获取访客
|
params.put("createBy", user.getUserId().toString());
|
||||||
if(scope.getRoleId() == Constant.PERSON_TYPE_OWNER
|
PageUtils page = tenPersonService.selectByCreateByQueryPage(params);
|
||||||
|| scope.getRoleId() == Constant.PERSON_TYPE_MEMBER
|
|
||||||
|| scope.getRoleId() == Constant.PERSON_TYPE_TENANT){
|
|
||||||
TenPersonEntity personEntity = tenPersonService.getById(scope.getPersonId(),scope.getCellId());
|
|
||||||
// pList = tenPersonService.getByRoomId(personEntity.getRoomId(),scope.getCellId(),key);
|
|
||||||
params.put("cellId",scope.getCellId().toString());
|
|
||||||
// params.put("roomId",personEntity.getRoomId().toString());
|
|
||||||
params.put("deptId",personEntity.getDeptId().toString());
|
|
||||||
// PageUtils page = tenPersonService.selectByRoomIdForGuestQueryPage(params);
|
|
||||||
PageUtils page = tenPersonService.selectByDeptIdForGuestQueryPage(params);
|
|
||||||
|
|
||||||
for(TenPersonEntity person: (List<TenPersonEntity>)page.getList()){
|
|
||||||
if(person.getDeptId()!=null){
|
|
||||||
TenCellDeptEntity dept = tenCellDeptService.getById(person.getDeptId());
|
|
||||||
if(dept!=null){
|
|
||||||
person.setDeptName(dept.getName());
|
|
||||||
String deptAllName = tenCellDeptService.getAllParentName(dept.getParentId());
|
|
||||||
person.setDeptAllName(deptAllName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return R.ok().put("data", page);
|
return R.ok().put("data", page);
|
||||||
}
|
|
||||||
return R.ok().put("data",new PageUtils(new ArrayList<>(),0,0,0));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -820,25 +765,9 @@ public class AppApiController {
|
||||||
@ApiImplicitParam(name="cellId",value = "小区",paramType = "query",dataType = "String",required = true)
|
@ApiImplicitParam(name="cellId",value = "小区",paramType = "query",dataType = "String",required = true)
|
||||||
})
|
})
|
||||||
public R deletePerson(@LoginUser AppUserEntity user, @RequestBody List<Map<String, String>> params) {
|
public R deletePerson(@LoginUser AppUserEntity user, @RequestBody List<Map<String, String>> params) {
|
||||||
if(user == null){
|
|
||||||
return R.error("用户不存在");
|
|
||||||
}
|
|
||||||
AppUserScopeEntity scope = appUserScopeService.getById(user.getCurrentScopeId());
|
AppUserScopeEntity scope = appUserScopeService.getById(user.getCurrentScopeId());
|
||||||
//不能删除自己
|
//业主,不能删除自己
|
||||||
if (scope.getRoleId().intValue() != Constant.ROLE_TEN_CELL) {
|
|
||||||
//住户,家属
|
|
||||||
for (Map<String, String> param : params) {
|
|
||||||
Long personId = Long.parseLong(param.get("personId"));
|
|
||||||
Long cellId = Long.parseLong(param.get("cellId"));
|
|
||||||
if(scope.getPersonId().longValue() == personId.longValue()){
|
|
||||||
return R.error("不能删除自己");
|
|
||||||
}
|
|
||||||
TenPersonEntity personEntity = tenPersonService.getById(personId,cellId);
|
|
||||||
if(scope.getRoleId().intValue()>personEntity.getPersonType().intValue()){
|
|
||||||
return R.error("您无权删除"+personEntity.getName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
tenPersonService.removeByIdList(params);
|
tenPersonService.removeByIdList(params);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
@ -1019,4 +948,145 @@ public class AppApiController {
|
||||||
//// }
|
//// }
|
||||||
// return R.ok().put("data", areaSelectList);
|
// return R.ok().put("data", areaSelectList);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
@Login
|
||||||
|
@PostMapping("/binding")
|
||||||
|
@ApiOperation("绑定学员")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "cellId", value = "学校ID", paramType = "query", dataType = "String", required = true),
|
||||||
|
@ApiImplicitParam(name = "studentId", value = "学号", paramType = "query", dataType = "String", required = true)
|
||||||
|
})
|
||||||
|
public R binding(@LoginUser AppUserEntity user, @RequestBody Map<String,Object> params) {
|
||||||
|
AppUserScopeEntity userScopeEntity = appUserScopeService.getById(user.getCurrentScopeId());
|
||||||
|
Long cellId = userScopeEntity.getCellId();
|
||||||
|
if(params.get("ryId")==null) {
|
||||||
|
return R.error("请输入学号");
|
||||||
|
}
|
||||||
|
if(params.get("idCard")==null) {
|
||||||
|
return R.error("请输入身份证号");
|
||||||
|
}
|
||||||
|
String ryId = params.get("ryId").toString();
|
||||||
|
String idCard = params.get("idCard").toString();
|
||||||
|
TenPersonEntity entity = tenPersonService.getByRyId(ryId,cellId,idCard);
|
||||||
|
if(entity == null) {
|
||||||
|
return R.error("学生未录入");
|
||||||
|
}
|
||||||
|
TenRelation tenRelation =relationService.getOne(new LambdaQueryWrapper<TenRelation>()
|
||||||
|
.eq(TenRelation::getParentId,user.getUserId())
|
||||||
|
.eq(TenRelation::getStudentId,entity.getPersonId()));
|
||||||
|
if(tenRelation!=null) {
|
||||||
|
return R.error("该学生已和您绑定");
|
||||||
|
}
|
||||||
|
TenRelation relation = new TenRelation();
|
||||||
|
relation.setParentId(user.getUserId());
|
||||||
|
relation.setStudentId(entity.getPersonId());
|
||||||
|
relation.setCreateTime(new Date());
|
||||||
|
relation.setStatus(2);
|
||||||
|
relation.setRelation(params.get("salutation").toString());
|
||||||
|
Map<String,Object> opParams = new HashMap<>();
|
||||||
|
opParams.put("operation","editUserContactData");
|
||||||
|
opParams.put("accountNumber",globalValue.accountNumber);
|
||||||
|
opParams.put("passKey", KeysEntity.passKey);
|
||||||
|
opParams.put("empowerText",KeysEntity.empowerText);
|
||||||
|
List<Map<String,Object>> dataInfo = new ArrayList<>();
|
||||||
|
Map<String,Object> info = new HashMap<>();
|
||||||
|
info.put("objectUuid",user.getUserId().toString());
|
||||||
|
info.put("userUuid",user.getUserId().toString());
|
||||||
|
info.put("salutation",params.get("salutation"));
|
||||||
|
info.put("phoneNumber",user.getMobile());
|
||||||
|
info.put("orderNumber",1);
|
||||||
|
dataInfo.add(info);
|
||||||
|
opParams.put("dataInfo",dataInfo);
|
||||||
|
/* JSONObject jsonObject = opFeignClient.submitData(opParams);
|
||||||
|
if(!jsonObject.getString("shrgStatus").equals("S")) {
|
||||||
|
return R.error("同步联系人失败");
|
||||||
|
}
|
||||||
|
if(!jsonObject.getJSONArray("errInfo").isEmpty()) {
|
||||||
|
return R.error("同步联系人失败");
|
||||||
|
}*/
|
||||||
|
/* 请求参数:
|
||||||
|
{
|
||||||
|
"operation": "editUserContactData",
|
||||||
|
"accountNumber": "",
|
||||||
|
"empowerText": "",
|
||||||
|
"passKey": "",
|
||||||
|
"dataInfo": [{
|
||||||
|
"objectUuid": "CU0F996E19C57D11EDBE15A4BB6D5C0823",
|
||||||
|
"userUuid": "CUCFF2A6776A0811EC82B900163E029240",
|
||||||
|
"salutation": "爸爸",
|
||||||
|
"phoneNumber": "136****0097",
|
||||||
|
"orderNumber": 1
|
||||||
|
},
|
||||||
|
*//* 此次省略8个联系人名单json数据*//*
|
||||||
|
,
|
||||||
|
{
|
||||||
|
"objectUuid": "CU0F996E19C57D11EDBE15A4BB6D5C0824",
|
||||||
|
"userUuid": "CUCFF2A6776A0811EC82B900163E029240",
|
||||||
|
"salutation": "妈妈",
|
||||||
|
"phoneNumber": "136****0098",
|
||||||
|
"orderNumber": 1
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}*/
|
||||||
|
|
||||||
|
relationService.save(relation);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Login
|
||||||
|
@PostMapping("/remove")
|
||||||
|
public R removeBing(@LoginUser AppUserEntity user, @RequestBody List<Map<String,Object>> params) {
|
||||||
|
//AppUserScopeEntity userScopeEntity = appUserScopeService.getById(user.getCurrentScopeId());
|
||||||
|
Map<String,Object> opParams = new HashMap<>();
|
||||||
|
opParams.put("operation","delUserContactData");
|
||||||
|
opParams.put("accountNumber",globalValue.accountNumber);
|
||||||
|
opParams.put("passKey", KeysEntity.passKey);
|
||||||
|
opParams.put("empowerText",KeysEntity.empowerText);
|
||||||
|
List<Map<String,Object>> dataInfo = new ArrayList<>();
|
||||||
|
Map<String,Object> info = new HashMap<>();
|
||||||
|
info.put("objectUuid",user.getUserId());
|
||||||
|
dataInfo.add(info);
|
||||||
|
opParams.put("dataInfo",dataInfo);
|
||||||
|
JSONObject jsonObject = opFeignClient.submitData(opParams);
|
||||||
|
if(!jsonObject.getString("shrgStatus").equals("S")) {
|
||||||
|
return R.error("同步联系人失败");
|
||||||
|
}
|
||||||
|
if(!jsonObject.getJSONArray("errInfo").isEmpty()) {
|
||||||
|
return R.error("同步联系人失败");
|
||||||
|
}
|
||||||
|
List<String> list = new ArrayList<>();
|
||||||
|
params.forEach(item -> {
|
||||||
|
list.add(item.get("personId").toString());
|
||||||
|
});
|
||||||
|
relationService.remove(new LambdaQueryWrapper<TenRelation>()
|
||||||
|
.eq(TenRelation::getParentId,user.getUserId())
|
||||||
|
.in(TenRelation::getStudentId,list));
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Login
|
||||||
|
@GetMapping("/selectByCellId/{cellId}")
|
||||||
|
@ApiOperation(value = "下拉选择楼栋,通过选择小区联动查询",response = TenBuildEntity.class)
|
||||||
|
public R selectByCellId(@LoginUser AppUserEntity user,@PathVariable("cellId") Long cellId){
|
||||||
|
String tenantId = user.getTenantId()+"";
|
||||||
|
Map<String,Object> params = new HashMap<>();
|
||||||
|
params.put("tenantId",tenantId+"");
|
||||||
|
List<TenBuildEntity> buildList = tenBuildService.selectByCellId(cellId);
|
||||||
|
// for(TenBuildEntity buildEntity: buildList){
|
||||||
|
// buildEntity.setName(buildEntity.getName()+buildEntity.getUnit()+"单元");
|
||||||
|
// }
|
||||||
|
return R.ok().put("data", buildList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下拉框选择
|
||||||
|
*/
|
||||||
|
@Login
|
||||||
|
@GetMapping("/select/{cellId}/{buildId}")
|
||||||
|
@ApiOperation(value = "下拉选择房间名称,通过单元楼层",response = TenBuildEntity.class)
|
||||||
|
public R select(@PathVariable("cellId") Long cellId,
|
||||||
|
@PathVariable("buildId") Long buildId){
|
||||||
|
List<TenRoomEntity> buildList = tenRoomService.getLayerRooms(buildId,cellId);
|
||||||
|
return R.ok().put("data", buildList);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package net.shapelight.modules.app.controller;
|
package net.shapelight.modules.app.controller;
|
||||||
|
|
||||||
|
|
||||||
|
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 io.minio.MinioClient;
|
import io.minio.MinioClient;
|
||||||
import io.minio.PutObjectOptions;
|
import io.minio.PutObjectOptions;
|
||||||
|
@ -27,6 +28,7 @@ import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* APP测试接口
|
* APP测试接口
|
||||||
|
@ -66,6 +68,8 @@ public class AppInfoApiController {
|
||||||
private TenRecordService tenRecordService;
|
private TenRecordService tenRecordService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private TenCellDeptService tenCellDeptService;
|
private TenCellDeptService tenCellDeptService;
|
||||||
|
@Autowired
|
||||||
|
private TenRelationService relationService;
|
||||||
|
|
||||||
|
|
||||||
@Login
|
@Login
|
||||||
|
@ -308,19 +312,18 @@ public class AppInfoApiController {
|
||||||
return R.ok().put("data", page);
|
return R.ok().put("data", page);
|
||||||
}
|
}
|
||||||
//业主
|
//业主
|
||||||
else if(scope.getRoleId() == Constant.PERSON_TYPE_OWNER
|
else if(scope.getRoleId() == Constant.PERSON_TYPE_PARENT){
|
||||||
|| scope.getRoleId() == Constant.PERSON_TYPE_MEMBER
|
List<TenRelation> relationList = relationService.list(new LambdaQueryWrapper<TenRelation>()
|
||||||
|| scope.getRoleId() == Constant.PERSON_TYPE_TENANT){
|
.eq(TenRelation::getParentId,user.getUserId()));
|
||||||
TenPersonEntity personEntity = tenPersonService.getById(scope.getPersonId(),scope.getCellId());
|
if(!relationList.isEmpty()) {
|
||||||
// pList = tenPersonService.getByRoomId(personEntity.getRoomId(),scope.getCellId(),key);
|
List<Long> list = relationList.stream().map(TenRelation::getStudentId).collect(Collectors.toList());
|
||||||
params.put("cellId",scope.getCellId().toString());
|
params.put("cellId",scope.getCellId());
|
||||||
// params.put("roomId",personEntity.getRoomId().toString());
|
params.put("personIds",list);
|
||||||
params.put("deptId",personEntity.getDeptId().toString());
|
PageUtils page = tenRecordService.getByPersonIds(params);
|
||||||
// PageUtils page = tenRecordService.queryPageRoomRecord(params);
|
|
||||||
PageUtils page = tenRecordService.queryPageDeptRecord(params);
|
|
||||||
return R.ok().put("data", page);
|
return R.ok().put("data", page);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return R.ok().put("data",new PageUtils(new ArrayList<>(),0,0,0));
|
return R.ok().put("data",new PageUtils(new ArrayList<>(),0,0,0));
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,5 +14,5 @@ public interface ITask {
|
||||||
*
|
*
|
||||||
* @param params 参数,多参数使用JSON数据
|
* @param params 参数,多参数使用JSON数据
|
||||||
*/
|
*/
|
||||||
void run(String params);
|
void run(String params) throws Exception;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@ import io.minio.MinioClient;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
import java.io.SyncFailedException;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
@ -686,7 +687,12 @@ public class XaImageTask implements ITask {
|
||||||
if(errLine.equals("empty")){
|
if(errLine.equals("empty")){
|
||||||
for (TenPersonEntity recordEntity : updatePersons) {
|
for (TenPersonEntity recordEntity : updatePersons) {
|
||||||
recordEntity.setXaSyncImage(1);
|
recordEntity.setXaSyncImage(1);
|
||||||
|
try {
|
||||||
tenPersonService.updateById(recordEntity);
|
tenPersonService.updateById(recordEntity);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
String[] lines = errLine.split(",");
|
String[] lines = errLine.split(",");
|
||||||
|
@ -697,7 +703,11 @@ public class XaImageTask implements ITask {
|
||||||
}else {
|
}else {
|
||||||
TenPersonEntity recordEntity = updatePersons.get(i);
|
TenPersonEntity recordEntity = updatePersons.get(i);
|
||||||
recordEntity.setXaSyncImage(1);
|
recordEntity.setXaSyncImage(1);
|
||||||
|
try {
|
||||||
tenPersonService.updateById(recordEntity);
|
tenPersonService.updateById(recordEntity);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -708,7 +718,11 @@ public class XaImageTask implements ITask {
|
||||||
|| ((String)resData.get("Result")).indexOf("实有人口不存在")>0){
|
|| ((String)resData.get("Result")).indexOf("实有人口不存在")>0){
|
||||||
TenPersonEntity recordEntity = updatePersons.get(i);
|
TenPersonEntity recordEntity = updatePersons.get(i);
|
||||||
recordEntity.setXaSyncImage(1);
|
recordEntity.setXaSyncImage(1);
|
||||||
|
try {
|
||||||
tenPersonService.updateById(recordEntity);
|
tenPersonService.updateById(recordEntity);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ public class XaRealDataTask implements ITask {
|
||||||
@Autowired
|
@Autowired
|
||||||
private TenTranService tenTranService;
|
private TenTranService tenTranService;
|
||||||
|
|
||||||
public void run(String params) {
|
public void run(String params){
|
||||||
log.debug("一标三实定时任务正在执行", params);
|
log.debug("一标三实定时任务正在执行", params);
|
||||||
List<SysUserEntity> allSysTenUser = this.sysUserService.findAllSysTenUser();
|
List<SysUserEntity> allSysTenUser = this.sysUserService.findAllSysTenUser();
|
||||||
for (SysUserEntity sysTenUser : allSysTenUser) {
|
for (SysUserEntity sysTenUser : allSysTenUser) {
|
||||||
|
@ -303,7 +303,11 @@ public class XaRealDataTask implements ITask {
|
||||||
if(errLine.equals("empty")){
|
if(errLine.equals("empty")){
|
||||||
for (TenPersonEntity recordEntity : updatePersons) {
|
for (TenPersonEntity recordEntity : updatePersons) {
|
||||||
recordEntity.setXaSync(1);
|
recordEntity.setXaSync(1);
|
||||||
|
try {
|
||||||
tenPersonService.updateById(recordEntity);
|
tenPersonService.updateById(recordEntity);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
// List<XaSYRK> syncPersonsDelete = new ArrayList();
|
// List<XaSYRK> syncPersonsDelete = new ArrayList();
|
||||||
|
@ -314,11 +318,19 @@ public class XaRealDataTask implements ITask {
|
||||||
if(res.equals("接收成功")){
|
if(res.equals("接收成功")){
|
||||||
TenPersonEntity recordEntity = updatePersons.get(i);
|
TenPersonEntity recordEntity = updatePersons.get(i);
|
||||||
recordEntity.setXaSync(1);
|
recordEntity.setXaSync(1);
|
||||||
|
try {
|
||||||
tenPersonService.updateById(recordEntity);
|
tenPersonService.updateById(recordEntity);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage());
|
||||||
|
}
|
||||||
}else if(res.indexOf("违反唯一约束条件")>0){
|
}else if(res.indexOf("违反唯一约束条件")>0){
|
||||||
TenPersonEntity recordEntity = updatePersons.get(i);
|
TenPersonEntity recordEntity = updatePersons.get(i);
|
||||||
recordEntity.setXaSync(1);
|
recordEntity.setXaSync(1);
|
||||||
|
try {
|
||||||
tenPersonService.updateById(recordEntity);
|
tenPersonService.updateById(recordEntity);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage());
|
||||||
|
}
|
||||||
//页面删除过,但是没有上报,这次上报
|
//页面删除过,但是没有上报,这次上报
|
||||||
// XaSYRK realPerson = syncPersons.get(i);
|
// XaSYRK realPerson = syncPersons.get(i);
|
||||||
// realPerson.setLV_ZXSJ(DateUtils.format(new Date(),DateUtils.DATE_YEAR_MONTH));
|
// realPerson.setLV_ZXSJ(DateUtils.format(new Date(),DateUtils.DATE_YEAR_MONTH));
|
||||||
|
@ -412,7 +424,11 @@ public class XaRealDataTask implements ITask {
|
||||||
if(errLine.equals("empty")){
|
if(errLine.equals("empty")){
|
||||||
for (TenPersonEntity recordEntity : updatePersons) {
|
for (TenPersonEntity recordEntity : updatePersons) {
|
||||||
recordEntity.setXaSyncCard(1);
|
recordEntity.setXaSyncCard(1);
|
||||||
|
try {
|
||||||
tenPersonService.updateById(recordEntity);
|
tenPersonService.updateById(recordEntity);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
String[] lines = errLine.split(",");
|
String[] lines = errLine.split(",");
|
||||||
|
@ -423,7 +439,11 @@ public class XaRealDataTask implements ITask {
|
||||||
}else {
|
}else {
|
||||||
TenPersonEntity recordEntity = updatePersons.get(i);
|
TenPersonEntity recordEntity = updatePersons.get(i);
|
||||||
recordEntity.setXaSyncCard(1);
|
recordEntity.setXaSyncCard(1);
|
||||||
|
try {
|
||||||
tenPersonService.updateById(recordEntity);
|
tenPersonService.updateById(recordEntity);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -433,7 +453,11 @@ public class XaRealDataTask implements ITask {
|
||||||
if(((String)resData.get("Result")).indexOf("重复申报")>0){
|
if(((String)resData.get("Result")).indexOf("重复申报")>0){
|
||||||
TenPersonEntity recordEntity = updatePersons.get(i);
|
TenPersonEntity recordEntity = updatePersons.get(i);
|
||||||
recordEntity.setXaSyncCard(1);
|
recordEntity.setXaSyncCard(1);
|
||||||
|
try {
|
||||||
tenPersonService.updateById(recordEntity);
|
tenPersonService.updateById(recordEntity);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,4 +87,9 @@ public class SysDictController {
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all/{type}")
|
||||||
|
public R listAll(@PathVariable("type") String type) {
|
||||||
|
return R.ok().put("data",sysDictService.queryByType(type));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -135,10 +135,10 @@ public class SysLoginController extends AbstractController{
|
||||||
// return R.error("验证码不正确");
|
// return R.error("验证码不正确");
|
||||||
// }
|
// }
|
||||||
|
|
||||||
//this.loginForm.password = base.encode('f4fab52d797e197c'+this.loginForm.password)
|
/*//this.loginForm.password = base.encode('f4fab52d797e197c'+this.loginForm.password)
|
||||||
String p = Base64.decodeStr(form.getPassword());
|
String p = Base64.decodeStr(form.getPassword());
|
||||||
p = p.substring(16);
|
//p = p.substring(16);
|
||||||
form.setPassword(p);
|
form.setPassword(p);*/
|
||||||
//用户信息
|
//用户信息
|
||||||
SysUserEntity user = sysUserService.queryByUserName(form.getUsername());
|
SysUserEntity user = sysUserService.queryByUserName(form.getUsername());
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@ import net.shapelight.common.utils.PageUtils;
|
||||||
import net.shapelight.modules.sys.entity.SysDictEntity;
|
import net.shapelight.modules.sys.entity.SysDictEntity;
|
||||||
import net.shapelight.common.utils.PageUtils;
|
import net.shapelight.common.utils.PageUtils;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -17,5 +18,7 @@ import java.util.Map;
|
||||||
public interface SysDictService extends IService<SysDictEntity> {
|
public interface SysDictService extends IService<SysDictEntity> {
|
||||||
|
|
||||||
PageUtils queryPage(Map<String, Object> params);
|
PageUtils queryPage(Map<String, Object> params);
|
||||||
|
|
||||||
|
List<SysDictEntity> queryByType(String type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
package net.shapelight.modules.sys.service.impl;
|
package net.shapelight.modules.sys.service.impl;
|
||||||
|
|
||||||
|
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.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
@ -15,6 +16,7 @@ import net.shapelight.modules.sys.dao.SysDictDao;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
@ -34,4 +36,9 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictDao, SysDictEntity> i
|
||||||
return new PageUtils(page);
|
return new PageUtils(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SysDictEntity> queryByType(String type) {
|
||||||
|
return this.list(new LambdaQueryWrapper<SysDictEntity>().eq(SysDictEntity::getType,type));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,8 @@ package net.shapelight.modules.ten.controller;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
@ -9,6 +11,7 @@ import io.swagger.annotations.ApiImplicitParams;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import net.shapelight.common.utils.Constant;
|
import net.shapelight.common.utils.Constant;
|
||||||
import net.shapelight.common.utils.SnowflakeIdWorker;
|
import net.shapelight.common.utils.SnowflakeIdWorker;
|
||||||
|
import net.shapelight.modules.job.entity.KeysEntity;
|
||||||
import net.shapelight.modules.sys.controller.AbstractController;
|
import net.shapelight.modules.sys.controller.AbstractController;
|
||||||
import net.shapelight.modules.sys.entity.SysUserEntity;
|
import net.shapelight.modules.sys.entity.SysUserEntity;
|
||||||
import net.shapelight.modules.sys.service.SysUserRoleService;
|
import net.shapelight.modules.sys.service.SysUserRoleService;
|
||||||
|
@ -17,8 +20,12 @@ import net.shapelight.modules.ten.entity.TenUserScopeEntity;
|
||||||
import net.shapelight.modules.ten.service.TenCellService;
|
import net.shapelight.modules.ten.service.TenCellService;
|
||||||
import net.shapelight.modules.ten.service.TenPersonService;
|
import net.shapelight.modules.ten.service.TenPersonService;
|
||||||
import net.shapelight.modules.ten.service.TenUserScopeService;
|
import net.shapelight.modules.ten.service.TenUserScopeService;
|
||||||
|
import net.shapelight.modules.tripartitePlatform.operatorPlatform.OpFeignClient;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import net.shapelight.modules.ten.entity.TenBuildEntity;
|
import net.shapelight.modules.ten.entity.TenBuildEntity;
|
||||||
|
@ -46,6 +53,11 @@ public class TenBuildController extends AbstractController {
|
||||||
private TenUserScopeService tenUserScopeService;
|
private TenUserScopeService tenUserScopeService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private TenPersonService tenPersonService;
|
private TenPersonService tenPersonService;
|
||||||
|
@Value("${global.qingju.accountNumber}")
|
||||||
|
private String accountNumber;
|
||||||
|
@Qualifier("net.shapelight.modules.tripartitePlatform.operatorPlatform.OpFeignClient")
|
||||||
|
@Autowired
|
||||||
|
private OpFeignClient opFeignClient;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 列表
|
* 列表
|
||||||
|
@ -133,10 +145,37 @@ public class TenBuildController extends AbstractController {
|
||||||
//@RequiresPermissions("ten:build:save")
|
//@RequiresPermissions("ten:build:save")
|
||||||
@RequiresPermissions("ten:build")
|
@RequiresPermissions("ten:build")
|
||||||
@ApiOperation(value = "保存")
|
@ApiOperation(value = "保存")
|
||||||
|
@Transactional
|
||||||
public R save(@RequestBody TenBuildEntity tenBuild){
|
public R save(@RequestBody TenBuildEntity tenBuild){
|
||||||
TenBuildEntity check = tenBuildService.queryByNumberAndUnit(tenBuild.getNumber(),tenBuild.getUnit(),tenBuild.getCellId());
|
TenBuildEntity check = tenBuildService.queryByNumberAndUnit(tenBuild.getNumber(),tenBuild.getUnit(),tenBuild.getCellId());
|
||||||
if(check!=null){
|
if(check!=null){
|
||||||
return R.error("此楼栋单元已经存在");
|
return R.error("当前年级已经存在");
|
||||||
|
}
|
||||||
|
//"shrgMsg": "授权过期!"
|
||||||
|
/* operation String 接口名 默认:editGradeData
|
||||||
|
accountNumber String 账号
|
||||||
|
passKey String 授权Key
|
||||||
|
empowerText String 授权密文
|
||||||
|
dataInfo JsonArray[1-16] 具体内容 年级json集合,最多16个。
|
||||||
|
gradeCode String[0-50] 年级编码 年级编码传递请看附录A
|
||||||
|
必传*/
|
||||||
|
|
||||||
|
Map<String,Object> params = new HashMap<>();
|
||||||
|
params.put("operation","editGradeData");
|
||||||
|
params.put("accountNumber",accountNumber);
|
||||||
|
params.put("passKey", KeysEntity.passKey);
|
||||||
|
params.put("empowerText",KeysEntity.empowerText);
|
||||||
|
Map<String, Object> grade = new HashMap<>();
|
||||||
|
grade.put("gradeCode",tenBuild.getNumber());
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add(grade);
|
||||||
|
params.put("dataInfo",jsonArray);
|
||||||
|
JSONObject jsonObject = opFeignClient.submitData(params);
|
||||||
|
if(!jsonObject.getString("shrgStatus").equals("S")) {
|
||||||
|
return R.error("同步联系人失败");
|
||||||
|
}
|
||||||
|
if(jsonObject.getJSONArray("errInfo")!=null &&!jsonObject.getJSONArray("errInfo").isEmpty()) {
|
||||||
|
return R.error(tenBuild.getName() + "同步失败");
|
||||||
}
|
}
|
||||||
long id = new SnowflakeIdWorker().nextId();
|
long id = new SnowflakeIdWorker().nextId();
|
||||||
tenBuild.setBuildId(id);
|
tenBuild.setBuildId(id);
|
||||||
|
@ -144,7 +183,6 @@ public class TenBuildController extends AbstractController {
|
||||||
tenBuild.setCreateBy(getUser().getUsername());
|
tenBuild.setCreateBy(getUser().getUsername());
|
||||||
tenBuild.setCreateTime(new Date());
|
tenBuild.setCreateTime(new Date());
|
||||||
tenBuildService.save(tenBuild);
|
tenBuildService.save(tenBuild);
|
||||||
|
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,10 +193,28 @@ public class TenBuildController extends AbstractController {
|
||||||
//@RequiresPermissions("ten:build:update")
|
//@RequiresPermissions("ten:build:update")
|
||||||
@RequiresPermissions("ten:build")
|
@RequiresPermissions("ten:build")
|
||||||
@ApiOperation(value = "修改")
|
@ApiOperation(value = "修改")
|
||||||
|
@Transactional
|
||||||
public R update(@RequestBody TenBuildEntity tenBuild){
|
public R update(@RequestBody TenBuildEntity tenBuild){
|
||||||
tenBuild.setTenantId(getUser().getTenantId());
|
tenBuild.setTenantId(getUser().getTenantId());
|
||||||
tenBuild.setLastUpdateBy(getUser().getUsername());
|
tenBuild.setLastUpdateBy(getUser().getUsername());
|
||||||
tenBuild.setLastUpdateTime(new Date());
|
tenBuild.setLastUpdateTime(new Date());
|
||||||
|
Map<String,Object> params = new HashMap<>();
|
||||||
|
params.put("operation","editGradeData");
|
||||||
|
params.put("accountNumber",accountNumber);
|
||||||
|
params.put("passKey", KeysEntity.passKey);
|
||||||
|
params.put("empowerText",KeysEntity.empowerText);
|
||||||
|
Map<String, Object> grade = new HashMap<>();
|
||||||
|
grade.put("gradeCode",tenBuild.getNumber());
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add(grade);
|
||||||
|
params.put("dataInfo",jsonArray);
|
||||||
|
JSONObject jsonObject = opFeignClient.submitData(params);
|
||||||
|
if(!jsonObject.getString("shrgStatus").equals("S")) {
|
||||||
|
return R.error("同步联系人失败");
|
||||||
|
}
|
||||||
|
if(jsonObject.getJSONArray("errInfo")!=null &&!jsonObject.getJSONArray("errInfo").isEmpty()) {
|
||||||
|
return R.error("修改年级失败");
|
||||||
|
}
|
||||||
tenBuildService.updateById(tenBuild);
|
tenBuildService.updateById(tenBuild);
|
||||||
|
|
||||||
return R.ok();
|
return R.ok();
|
||||||
|
@ -175,14 +231,35 @@ public class TenBuildController extends AbstractController {
|
||||||
@ApiImplicitParam(name="buildId",value = "楼栋ID",paramType = "query",dataType = "String",required = true),
|
@ApiImplicitParam(name="buildId",value = "楼栋ID",paramType = "query",dataType = "String",required = true),
|
||||||
@ApiImplicitParam(name="cellId",value = "小区ID",paramType = "query",dataType = "String",required = true)
|
@ApiImplicitParam(name="cellId",value = "小区ID",paramType = "query",dataType = "String",required = true)
|
||||||
})
|
})
|
||||||
|
@Transactional
|
||||||
public R delete(@RequestBody List<Map<String, String>> params){
|
public R delete(@RequestBody List<Map<String, String>> params){
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
for(Map<String,String> param: params){
|
for(Map<String,String> param: params){
|
||||||
Long buildId = Long.parseLong(param.get("buildId"));
|
Long buildId = Long.parseLong(param.get("buildId"));
|
||||||
Long cellId = Long.parseLong(param.get("cellId"));
|
Long cellId = Long.parseLong(param.get("cellId"));
|
||||||
int pCount = tenPersonService.findBuildCount(cellId,buildId);
|
int pCount = tenPersonService.findBuildCount(cellId,buildId);
|
||||||
if (pCount>0) {
|
if (pCount>0) {
|
||||||
return R.error("当前楼栋有"+pCount+"个住户,请先删除完住户");
|
return R.error("当前年级有"+pCount+"个学生,请先删除学生");
|
||||||
}
|
}
|
||||||
|
TenBuildEntity tenBuild = tenBuildService.getById(buildId,cellId);
|
||||||
|
Map<String, Object> grade = new HashMap<>();
|
||||||
|
grade.put("gradeCode",tenBuild.getNumber());
|
||||||
|
jsonArray.add(grade);
|
||||||
|
}
|
||||||
|
Map<String,Object> gradeParams = new HashMap<>();
|
||||||
|
gradeParams.put("operation","delGradeData");
|
||||||
|
gradeParams.put("accountNumber",accountNumber);
|
||||||
|
gradeParams.put("passKey", KeysEntity.passKey);
|
||||||
|
gradeParams.put("empowerText",KeysEntity.empowerText);
|
||||||
|
gradeParams.put("dataInfo",jsonArray);
|
||||||
|
JSONObject jsonObject = opFeignClient.submitData(gradeParams);
|
||||||
|
if(!jsonObject.getString("shrgStatus").equals("S")) {
|
||||||
|
return R.error("同步联系人失败");
|
||||||
|
}
|
||||||
|
if(jsonObject.getJSONArray("errInfo")!=null && !jsonObject.getJSONArray("errInfo").isEmpty()) {
|
||||||
|
return R.error(jsonObject.getJSONArray("errInfo") + "删除失败");
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
tenBuildService.removeByIdList(params);
|
tenBuildService.removeByIdList(params);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
|
|
|
@ -0,0 +1,110 @@
|
||||||
|
package net.shapelight.modules.ten.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import net.shapelight.common.config.GlobalValue;
|
||||||
|
import net.shapelight.common.utils.PageUtils;
|
||||||
|
import net.shapelight.common.utils.R;
|
||||||
|
import net.shapelight.modules.app.entity.AppUserEntity;
|
||||||
|
import net.shapelight.modules.app.entity.AppUserScopeEntity;
|
||||||
|
import net.shapelight.modules.app.service.impl.AppUserScopeServiceImpl;
|
||||||
|
import net.shapelight.modules.app.service.impl.AppUserServiceImpl;
|
||||||
|
import net.shapelight.modules.job.entity.KeysEntity;
|
||||||
|
import net.shapelight.modules.ten.entity.TenParent;
|
||||||
|
import net.shapelight.modules.ten.entity.TenRelation;
|
||||||
|
import net.shapelight.modules.ten.service.TenParentService;
|
||||||
|
import net.shapelight.modules.ten.service.TenRelationService;
|
||||||
|
import net.shapelight.modules.tripartitePlatform.operatorPlatform.OpFeignClient;
|
||||||
|
import net.shapelight.modules.vo.ParentVo;
|
||||||
|
import org.apache.commons.codec.digest.DigestUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("ten/parent")
|
||||||
|
@Api(value="家长信息",tags="家长信息")
|
||||||
|
public class TenParentController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
TenParentService tenParentService;
|
||||||
|
@Autowired
|
||||||
|
private AppUserServiceImpl appUserService;
|
||||||
|
@Autowired
|
||||||
|
private AppUserScopeServiceImpl appUserScopeService;
|
||||||
|
@Autowired
|
||||||
|
private TenRelationService relationService;
|
||||||
|
@Autowired
|
||||||
|
private GlobalValue globalValue;
|
||||||
|
@Qualifier("net.shapelight.modules.tripartitePlatform.operatorPlatform.OpFeignClient")
|
||||||
|
@Autowired
|
||||||
|
private OpFeignClient opFeignClient;
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperation(value = "查询访客列表", response = ParentVo.class)
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "limit", value = "每页条数", paramType = "query", dataType = "String", required = true),
|
||||||
|
@ApiImplicitParam(name = "page", value = "页码", paramType = "query", dataType = "String", required = true),
|
||||||
|
@ApiImplicitParam(name = "name", value = "姓名", paramType = "query", dataType = "String", required = true),
|
||||||
|
@ApiImplicitParam(name = "mobile", value = "手机号", paramType = "query", dataType = "String", required = true)
|
||||||
|
})
|
||||||
|
public R getParentList(@RequestParam Map<String,Object> params) {
|
||||||
|
PageUtils page = tenParentService.getParentList(params);
|
||||||
|
|
||||||
|
return R.ok().put("data",page);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/delete")
|
||||||
|
@Transactional
|
||||||
|
public R deleteParent(@RequestBody List<Map<String, String>> params) throws Exception {
|
||||||
|
Map<String,Object> opParams = new HashMap<>();
|
||||||
|
opParams.put("operation","delUserContactData");
|
||||||
|
opParams.put("accountNumber",globalValue.accountNumber);
|
||||||
|
opParams.put("passKey", KeysEntity.passKey);
|
||||||
|
opParams.put("empowerText",KeysEntity.empowerText);
|
||||||
|
List<Map<String,Object>> dataInfo = new ArrayList<>();
|
||||||
|
Map<String,Object> info = new HashMap<>();
|
||||||
|
params.forEach(item -> {
|
||||||
|
TenParent tenParent = tenParentService.getById(item.get("id"));
|
||||||
|
info.put("objectUuid",tenParent.getUserId().toString());
|
||||||
|
dataInfo.add(info);
|
||||||
|
tenParentService.removeById(item.get("id"));
|
||||||
|
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")));
|
||||||
|
});
|
||||||
|
opParams.put("dataInfo",dataInfo);
|
||||||
|
JSONObject jsonObject = opFeignClient.submitData(opParams);
|
||||||
|
if(!jsonObject.getString("shrgStatus").equals("S")) {
|
||||||
|
return R.error("同步联系人失败");
|
||||||
|
}
|
||||||
|
if(!jsonObject.getJSONArray("errInfo").isEmpty()) {
|
||||||
|
return R.error("同步联系人失败");
|
||||||
|
}
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/reset")
|
||||||
|
public R resetPassWord(@RequestBody Map<String,Object> params) {
|
||||||
|
String id = params.get("id").toString();
|
||||||
|
String passWord = params.get("password").toString();
|
||||||
|
TenParent tenParent = tenParentService.getById(id);
|
||||||
|
AppUserEntity userEntity = appUserService.getById(tenParent.getUserId());
|
||||||
|
userEntity.setPassword(DigestUtils.sha256Hex(passWord));
|
||||||
|
appUserService.save(userEntity);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
}
|
|
@ -3,8 +3,13 @@ package net.shapelight.modules.ten.controller;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
import java.util.zip.ZipOutputStream;
|
import java.util.zip.ZipOutputStream;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
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 io.minio.MinioClient;
|
import io.minio.MinioClient;
|
||||||
import io.minio.PutObjectOptions;
|
import io.minio.PutObjectOptions;
|
||||||
|
@ -22,21 +27,30 @@ import net.shapelight.commons.engine.sdk.SdkImageUtils;
|
||||||
import net.shapelight.commons.engine.sdk.palm.FaceFeatureBase;
|
import net.shapelight.commons.engine.sdk.palm.FaceFeatureBase;
|
||||||
import net.shapelight.commons.engine.sdk.palm.OutArg;
|
import net.shapelight.commons.engine.sdk.palm.OutArg;
|
||||||
import net.shapelight.modules.app.entity.AppUserEntity;
|
import net.shapelight.modules.app.entity.AppUserEntity;
|
||||||
|
import net.shapelight.modules.app.entity.AppUserScopeEntity;
|
||||||
import net.shapelight.modules.app.service.AppUserService;
|
import net.shapelight.modules.app.service.AppUserService;
|
||||||
|
import net.shapelight.modules.app.service.impl.AppUserScopeServiceImpl;
|
||||||
import net.shapelight.modules.excel.model.PersonModel;
|
import net.shapelight.modules.excel.model.PersonModel;
|
||||||
|
import net.shapelight.modules.job.entity.KeysEntity;
|
||||||
import net.shapelight.modules.nettyapi.service.ServerApiService;
|
import net.shapelight.modules.nettyapi.service.ServerApiService;
|
||||||
import net.shapelight.modules.sys.controller.AbstractController;
|
import net.shapelight.modules.sys.controller.AbstractController;
|
||||||
|
import net.shapelight.modules.sys.entity.SysDictEntity;
|
||||||
import net.shapelight.modules.sys.entity.SysUserEntity;
|
import net.shapelight.modules.sys.entity.SysUserEntity;
|
||||||
import net.shapelight.modules.sys.service.SysUserRoleService;
|
import net.shapelight.modules.sys.service.SysUserRoleService;
|
||||||
import net.shapelight.modules.sys.service.SysUserService;
|
import net.shapelight.modules.sys.service.SysUserService;
|
||||||
|
import net.shapelight.modules.sys.service.impl.SysDictServiceImpl;
|
||||||
import net.shapelight.modules.ten.entity.*;
|
import net.shapelight.modules.ten.entity.*;
|
||||||
import net.shapelight.modules.ten.service.*;
|
import net.shapelight.modules.ten.service.*;
|
||||||
|
import net.shapelight.modules.tripartitePlatform.operatorPlatform.OpFeignClient;
|
||||||
import net.shapelight.modules.vo.TenDeviceVo;
|
import net.shapelight.modules.vo.TenDeviceVo;
|
||||||
import net.shapelight.modules.vo.TenPersonOperationVo;
|
import net.shapelight.modules.vo.TenPersonOperationVo;
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
import org.apache.commons.io.FilenameUtils;
|
import org.apache.commons.io.FilenameUtils;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
@ -86,6 +100,19 @@ public class TenPersonController extends AbstractController {
|
||||||
private TenCellDeptService tenCellDeptService;
|
private TenCellDeptService tenCellDeptService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private TenLabelService tenLabelService;
|
private TenLabelService tenLabelService;
|
||||||
|
@Autowired
|
||||||
|
private SysDictServiceImpl sysDictService;
|
||||||
|
@Value("${global.minio.endpoint}")
|
||||||
|
private String imagBaseUrl;
|
||||||
|
@Value("${global.minio.bucketName}")
|
||||||
|
private String bucketName;
|
||||||
|
@Qualifier("net.shapelight.modules.tripartitePlatform.operatorPlatform.OpFeignClient")
|
||||||
|
@Autowired
|
||||||
|
private OpFeignClient opFeignClient;
|
||||||
|
@Autowired
|
||||||
|
private AppUserScopeServiceImpl appUserScopeService;
|
||||||
|
@Autowired
|
||||||
|
private TenRelationService relationService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -109,6 +136,7 @@ public class TenPersonController extends AbstractController {
|
||||||
@ApiImplicitParam(name = "idCard", value = "证件号", paramType = "query", dataType = "String", required = true),
|
@ApiImplicitParam(name = "idCard", value = "证件号", paramType = "query", dataType = "String", required = true),
|
||||||
@ApiImplicitParam(name = "personType", value = "类型", paramType = "query", dataType = "String", required = true),
|
@ApiImplicitParam(name = "personType", value = "类型", paramType = "query", dataType = "String", required = true),
|
||||||
@ApiImplicitParam(name = "faceFailure", value = "人脸提取标志", paramType = "query", dataType = "String", required = true),
|
@ApiImplicitParam(name = "faceFailure", value = "人脸提取标志", paramType = "query", dataType = "String", required = true),
|
||||||
|
@ApiImplicitParam(name = "labelId", value = "类型", paramType = "query", dataType = "String", required = true)
|
||||||
})
|
})
|
||||||
public R list(@RequestParam Map<String, Object> params) {
|
public R list(@RequestParam Map<String, Object> params) {
|
||||||
String tenantId = getUser().getTenantId() + "";
|
String tenantId = getUser().getTenantId() + "";
|
||||||
|
@ -124,8 +152,8 @@ public class TenPersonController extends AbstractController {
|
||||||
List<TenLabelEntity> tenLabel = tenLabelService.list(new QueryWrapper<TenLabelEntity>()
|
List<TenLabelEntity> tenLabel = tenLabelService.list(new QueryWrapper<TenLabelEntity>()
|
||||||
.eq("tenant_id",getUser().getTenantId()));
|
.eq("tenant_id",getUser().getTenantId()));
|
||||||
personTypeList.add(Constant.PERSON_TYPE_OWNER);
|
personTypeList.add(Constant.PERSON_TYPE_OWNER);
|
||||||
personTypeList.add(Constant.PERSON_TYPE_MEMBER);
|
/*personTypeList.add(Constant.PERSON_TYPE_MEMBER);
|
||||||
personTypeList.add(Constant.PERSON_TYPE_TENANT);
|
personTypeList.add(Constant.PERSON_TYPE_TENANT);*/
|
||||||
params.put("personTypeList",personTypeList);
|
params.put("personTypeList",personTypeList);
|
||||||
PageUtils page = tenPersonService.queryPage(params);
|
PageUtils page = tenPersonService.queryPage(params);
|
||||||
|
|
||||||
|
@ -290,16 +318,14 @@ public class TenPersonController extends AbstractController {
|
||||||
.eq("user_id",tenantId));
|
.eq("user_id",tenantId));
|
||||||
person.setTenantName(sysUserEntity.getCompanyName());
|
person.setTenantName(sysUserEntity.getCompanyName());
|
||||||
|
|
||||||
if(person.getRoomId()!=null){
|
/*if(person.getPersonType().intValue() == Constant.PERSON_TYPE_MEMBER
|
||||||
if(person.getPersonType().intValue() == Constant.PERSON_TYPE_MEMBER
|
|
||||||
|| person.getPersonType().intValue() == Constant.PERSON_TYPE_OWNER
|
|| person.getPersonType().intValue() == Constant.PERSON_TYPE_OWNER
|
||||||
|| person.getPersonType().intValue() == Constant.PERSON_TYPE_TENANT
|
|| person.getPersonType().intValue() == Constant.PERSON_TYPE_TENANT
|
||||||
|| person.getPersonType().intValue() == Constant.PERSON_TYPE_GUEST){
|
|| person.getPersonType().intValue() == Constant.PERSON_TYPE_GUEST){
|
||||||
String n = String.format("%02d%s",Integer.parseInt(person.getBuildUnit()),person.getRoomName());
|
String n = String.format("%02d%s",Integer.parseInt(person.getBuildUnit()),person.getRoomName());
|
||||||
n = n.replace("室","");
|
n = n.replace("室","");
|
||||||
person.setDoorNumber(n);
|
person.setDoorNumber(n);
|
||||||
}
|
}*/
|
||||||
}
|
|
||||||
|
|
||||||
if(person.getDeptId()!=null){
|
if(person.getDeptId()!=null){
|
||||||
TenCellDeptEntity dept = tenCellDeptService.getById(person.getDeptId());
|
TenCellDeptEntity dept = tenCellDeptService.getById(person.getDeptId());
|
||||||
|
@ -330,7 +356,8 @@ public class TenPersonController extends AbstractController {
|
||||||
@PostMapping("/save")
|
@PostMapping("/save")
|
||||||
@RequiresPermissions("ten:person")
|
@RequiresPermissions("ten:person")
|
||||||
@ApiOperation(value = "保存人员信息")
|
@ApiOperation(value = "保存人员信息")
|
||||||
public R save(@RequestBody TenPersonEntity tenPerson) {
|
@Transactional
|
||||||
|
public R save(@RequestBody TenPersonEntity tenPerson) throws Exception {
|
||||||
// TenPersonEntity room = tenPersonService.queryByNumberAndLayer(tenRoom.getRoomNumber(),
|
// TenPersonEntity room = tenPersonService.queryByNumberAndLayer(tenRoom.getRoomNumber(),
|
||||||
// tenRoom.getLayer(),
|
// tenRoom.getLayer(),
|
||||||
// tenRoom.getBuildId(),
|
// tenRoom.getBuildId(),
|
||||||
|
@ -344,7 +371,7 @@ public class TenPersonController extends AbstractController {
|
||||||
tenPerson.setIdCard(id18);
|
tenPerson.setIdCard(id18);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//验证app人员是否注册
|
/*//验证app人员是否注册
|
||||||
if (tenPerson.getAppFlag() == Constant.APP_LOGIN_YES) {
|
if (tenPerson.getAppFlag() == Constant.APP_LOGIN_YES) {
|
||||||
//1.验证用户名
|
//1.验证用户名
|
||||||
AppUserEntity appUser = appUserService.findByUsername(tenPerson.getUsername());
|
AppUserEntity appUser = appUserService.findByUsername(tenPerson.getUsername());
|
||||||
|
@ -356,9 +383,9 @@ public class TenPersonController extends AbstractController {
|
||||||
if (appUser != null) {
|
if (appUser != null) {
|
||||||
return R.error("手机号已经注册");
|
return R.error("手机号已经注册");
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
//验证卡号
|
//验证卡号
|
||||||
if(tenPerson.getDoorCardEntity()!=null && tenPerson.getDoorCardEntity().getDoorCard().isEmpty()){
|
if(tenPerson.getDoorCardEntity()!=null && !tenPerson.getDoorCardEntity().getDoorCard().isEmpty()){
|
||||||
//1. 检查当前钥匙是否已经使用
|
//1. 检查当前钥匙是否已经使用
|
||||||
TenDoorCardEntity card = tenDoorCardService.getOne(new QueryWrapper<TenDoorCardEntity>()
|
TenDoorCardEntity card = tenDoorCardService.getOne(new QueryWrapper<TenDoorCardEntity>()
|
||||||
.eq("door_card",tenPerson.getDoorCardEntity().getDoorCard())
|
.eq("door_card",tenPerson.getDoorCardEntity().getDoorCard())
|
||||||
|
@ -373,7 +400,7 @@ public class TenPersonController extends AbstractController {
|
||||||
TenPersonEntity tenPersonEntity = tenPersonService.findByName(tenPerson.getName(),
|
TenPersonEntity tenPersonEntity = tenPersonService.findByName(tenPerson.getName(),
|
||||||
tenPerson.getRoomId(),tenPerson.getCellId());
|
tenPerson.getRoomId(),tenPerson.getCellId());
|
||||||
if(tenPersonEntity!=null){
|
if(tenPersonEntity!=null){
|
||||||
return R.error("姓名在此房间已存在");
|
return R.error("当前学生已存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -398,11 +425,15 @@ public class TenPersonController extends AbstractController {
|
||||||
tenPerson.setCreateBy(getUser().getUsername());
|
tenPerson.setCreateBy(getUser().getUsername());
|
||||||
tenPerson.setCreateTime(new Date());
|
tenPerson.setCreateTime(new Date());
|
||||||
tenPerson.setRegisterType(Constant.RESGISTER_TYPE_WEB);
|
tenPerson.setRegisterType(Constant.RESGISTER_TYPE_WEB);
|
||||||
tenPerson.setStatus(Constant.PESON_SUATUS_NOMOR);
|
|
||||||
int res = tenPersonService.save(tenPerson);
|
int res;
|
||||||
|
|
||||||
|
tenPerson.setStatus(0);
|
||||||
|
res = tenPersonService.save(tenPerson);
|
||||||
if (res==2) {
|
if (res==2) {
|
||||||
return R.error("照片未检测到人脸");
|
return R.error("照片未检测到人脸");
|
||||||
}
|
}
|
||||||
|
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -412,7 +443,8 @@ public class TenPersonController extends AbstractController {
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
@RequiresPermissions("ten:person")
|
@RequiresPermissions("ten:person")
|
||||||
@ApiOperation(value = "修改人员信息")
|
@ApiOperation(value = "修改人员信息")
|
||||||
public R update(@RequestBody TenPersonEntity tenPerson) {
|
@Transactional
|
||||||
|
public R update(@RequestBody TenPersonEntity tenPerson) throws Exception {
|
||||||
tenPerson.setTenantId(getUser().getTenantId());
|
tenPerson.setTenantId(getUser().getTenantId());
|
||||||
tenPerson.setLastUpdateBy(getUser().getUsername());
|
tenPerson.setLastUpdateBy(getUser().getUsername());
|
||||||
tenPerson.setLastUpdateTime(new Date());
|
tenPerson.setLastUpdateTime(new Date());
|
||||||
|
@ -510,15 +542,16 @@ public class TenPersonController extends AbstractController {
|
||||||
// }
|
// }
|
||||||
//// tenDoorCardService.save(tenPerson);
|
//// tenDoorCardService.save(tenPerson);
|
||||||
// }
|
// }
|
||||||
|
String res = null;
|
||||||
String resStr = tenPersonService.updateById(tenPerson);
|
try {
|
||||||
if(resStr.equals("OK")){
|
res = tenPersonService.updateById(tenPerson);
|
||||||
return R.ok();
|
} catch (Exception e) {
|
||||||
}else{
|
log.error(e.getMessage());
|
||||||
return R.error(resStr);
|
|
||||||
}
|
}
|
||||||
|
if(res!=null){
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error("修改失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -844,7 +877,7 @@ public class TenPersonController extends AbstractController {
|
||||||
@RequestPart(value = "right_ir0",required = false) MultipartFile right_ir0,
|
@RequestPart(value = "right_ir0",required = false) MultipartFile right_ir0,
|
||||||
@RequestPart(value = "right_ir0",required = false) MultipartFile right_ir1,
|
@RequestPart(value = "right_ir0",required = false) MultipartFile right_ir1,
|
||||||
@RequestPart(value = "right_ir0",required = false) MultipartFile right_ir2
|
@RequestPart(value = "right_ir0",required = false) MultipartFile right_ir2
|
||||||
) {
|
) throws Exception {
|
||||||
tenPerson.setTenantId(getUser().getTenantId());
|
tenPerson.setTenantId(getUser().getTenantId());
|
||||||
tenPerson.setLastUpdateBy(getUser().getUsername());
|
tenPerson.setLastUpdateBy(getUser().getUsername());
|
||||||
tenPerson.setLastUpdateTime(new Date());
|
tenPerson.setLastUpdateTime(new Date());
|
||||||
|
@ -1053,7 +1086,12 @@ public class TenPersonController extends AbstractController {
|
||||||
|
|
||||||
//----------------------------------掌静脉特征压缩包封装--------------------------------------
|
//----------------------------------掌静脉特征压缩包封装--------------------------------------
|
||||||
|
|
||||||
String resStr = tenPersonService.updateById(tenPerson);
|
String resStr = null;
|
||||||
|
try {
|
||||||
|
tenPersonService.updateById(tenPerson);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage());
|
||||||
|
}
|
||||||
if(resStr.equals("OK")){
|
if(resStr.equals("OK")){
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}else{
|
}else{
|
||||||
|
@ -1075,7 +1113,7 @@ public class TenPersonController extends AbstractController {
|
||||||
@RequestPart(value = "right_ir0",required = false) MultipartFile right_ir0,
|
@RequestPart(value = "right_ir0",required = false) MultipartFile right_ir0,
|
||||||
@RequestPart(value = "right_ir0",required = false) MultipartFile right_ir1,
|
@RequestPart(value = "right_ir0",required = false) MultipartFile right_ir1,
|
||||||
@RequestPart(value = "right_ir0",required = false) MultipartFile right_ir2
|
@RequestPart(value = "right_ir0",required = false) MultipartFile right_ir2
|
||||||
) {
|
) throws Exception {
|
||||||
// TenPersonEntity room = tenPersonService.queryByNumberAndLayer(tenRoom.getRoomNumber(),
|
// TenPersonEntity room = tenPersonService.queryByNumberAndLayer(tenRoom.getRoomNumber(),
|
||||||
// tenRoom.getLayer(),
|
// tenRoom.getLayer(),
|
||||||
// tenRoom.getBuildId(),
|
// tenRoom.getBuildId(),
|
||||||
|
@ -1265,7 +1303,9 @@ public class TenPersonController extends AbstractController {
|
||||||
//----------------------------------掌静脉特征压缩包封装--------------------------------------
|
//----------------------------------掌静脉特征压缩包封装--------------------------------------
|
||||||
|
|
||||||
|
|
||||||
int res = tenPersonService.save(tenPerson);
|
int res;
|
||||||
|
|
||||||
|
res = tenPersonService.save(tenPerson);
|
||||||
if (res==2) {
|
if (res==2) {
|
||||||
return R.error("照片未检测到人脸");
|
return R.error("照片未检测到人脸");
|
||||||
}
|
}
|
||||||
|
@ -1315,4 +1355,20 @@ public class TenPersonController extends AbstractController {
|
||||||
}
|
}
|
||||||
return R.error();
|
return R.error();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/children")
|
||||||
|
public R listByParent(@RequestParam Map<String,Object> params) {
|
||||||
|
AppUserScopeEntity userScopeEntity = appUserScopeService.getOne(new LambdaQueryWrapper<AppUserScopeEntity>()
|
||||||
|
.eq(AppUserScopeEntity::getUserId, params.get("userId")));
|
||||||
|
List<TenRelation> relationList = relationService.list(new LambdaQueryWrapper<TenRelation>()
|
||||||
|
.eq(TenRelation::getParentId,userScopeEntity.getUserId()));
|
||||||
|
if(!relationList.isEmpty()) {
|
||||||
|
List<Long> list = relationList.stream().map(TenRelation::getStudentId).collect(Collectors.toList());
|
||||||
|
params.put("cellId",userScopeEntity.getCellId());
|
||||||
|
params.put("personIds",list);
|
||||||
|
PageUtils page = tenPersonService.selectBypersonIds(params);
|
||||||
|
return R.ok().put("data",page);
|
||||||
|
}
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,86 @@
|
||||||
|
package net.shapelight.modules.ten.controller;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import net.shapelight.common.config.GlobalValue;
|
||||||
|
import net.shapelight.common.utils.Constant;
|
||||||
|
import net.shapelight.common.utils.R;
|
||||||
|
import net.shapelight.modules.app.entity.AppUserEntity;
|
||||||
|
import net.shapelight.modules.app.service.impl.AppUserServiceImpl;
|
||||||
|
import net.shapelight.modules.job.entity.KeysEntity;
|
||||||
|
import net.shapelight.modules.sys.controller.AbstractController;
|
||||||
|
import net.shapelight.modules.sys.entity.SysUserEntity;
|
||||||
|
import net.shapelight.modules.sys.service.SysUserRoleService;
|
||||||
|
import net.shapelight.modules.ten.entity.TenRelation;
|
||||||
|
import net.shapelight.modules.ten.entity.TenUserScopeEntity;
|
||||||
|
import net.shapelight.modules.ten.service.TenParentService;
|
||||||
|
import net.shapelight.modules.ten.service.TenRelationService;
|
||||||
|
import net.shapelight.modules.ten.service.TenUserScopeService;
|
||||||
|
import net.shapelight.modules.tripartitePlatform.operatorPlatform.OpFeignClient;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("ten/relation")
|
||||||
|
public class TenRelationController extends AbstractController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
TenRelationService relationService;
|
||||||
|
@Autowired
|
||||||
|
SysUserRoleService sysUserRoleService;
|
||||||
|
@Autowired
|
||||||
|
TenUserScopeService tenUserScopeService;
|
||||||
|
@Autowired
|
||||||
|
private GlobalValue globalValue;
|
||||||
|
@Autowired
|
||||||
|
private TenParentService parentService;
|
||||||
|
@Autowired
|
||||||
|
private AppUserServiceImpl appUserService;
|
||||||
|
@Qualifier("net.shapelight.modules.tripartitePlatform.operatorPlatform.OpFeignClient")
|
||||||
|
@Autowired
|
||||||
|
private OpFeignClient opFeignClient;
|
||||||
|
|
||||||
|
@GetMapping("/list")
|
||||||
|
public R list(@RequestParam Map<String,Object> params) {
|
||||||
|
SysUserEntity user = getUser();
|
||||||
|
List<Long> roleIdList = sysUserRoleService.queryRoleIdList(user.getUserId());
|
||||||
|
//小区管理员
|
||||||
|
if (roleIdList.get(0).longValue() == Constant.ROLE_TEN_CELL) {
|
||||||
|
TenUserScopeEntity scope = tenUserScopeService.getOne(new QueryWrapper<TenUserScopeEntity>().eq("user_id", user.getUserId()));
|
||||||
|
params.put("cellId", scope.getCellId().toString());
|
||||||
|
}
|
||||||
|
return R.ok().put("data",relationService.getAll(params));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/status")
|
||||||
|
public R upStatus(@RequestBody List<Map<String,Object>> params) {
|
||||||
|
params.forEach(item -> {
|
||||||
|
TenRelation tenRelation = relationService.getById(item.get("id").toString());
|
||||||
|
tenRelation.setStatus(Integer.parseInt(item.get("status").toString()));
|
||||||
|
tenRelation.setApprovalTime(new Date());
|
||||||
|
tenRelation.setApproval(getUser().getRealName());
|
||||||
|
AppUserEntity appUser = appUserService.getById(tenRelation.getParentId());
|
||||||
|
Map<String,Object> opParams = new HashMap<>();
|
||||||
|
opParams.put("operation","editUserContactData");
|
||||||
|
opParams.put("accountNumber",globalValue.accountNumber);
|
||||||
|
opParams.put("passKey", KeysEntity.passKey);
|
||||||
|
opParams.put("empowerText",KeysEntity.empowerText);
|
||||||
|
List<Map<String,Object>> dataInfo = new ArrayList<>();
|
||||||
|
Map<String,Object> info = new HashMap<>();
|
||||||
|
info.put("objectUuid",tenRelation.getParentId().toString());
|
||||||
|
info.put("userUuid",tenRelation.getStudentId().toString());
|
||||||
|
info.put("salutation",tenRelation.getRelation());
|
||||||
|
info.put("phoneNumber",appUser.getMobile());
|
||||||
|
info.put("orderNumber",1);
|
||||||
|
dataInfo.add(info);
|
||||||
|
opParams.put("dataInfo",dataInfo);
|
||||||
|
JSONObject jsonObject = opFeignClient.submitData(opParams);
|
||||||
|
relationService.updateById(tenRelation);
|
||||||
|
});
|
||||||
|
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
}
|
|
@ -2,21 +2,28 @@ package net.shapelight.modules.ten.controller;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import net.shapelight.common.config.GlobalValue;
|
||||||
import net.shapelight.common.utils.*;
|
import net.shapelight.common.utils.*;
|
||||||
|
import net.shapelight.modules.job.entity.KeysEntity;
|
||||||
import net.shapelight.modules.nettyapi.service.ServerApiService;
|
import net.shapelight.modules.nettyapi.service.ServerApiService;
|
||||||
import net.shapelight.modules.sys.controller.AbstractController;
|
import net.shapelight.modules.sys.controller.AbstractController;
|
||||||
import net.shapelight.modules.sys.entity.SysUserEntity;
|
import net.shapelight.modules.sys.entity.SysUserEntity;
|
||||||
import net.shapelight.modules.sys.service.SysUserRoleService;
|
import net.shapelight.modules.sys.service.SysUserRoleService;
|
||||||
import net.shapelight.modules.ten.entity.*;
|
import net.shapelight.modules.ten.entity.*;
|
||||||
import net.shapelight.modules.ten.service.*;
|
import net.shapelight.modules.ten.service.*;
|
||||||
|
import net.shapelight.modules.tripartitePlatform.operatorPlatform.OpFeignClient;
|
||||||
import net.shapelight.modules.vo.TenPersonOperationVo;
|
import net.shapelight.modules.vo.TenPersonOperationVo;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
|
||||||
|
@ -46,6 +53,11 @@ public class TenRoomController extends AbstractController {
|
||||||
private TenPersonSyncService tenPersonSyncService;
|
private TenPersonSyncService tenPersonSyncService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ServerApiService serverApiService;
|
private ServerApiService serverApiService;
|
||||||
|
@Qualifier("net.shapelight.modules.tripartitePlatform.operatorPlatform.OpFeignClient")
|
||||||
|
@Autowired
|
||||||
|
private OpFeignClient opFeignClient;
|
||||||
|
@Autowired
|
||||||
|
private GlobalValue globalValue;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 列表
|
* 列表
|
||||||
|
@ -98,34 +110,54 @@ public class TenRoomController extends AbstractController {
|
||||||
/**
|
/**
|
||||||
* 下拉框选择
|
* 下拉框选择
|
||||||
*/
|
*/
|
||||||
@GetMapping("/select/{cellId}/{buildId}/{layer}")
|
@GetMapping("/select/{cellId}/{buildId}")
|
||||||
@ApiOperation(value = "下拉选择房间名称,通过单元楼层",response = TenBuildEntity.class)
|
@ApiOperation(value = "下拉选择房间名称,通过单元楼层",response = TenBuildEntity.class)
|
||||||
public R select(@PathVariable("cellId") Long cellId,
|
public R select(@PathVariable("cellId") Long cellId,
|
||||||
@PathVariable("buildId") Long buildId,
|
@PathVariable("buildId") Long buildId){
|
||||||
@PathVariable("layer") Integer layer){
|
List<TenRoomEntity> buildList = tenRoomService.getLayerRooms(buildId,cellId);
|
||||||
List<TenRoomEntity> buildList = tenRoomService.getLayerRooms(layer,buildId,cellId);
|
|
||||||
return R.ok().put("data", buildList);
|
return R.ok().put("data", buildList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存
|
||||||
|
*/
|
||||||
/**
|
/**
|
||||||
* 保存
|
* 保存
|
||||||
*/
|
*/
|
||||||
@PostMapping("/save")
|
@PostMapping("/save")
|
||||||
@RequiresPermissions("ten:room")
|
@RequiresPermissions("ten:room")
|
||||||
@ApiOperation(value = "保存小区信息")
|
@ApiOperation(value = "保存小区信息")
|
||||||
|
@Transactional
|
||||||
public R save(@RequestBody TenRoomEntity tenRoom){
|
public R save(@RequestBody TenRoomEntity tenRoom){
|
||||||
TenRoomEntity room = tenRoomService.queryByNumberAndLayer(tenRoom.getRoomNumber(),
|
TenRoomEntity room = tenRoomService.queryByNumberAndLayer(tenRoom.getRoomNumber(),
|
||||||
tenRoom.getLayer(),
|
tenRoom.getLayer(),
|
||||||
tenRoom.getBuildId(),
|
tenRoom.getBuildId(),
|
||||||
tenRoom.getCellId());
|
tenRoom.getCellId());
|
||||||
if(room!=null){
|
if(room!=null){
|
||||||
return R.error("此户室已经存在");
|
return R.error("此班级已经存在");
|
||||||
}
|
}
|
||||||
long id = new SnowflakeIdWorker().nextId();
|
long id = new SnowflakeIdWorker().nextId();
|
||||||
tenRoom.setRoomId(id);
|
tenRoom.setRoomId(id);
|
||||||
tenRoom.setTenantId(getUser().getTenantId());
|
tenRoom.setTenantId(getUser().getTenantId());
|
||||||
tenRoom.setCreateBy(getUser().getUsername());
|
tenRoom.setCreateBy(getUser().getUsername());
|
||||||
tenRoom.setCreateTime(new Date());
|
tenRoom.setCreateTime(new Date());
|
||||||
|
Map<String,Object> params = new HashMap<>();
|
||||||
|
params.put("operation","editClassData");
|
||||||
|
params.put("accountNumber", globalValue.accountNumber);
|
||||||
|
params.put("passKey", KeysEntity.passKey);
|
||||||
|
params.put("empowerText",KeysEntity.empowerText);
|
||||||
|
Map<String, Object> dataInfo = new HashMap<>();
|
||||||
|
dataInfo.put("objectUuid",String.valueOf(tenRoom.getRoomId()));
|
||||||
|
dataInfo.put("classCode",tenRoom.getRoomNumber());
|
||||||
|
dataInfo.put("className",tenRoom.getRoomName());
|
||||||
|
dataInfo.put("gradeCode",tenRoom.getBuildNumber());
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add(dataInfo);
|
||||||
|
params.put("dataInfo",jsonArray);
|
||||||
|
JSONObject jsonObject = opFeignClient.submitData(params);
|
||||||
|
if(!jsonObject.getString("shrgStatus").equals("S")) {
|
||||||
|
return R.error(jsonObject.getString("shrgMsg"));
|
||||||
|
}
|
||||||
tenRoomService.save(tenRoom);
|
tenRoomService.save(tenRoom);
|
||||||
|
|
||||||
return R.ok();
|
return R.ok();
|
||||||
|
@ -137,10 +169,31 @@ public class TenRoomController extends AbstractController {
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
@RequiresPermissions("ten:room")
|
@RequiresPermissions("ten:room")
|
||||||
@ApiOperation(value = "修改小区信息")
|
@ApiOperation(value = "修改小区信息")
|
||||||
|
@Transactional
|
||||||
public R update(@RequestBody TenRoomEntity tenRoom0){
|
public R update(@RequestBody TenRoomEntity tenRoom0){
|
||||||
tenRoom0.setTenantId(getUser().getTenantId());
|
tenRoom0.setTenantId(getUser().getTenantId());
|
||||||
tenRoom0.setLastUpdateBy(getUser().getUsername());
|
tenRoom0.setLastUpdateBy(getUser().getUsername());
|
||||||
tenRoom0.setLastUpdateTime(new Date());
|
tenRoom0.setLastUpdateTime(new Date());
|
||||||
|
Map<String,Object> params = new HashMap<>();
|
||||||
|
params.put("operation","editClassData");
|
||||||
|
params.put("accountNumber",globalValue.accountNumber);
|
||||||
|
params.put("passKey", KeysEntity.passKey);
|
||||||
|
params.put("empowerText",KeysEntity.empowerText);
|
||||||
|
Map<String, Object> dataInfo = new HashMap<>();
|
||||||
|
dataInfo.put("objectUuid",String.valueOf(tenRoom0.getRoomId()));
|
||||||
|
dataInfo.put("classCode",tenRoom0.getRoomNumber());
|
||||||
|
dataInfo.put("className",tenRoom0.getRoomName());
|
||||||
|
dataInfo.put("gradeCode",tenRoom0.getBuildNumber());
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add(dataInfo);
|
||||||
|
params.put("dataInfo",jsonArray);
|
||||||
|
JSONObject jsonObject = opFeignClient.submitData(params);
|
||||||
|
if(!jsonObject.getString("shrgStatus").equals("S")) {
|
||||||
|
return R.error("同步联系人失败");
|
||||||
|
}
|
||||||
|
if(!jsonObject.getJSONArray("errInfo").isEmpty()) {
|
||||||
|
return R.error("同步联系人失败");
|
||||||
|
}
|
||||||
tenRoomService.updateById(tenRoom0);
|
tenRoomService.updateById(tenRoom0);
|
||||||
|
|
||||||
return R.ok();
|
return R.ok();
|
||||||
|
@ -310,15 +363,35 @@ public class TenRoomController extends AbstractController {
|
||||||
@ApiImplicitParam(name="roomId",value = "户室ID",paramType = "query",dataType = "String",required = true),
|
@ApiImplicitParam(name="roomId",value = "户室ID",paramType = "query",dataType = "String",required = true),
|
||||||
@ApiImplicitParam(name="cellId",value = "小区",paramType = "query",dataType = "String",required = true)
|
@ApiImplicitParam(name="cellId",value = "小区",paramType = "query",dataType = "String",required = true)
|
||||||
})
|
})
|
||||||
|
@Transactional
|
||||||
public R delete(@RequestBody List<Map<String, String>> params){
|
public R delete(@RequestBody List<Map<String, String>> params){
|
||||||
//tenRoomService.removeByIds(Arrays.asList(roomIds));
|
//tenRoomService.removeByIds(Arrays.asList(roomIds));
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
|
||||||
for(Map<String,String> param: params){
|
for(Map<String,String> param: params){
|
||||||
Long roomId = Long.parseLong(param.get("roomId"));
|
Long roomId = Long.parseLong(param.get("roomId"));
|
||||||
Long cellId = Long.parseLong(param.get("cellId"));
|
Long cellId = Long.parseLong(param.get("cellId"));
|
||||||
int pCount = tenPersonService.findRoomCount(cellId,roomId);
|
int pCount = tenPersonService.findRoomCount(cellId,roomId);
|
||||||
if (pCount>0) {
|
if (pCount>0) {
|
||||||
return R.error("当前户室有"+pCount+"个住户,请先删除完住户");
|
return R.error("当前班级有"+pCount+"个学生,请先删除完学生");
|
||||||
}
|
}
|
||||||
|
TenRoomEntity tenRoom = tenRoomService.getById(roomId,cellId);
|
||||||
|
Map<String, Object> dataInfo = new HashMap<>();
|
||||||
|
dataInfo.put("objectUuid",String.valueOf(tenRoom.getRoomId()));
|
||||||
|
dataInfo.put("classCode",tenRoom.getRoomNumber());
|
||||||
|
dataInfo.put("className",tenRoom.getRoomName());
|
||||||
|
dataInfo.put("gradeCode",tenRoom.getBuildNumber());
|
||||||
|
jsonArray.add(dataInfo);
|
||||||
|
}
|
||||||
|
Map<String,Object> roomParams = new HashMap<>();
|
||||||
|
roomParams.put("operation","delClassData");
|
||||||
|
roomParams.put("accountNumber",globalValue.accountNumber);
|
||||||
|
roomParams.put("passKey", KeysEntity.passKey);
|
||||||
|
roomParams.put("empowerText",KeysEntity.empowerText);
|
||||||
|
roomParams.put("dataInfo",jsonArray);
|
||||||
|
JSONObject jsonObject = opFeignClient.submitData(roomParams);
|
||||||
|
if(!jsonObject.getString("shrgStatus").equals("S")) {
|
||||||
|
return R.error("班级添加失败");
|
||||||
}
|
}
|
||||||
tenRoomService.removeByIdList(params);
|
tenRoomService.removeByIdList(params);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
|
|
|
@ -35,4 +35,5 @@ public interface TenBuildDao {
|
||||||
|
|
||||||
TenBuildEntity queryByNumberAndUnit(@Param("number")String number,@Param("unit")String unit,@Param("cellId")Long cellId);
|
TenBuildEntity queryByNumberAndUnit(@Param("number")String number,@Param("unit")String unit,@Param("cellId")Long cellId);
|
||||||
TenBuildEntity queryByNameAndUnit(@Param("name")String name,@Param("unit")String unit,@Param("cellId")Long cellId);
|
TenBuildEntity queryByNameAndUnit(@Param("name")String name,@Param("unit")String unit,@Param("cellId")Long cellId);
|
||||||
|
String getBuildNumber(@Param("buildId")Long id,@Param("cellId")Long cellId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
package net.shapelight.modules.ten.dao;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import net.shapelight.modules.ten.entity.TenParent;
|
||||||
|
import net.shapelight.modules.vo.ParentVo;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhangbo
|
||||||
|
* @description 针对表【ten_parent】的数据库操作Mapper
|
||||||
|
* @createDate 2024-10-23 19:53:30
|
||||||
|
* @Entity net.shapelight.modules.ten.entity.TenParent
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface TenParentMapper extends BaseMapper<TenParent> {
|
||||||
|
IPage<ParentVo> getParentVoList(Page page,Map<String, Object> params);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -118,5 +118,12 @@ public interface TenPersonDao {
|
||||||
|
|
||||||
List<TenPersonEntity> findByIdCardAndDept(@Param("idCard")String idCard, @Param("deptId")Long deptId);
|
List<TenPersonEntity> findByIdCardAndDept(@Param("idCard")String idCard, @Param("deptId")Long deptId);
|
||||||
|
|
||||||
|
IPage<TenPersonEntity> selectByCreateBy(Page page,@Param("createBy")String createBy, @Param("cellId")Long cellId, @Param("key")String key, @Param("status") String status);
|
||||||
|
|
||||||
|
TenPersonEntity findByRyId(@Param("ryId")String ryId, @Param("cellId")Long cellId,@Param("idCard") String idCard);
|
||||||
|
|
||||||
|
IPage<TenPersonEntity> getByPersonIds(Page page,@Param("personIds")List<Long> personIds, @Param("cellId")Long cellId);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,4 +46,6 @@ public interface TenRecordDao {
|
||||||
List<TenRecordEntity> getMonthRecords(@Param("start") String start, @Param("end") String end, @Param("tenantId") String tenantId);
|
List<TenRecordEntity> getMonthRecords(@Param("start") String start, @Param("end") String end, @Param("tenantId") String tenantId);
|
||||||
|
|
||||||
IPage<TenRecordEntity> findPageDeptRecord(Page page, @Param("params") Map params);
|
IPage<TenRecordEntity> findPageDeptRecord(Page page, @Param("params") Map params);
|
||||||
|
|
||||||
|
IPage<TenRecordEntity> getByPersonIds(Page page,@Param("params")Map<String,Object> params);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
package net.shapelight.modules.ten.dao;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import net.shapelight.modules.ten.entity.TenRelation;
|
||||||
|
import net.shapelight.modules.vo.ParentAndStudentVo;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhangbo
|
||||||
|
* @description 针对表【ten_relation】的数据库操作Mapper
|
||||||
|
* @createDate 2024-10-23 19:09:03
|
||||||
|
* @Entity net.shapelight.modules.ten.entity.TenRelation
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface TenRelationMapper extends BaseMapper<TenRelation> {
|
||||||
|
|
||||||
|
String getCount(@Param("parentId") Long parentId);
|
||||||
|
|
||||||
|
IPage<ParentAndStudentVo> getAll(Page page, @Param("params") Map<String,Object> params);
|
||||||
|
|
||||||
|
}
|
|
@ -33,10 +33,10 @@ public interface TenRoomDao {
|
||||||
@Param("buildId")Long buildId,
|
@Param("buildId")Long buildId,
|
||||||
@Param("cellId")Long cellId);
|
@Param("cellId")Long cellId);
|
||||||
|
|
||||||
List<TenRoomEntity> getLayerRooms(@Param("layer")Integer layer,
|
List<TenRoomEntity> getLayerRooms(@Param("buildId")Long buildId,
|
||||||
@Param("buildId")Long buildId,
|
|
||||||
@Param("cellId")Long cellId);
|
@Param("cellId")Long cellId);
|
||||||
|
|
||||||
|
|
||||||
List<TenRoomEntity> getBuildRooms(@Param("buildId")Long buildId);
|
List<TenRoomEntity> getBuildRooms(@Param("buildId")Long buildId);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,43 @@
|
||||||
|
package net.shapelight.modules.ten.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @TableName ten_parent
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("ten_parent")
|
||||||
|
public class TenParent implements Serializable {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 姓名
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 性别
|
||||||
|
*/
|
||||||
|
private Integer gender;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 身份证号
|
||||||
|
*/
|
||||||
|
private String idCard;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备份字段
|
||||||
|
*/
|
||||||
|
private Integer registerType;
|
||||||
|
|
||||||
|
private Long userId;
|
||||||
|
}
|
|
@ -0,0 +1,50 @@
|
||||||
|
package net.shapelight.modules.ten.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @TableName ten_relation
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("ten_relation")
|
||||||
|
public class TenRelation implements Serializable {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private Long parentId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private Long studentId;
|
||||||
|
|
||||||
|
/*
|
||||||
|
关系
|
||||||
|
*/
|
||||||
|
private String relation;
|
||||||
|
|
||||||
|
/*
|
||||||
|
审核状态
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
private String detail;
|
||||||
|
|
||||||
|
private Date approvalTime;
|
||||||
|
|
||||||
|
private String approval;
|
||||||
|
}
|
|
@ -145,4 +145,8 @@ public class TenRoomEntity extends BaseEntity implements Serializable {
|
||||||
@ApiModelProperty("标准地址")
|
@ApiModelProperty("标准地址")
|
||||||
private String address;
|
private String address;
|
||||||
|
|
||||||
|
@TableField(exist=false)
|
||||||
|
@ApiModelProperty("年级编号")
|
||||||
|
private String buildNumber;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
package net.shapelight.modules.ten.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import net.shapelight.common.utils.PageUtils;
|
||||||
|
import net.shapelight.modules.ten.entity.TenParent;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhangbo
|
||||||
|
* @description 针对表【ten_parent】的数据库操作Service
|
||||||
|
* @createDate 2024-10-23 19:53:30
|
||||||
|
*/
|
||||||
|
public interface TenParentService extends IService<TenParent> {
|
||||||
|
|
||||||
|
PageUtils getParentList(Map<String,Object> params);
|
||||||
|
|
||||||
|
}
|
|
@ -38,7 +38,7 @@ public interface TenPersonService {
|
||||||
|
|
||||||
boolean reviewByIdList(List<Map<String,String>> roomIdList);
|
boolean reviewByIdList(List<Map<String,String>> roomIdList);
|
||||||
|
|
||||||
String updateById(TenPersonEntity entity);
|
String updateById(TenPersonEntity entity) throws Exception;
|
||||||
boolean updateStatusById(TenPersonEntity entity);
|
boolean updateStatusById(TenPersonEntity entity);
|
||||||
void updateStatusByIds(List<TenPersonEntity> entitys);
|
void updateStatusByIds(List<TenPersonEntity> entitys);
|
||||||
boolean updateLabelById(TenPersonEntity entity);
|
boolean updateLabelById(TenPersonEntity entity);
|
||||||
|
@ -148,5 +148,11 @@ public interface TenPersonService {
|
||||||
List<TenPersonEntity> findByIdCardAndDept(String idCard,
|
List<TenPersonEntity> findByIdCardAndDept(String idCard,
|
||||||
Long deptId);
|
Long deptId);
|
||||||
|
|
||||||
|
PageUtils selectBypersonIds(Map<String, Object> params);
|
||||||
|
|
||||||
|
PageUtils selectByCreateByQueryPage(Map<String, Object> params);
|
||||||
|
|
||||||
|
TenPersonEntity getByRyId(String ryId,Long cellId,String idCard);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,5 +44,8 @@ public interface TenRecordService {
|
||||||
|
|
||||||
PageUtils queryPageDeptRecord(Map<String, Object> params);
|
PageUtils queryPageDeptRecord(Map<String, Object> params);
|
||||||
|
|
||||||
|
PageUtils getByPersonIds(Map<String,Object> params);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
package net.shapelight.modules.ten.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import net.shapelight.common.utils.PageUtils;
|
||||||
|
import net.shapelight.modules.ten.entity.TenRelation;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhangbo
|
||||||
|
* @description 针对表【ten_relation】的数据库操作Service
|
||||||
|
* @createDate 2024-10-23 19:09:03
|
||||||
|
*/
|
||||||
|
public interface TenRelationService extends IService<TenRelation> {
|
||||||
|
|
||||||
|
public PageUtils getAll(Map<String,Object> params);
|
||||||
|
|
||||||
|
}
|
|
@ -33,10 +33,6 @@ public interface TenRoomService {
|
||||||
Long buildId,
|
Long buildId,
|
||||||
Long cellId);
|
Long cellId);
|
||||||
|
|
||||||
List<TenRoomEntity> getLayerRooms(Integer layer,
|
|
||||||
Long buildId,
|
|
||||||
Long cellId);
|
|
||||||
|
|
||||||
List<TenRoomEntity> getBuildRooms(Long buildId);
|
List<TenRoomEntity> getBuildRooms(Long buildId);
|
||||||
|
|
||||||
|
|
||||||
|
@ -52,5 +48,8 @@ public interface TenRoomService {
|
||||||
List<TenRoomEntity> getNotSync(Long paramLong);
|
List<TenRoomEntity> getNotSync(Long paramLong);
|
||||||
|
|
||||||
int syncAddress(Long cellId,Integer layerFlag);
|
int syncAddress(Long cellId,Integer layerFlag);
|
||||||
|
|
||||||
|
List<TenRoomEntity> getLayerRooms(Long buildId,
|
||||||
|
Long cellId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ package net.shapelight.modules.ten.service.impl;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import net.shapelight.common.utils.Constant;
|
import net.shapelight.common.utils.Constant;
|
||||||
import net.shapelight.common.utils.SnowflakeIdWorker;
|
import net.shapelight.common.utils.SnowflakeIdWorker;
|
||||||
|
import net.shapelight.modules.sys.service.impl.SysDictServiceImpl;
|
||||||
import net.shapelight.modules.ten.entity.TenCellEntity;
|
import net.shapelight.modules.ten.entity.TenCellEntity;
|
||||||
import net.shapelight.modules.ten.entity.TenRoomEntity;
|
import net.shapelight.modules.ten.entity.TenRoomEntity;
|
||||||
import net.shapelight.modules.ten.service.TenCellService;
|
import net.shapelight.modules.ten.service.TenCellService;
|
||||||
|
@ -39,6 +40,8 @@ public class TenBuildServiceImpl implements TenBuildService {
|
||||||
private TenCellService tenCellService;
|
private TenCellService tenCellService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private TenPersonService tenPersonService;
|
private TenPersonService tenPersonService;
|
||||||
|
@Autowired
|
||||||
|
private SysDictServiceImpl sysDictService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageUtils queryPage(Map<String, Object> params) {
|
public PageUtils queryPage(Map<String, Object> params) {
|
||||||
|
@ -106,7 +109,7 @@ public class TenBuildServiceImpl implements TenBuildService {
|
||||||
public int save(TenBuildEntity build) {
|
public int save(TenBuildEntity build) {
|
||||||
//List<TenRoomEntity> roomList =new ArrayList<>();
|
//List<TenRoomEntity> roomList =new ArrayList<>();
|
||||||
//生成房间
|
//生成房间
|
||||||
for(int layer = 1;layer<build.getLayerCount()+1;layer++){
|
/*for(int layer = 1;layer<build.getLayerCount()+1;layer++){
|
||||||
for(int rno = 1;rno < build.getRoomEach()+1;rno++){
|
for(int rno = 1;rno < build.getRoomEach()+1;rno++){
|
||||||
TenRoomEntity room = new TenRoomEntity();
|
TenRoomEntity room = new TenRoomEntity();
|
||||||
long id = new SnowflakeIdWorker().nextId();
|
long id = new SnowflakeIdWorker().nextId();
|
||||||
|
@ -123,7 +126,7 @@ public class TenBuildServiceImpl implements TenBuildService {
|
||||||
//roomList.add(room);
|
//roomList.add(room);
|
||||||
tenRoomService.save(room);
|
tenRoomService.save(room);
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
int flag = tenBuildDao.insert(build);
|
int flag = tenBuildDao.insert(build);
|
||||||
if(flag==1){
|
if(flag==1){
|
||||||
return 0; //成功
|
return 0; //成功
|
||||||
|
|
|
@ -0,0 +1,50 @@
|
||||||
|
package net.shapelight.modules.ten.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import net.shapelight.common.utils.PageUtils;
|
||||||
|
import net.shapelight.modules.ten.dao.TenParentMapper;
|
||||||
|
import net.shapelight.modules.ten.entity.TenParent;
|
||||||
|
import net.shapelight.modules.ten.entity.TenRelation;
|
||||||
|
import net.shapelight.modules.ten.service.TenParentService;
|
||||||
|
import net.shapelight.modules.ten.service.TenRelationService;
|
||||||
|
import net.shapelight.modules.vo.ParentVo;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhangbo
|
||||||
|
* @description 针对表【ten_parent】的数据库操作Service实现
|
||||||
|
* @createDate 2024-10-23 19:53:30
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class TenParentServiceImpl extends ServiceImpl<TenParentMapper, TenParent>
|
||||||
|
implements TenParentService{
|
||||||
|
@Autowired
|
||||||
|
TenParentMapper parentMapper;
|
||||||
|
@Autowired
|
||||||
|
TenRelationService relationService;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageUtils getParentList(Map<String, Object> params) {
|
||||||
|
Page pageParam = new Page();
|
||||||
|
pageParam.setCurrent(Long.parseLong((String) params.get("page")));
|
||||||
|
pageParam.setSize(Long.parseLong((String) params.get("limit")));
|
||||||
|
IPage<ParentVo> page = parentMapper.getParentVoList(pageParam,params);
|
||||||
|
page.getRecords().forEach(item -> {
|
||||||
|
int count = relationService.count(new LambdaQueryWrapper<TenRelation>()
|
||||||
|
.eq(TenRelation::getParentId,item.getUserId()));
|
||||||
|
item.setCount(count);
|
||||||
|
});
|
||||||
|
return new PageUtils(page);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,8 @@ package net.shapelight.modules.ten.service.impl;
|
||||||
|
|
||||||
import com.alibaba.excel.EasyExcelFactory;
|
import com.alibaba.excel.EasyExcelFactory;
|
||||||
import com.alibaba.excel.metadata.Sheet;
|
import com.alibaba.excel.metadata.Sheet;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import io.minio.MinioClient;
|
import io.minio.MinioClient;
|
||||||
import io.minio.PutObjectOptions;
|
import io.minio.PutObjectOptions;
|
||||||
|
@ -16,11 +18,16 @@ import net.shapelight.modules.app.entity.AppUserScopeEntity;
|
||||||
import net.shapelight.modules.app.service.AppUserScopeService;
|
import net.shapelight.modules.app.service.AppUserScopeService;
|
||||||
import net.shapelight.modules.app.service.AppUserService;
|
import net.shapelight.modules.app.service.AppUserService;
|
||||||
//import net.shapelight.modules.dev.mqtt.CmdProcess;
|
//import net.shapelight.modules.dev.mqtt.CmdProcess;
|
||||||
|
import net.shapelight.modules.app.service.impl.AppUserScopeServiceImpl;
|
||||||
import net.shapelight.modules.excel.listener.PersonExcelListener;
|
import net.shapelight.modules.excel.listener.PersonExcelListener;
|
||||||
import net.shapelight.modules.excel.model.PersonModel;
|
import net.shapelight.modules.excel.model.PersonModel;
|
||||||
|
import net.shapelight.modules.job.entity.KeysEntity;
|
||||||
import net.shapelight.modules.nettyapi.service.ServerApiService;
|
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.entity.*;
|
import net.shapelight.modules.ten.entity.*;
|
||||||
import net.shapelight.modules.ten.service.*;
|
import net.shapelight.modules.ten.service.*;
|
||||||
|
import net.shapelight.modules.tripartitePlatform.operatorPlatform.OpFeignClient;
|
||||||
import net.shapelight.modules.vo.*;
|
import net.shapelight.modules.vo.*;
|
||||||
import org.apache.commons.codec.digest.DigestUtils;
|
import org.apache.commons.codec.digest.DigestUtils;
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
|
@ -29,6 +36,8 @@ import org.apache.commons.lang.RandomStringUtils;
|
||||||
import org.apache.shiro.crypto.hash.Sha256Hash;
|
import org.apache.shiro.crypto.hash.Sha256Hash;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.cache.annotation.CacheEvict;
|
import org.springframework.cache.annotation.CacheEvict;
|
||||||
import org.springframework.cache.annotation.CachePut;
|
import org.springframework.cache.annotation.CachePut;
|
||||||
import org.springframework.cache.annotation.Cacheable;
|
import org.springframework.cache.annotation.Cacheable;
|
||||||
|
@ -86,6 +95,17 @@ public class TenPersonServiceImpl implements TenPersonService {
|
||||||
private TenPersonExtractService tenPersonExtractService;
|
private TenPersonExtractService tenPersonExtractService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private TenCellDeptService tenCellDeptService;
|
private TenCellDeptService tenCellDeptService;
|
||||||
|
@Autowired
|
||||||
|
private TenRelationService relationService;
|
||||||
|
@Qualifier("net.shapelight.modules.tripartitePlatform.operatorPlatform.OpFeignClient")
|
||||||
|
@Autowired
|
||||||
|
private OpFeignClient opFeignClient;
|
||||||
|
@Autowired
|
||||||
|
private SysDictServiceImpl sysDictService;
|
||||||
|
@Value("${global.minio.endpoint}")
|
||||||
|
private String imagBaseUrl;
|
||||||
|
@Value("${global.minio.bucketName}")
|
||||||
|
private String bucketName;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -272,7 +292,7 @@ public class TenPersonServiceImpl implements TenPersonService {
|
||||||
String tempFaceFilePath = tempPath + tempFaceFileName;
|
String tempFaceFilePath = tempPath + tempFaceFileName;
|
||||||
|
|
||||||
String osName = System.getProperty("os.name");//获取指定键(即os.name)的系统属性,如:Windows 7。
|
String osName = System.getProperty("os.name");//获取指定键(即os.name)的系统属性,如:Windows 7。
|
||||||
if (!Pattern.matches("Windows.*", osName)) {
|
if (Pattern.matches("Windows.*", osName)) {
|
||||||
// if (Pattern.matches("Windows.*", osName)) {
|
// if (Pattern.matches("Windows.*", osName)) {
|
||||||
int res = PicSDK.getFace(tempOrgFilePath, tempFaceFilePath);
|
int res = PicSDK.getFace(tempOrgFilePath, tempFaceFilePath);
|
||||||
if (res != 0) {
|
if (res != 0) {
|
||||||
|
@ -479,6 +499,37 @@ public class TenPersonServiceImpl implements TenPersonService {
|
||||||
serverApiService.personOperation(dev.getSn(), list);
|
serverApiService.personOperation(dev.getSn(), list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
List<SysDictEntity> dictList = sysDictService.queryByType("optype");
|
||||||
|
Map<String,Object> optypeMap = new HashMap<>();
|
||||||
|
dictList.forEach(dict -> {
|
||||||
|
optypeMap.put(dict.getValue(),dict.getCode());
|
||||||
|
});
|
||||||
|
Map<String,Object> personParams = new HashMap<>();
|
||||||
|
personParams.put("operation","editUserData");
|
||||||
|
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()));
|
||||||
|
student.put("userCode",entity.getRyid());
|
||||||
|
student.put("userName",entity.getName());
|
||||||
|
student.put("userType",optypeMap.get(entity.getLabelName()));
|
||||||
|
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("/")));
|
||||||
|
jsonArray.add(student);
|
||||||
|
personParams.put("dataInfo",jsonArray);
|
||||||
|
JSONObject jsonObject = opFeignClient.submitData(personParams);
|
||||||
|
if(!jsonObject.getString("shrgStatus").equals("S")) {
|
||||||
|
log.error(jsonObject.toJSONString());
|
||||||
|
}
|
||||||
|
if(!jsonObject.getJSONArray("errInfo").isEmpty()) {
|
||||||
|
log.error(jsonObject.toJSONString());
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -923,7 +974,7 @@ public class TenPersonServiceImpl implements TenPersonService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@CacheEvict(value = "TenPerson", key = "#entity.personId+'-'+#entity.cellId")
|
@CacheEvict(value = "TenPerson", key = "#entity.personId+'-'+#entity.cellId")
|
||||||
public String updateById(TenPersonEntity entity) {
|
public String updateById(TenPersonEntity entity) throws SyncFailedException {
|
||||||
if (entity.getUsername() != null && entity.getUsername().isEmpty()) {
|
if (entity.getUsername() != null && entity.getUsername().isEmpty()) {
|
||||||
entity.setUsername(null);
|
entity.setUsername(null);
|
||||||
}
|
}
|
||||||
|
@ -1378,6 +1429,37 @@ public class TenPersonServiceImpl implements TenPersonService {
|
||||||
// for (TenDeviceVo dev : devList) {
|
// for (TenDeviceVo dev : devList) {
|
||||||
// CmdProcess.publishPersonChange(dev.getSn());
|
// CmdProcess.publishPersonChange(dev.getSn());
|
||||||
// }
|
// }
|
||||||
|
List<SysDictEntity> dictList = sysDictService.queryByType("optype");
|
||||||
|
Map<String,Object> optypeMap = new HashMap<>();
|
||||||
|
dictList.forEach(dict -> {
|
||||||
|
optypeMap.put(dict.getValue(),dict.getCode());
|
||||||
|
});
|
||||||
|
Map<String,Object> personParams = new HashMap<>();
|
||||||
|
personParams.put("operation","editUserData");
|
||||||
|
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()));
|
||||||
|
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("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("//")));
|
||||||
|
jsonArray.add(student);
|
||||||
|
personParams.put("dataInfo",jsonArray);
|
||||||
|
JSONObject jsonObject = opFeignClient.submitData(personParams);
|
||||||
|
if(!jsonObject.getString("shrgStatus").equals("S")) {
|
||||||
|
new SyncFailedException(entity.getPersonId()+","+entity.getName()+"青桔同步失败");
|
||||||
|
}
|
||||||
|
if(jsonObject.getJSONArray("errInfo")!=null && !jsonObject.getJSONArray("errInfo").isEmpty()) {
|
||||||
|
new SyncFailedException(entity.getPersonId()+","+entity.getName()+"青桔同步失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return "OK";
|
return "OK";
|
||||||
|
@ -2416,4 +2498,33 @@ public class TenPersonServiceImpl implements TenPersonService {
|
||||||
public List<TenPersonEntity> findByIdCardAndDept(String idCard, Long deptId) {
|
public List<TenPersonEntity> findByIdCardAndDept(String idCard, Long deptId) {
|
||||||
return tenPersonDao.findByIdCardAndDept(idCard,deptId);
|
return tenPersonDao.findByIdCardAndDept(idCard,deptId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public PageUtils selectByCreateByQueryPage(Map<String, Object> params) {
|
||||||
|
String createBy = (String) params.get("createBy");
|
||||||
|
|
||||||
|
Long cellId = Long.parseLong((String) params.get("cellId"));
|
||||||
|
String key = (String) params.get("key");
|
||||||
|
Page pageParam = new Page();
|
||||||
|
pageParam.setCurrent(Long.parseLong((String) params.get("page")));
|
||||||
|
pageParam.setSize(Long.parseLong((String) params.get("limit")));
|
||||||
|
IPage<TenPersonEntity> page = tenPersonDao.selectByCreateBy(pageParam, createBy, cellId, key,params.get("status").toString());
|
||||||
|
return new PageUtils(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TenPersonEntity getByRyId(String ryId,Long cellId,String idCard) {
|
||||||
|
TenPersonEntity entity = tenPersonDao.findByRyId(ryId,cellId,idCard);
|
||||||
|
return entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PageUtils selectBypersonIds(Map<String, Object> params) {
|
||||||
|
Page pageParam = new Page();
|
||||||
|
pageParam.setCurrent(Long.parseLong((String) params.get("page")));
|
||||||
|
pageParam.setSize(Long.parseLong((String) params.get("limit")));
|
||||||
|
List<Long> list = (List<Long>) params.get("personIds");
|
||||||
|
Long cellId = Long.parseLong(params.get("cellId").toString());
|
||||||
|
IPage<TenPersonEntity> page = tenPersonDao.getByPersonIds(pageParam, list,cellId);
|
||||||
|
return new PageUtils(page);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -475,4 +475,15 @@ public class TenRecordServiceImpl implements TenRecordService {
|
||||||
}
|
}
|
||||||
return new PageUtils(page);
|
return new PageUtils(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageUtils getByPersonIds(Map<String, Object> params) {
|
||||||
|
Page pageParam = new Page();
|
||||||
|
pageParam.setCurrent(Long.parseLong((String) params.get("page")));
|
||||||
|
pageParam.setSize(Long.parseLong((String) params.get("limit")));
|
||||||
|
List<Long> list = (List<Long>) params.get("personIds");
|
||||||
|
Long cellId = Long.parseLong(params.get("cellId").toString());
|
||||||
|
IPage page = tenRecordDao.getByPersonIds(pageParam,params);
|
||||||
|
return new PageUtils(page);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
package net.shapelight.modules.ten.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import net.shapelight.common.utils.PageUtils;
|
||||||
|
import net.shapelight.modules.ten.dao.TenRelationMapper;
|
||||||
|
import net.shapelight.modules.ten.entity.TenRelation;
|
||||||
|
import net.shapelight.modules.ten.service.TenRelationService;
|
||||||
|
import net.shapelight.modules.vo.ParentAndStudentVo;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhangbo
|
||||||
|
* @description 针对表【ten_relation】的数据库操作Service实现
|
||||||
|
* @createDate 2024-10-23 19:09:03
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class TenRelationServiceImpl extends ServiceImpl<TenRelationMapper, TenRelation>
|
||||||
|
implements TenRelationService{
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
TenRelationMapper mapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageUtils getAll(Map<String,Object> params) {
|
||||||
|
Page pageParam = new Page();
|
||||||
|
pageParam.setCurrent(Long.parseLong((String) params.get("page")));
|
||||||
|
pageParam.setSize(Long.parseLong((String) params.get("limit")));
|
||||||
|
IPage<ParentAndStudentVo> page = mapper.getAll(pageParam,params);
|
||||||
|
return new PageUtils(page);
|
||||||
|
}
|
||||||
|
}
|
|
@ -5,12 +5,15 @@ import net.shapelight.modules.ten.entity.TenAddressEntity;
|
||||||
import net.shapelight.modules.ten.entity.TenBuildEntity;
|
import net.shapelight.modules.ten.entity.TenBuildEntity;
|
||||||
import net.shapelight.modules.ten.entity.TenCellEntity;
|
import net.shapelight.modules.ten.entity.TenCellEntity;
|
||||||
import net.shapelight.modules.ten.service.*;
|
import net.shapelight.modules.ten.service.*;
|
||||||
|
import net.shapelight.modules.tripartitePlatform.operatorPlatform.OpFeignClient;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.springframework.cache.annotation.CacheEvict;
|
import org.springframework.cache.annotation.CacheEvict;
|
||||||
import org.springframework.cache.annotation.Cacheable;
|
import org.springframework.cache.annotation.Cacheable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
@ -36,6 +39,8 @@ public class TenRoomServiceImpl implements TenRoomService {
|
||||||
private TenAddressService tenAddressService;
|
private TenAddressService tenAddressService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private TenBuildService tenBuildService;
|
private TenBuildService tenBuildService;
|
||||||
|
@Autowired
|
||||||
|
OpFeignClient opFeignClient;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageUtils queryPage(Map<String, Object> params) {
|
public PageUtils queryPage(Map<String, Object> params) {
|
||||||
|
@ -163,8 +168,8 @@ public class TenRoomServiceImpl implements TenRoomService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<TenRoomEntity> getLayerRooms(Integer layer, Long buildId, Long cellId) {
|
public List<TenRoomEntity> getLayerRooms(Long buildId, Long cellId) {
|
||||||
return tenRoomDao.getLayerRooms(layer, buildId, cellId);
|
return tenRoomDao.getLayerRooms(buildId, cellId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
package net.shapelight.modules.tripartitePlatform.operatorPlatform;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import net.shapelight.modules.job.entity.KeysEntity;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.annotation.PostConstruct;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 青桔数据同步
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@Slf4j
|
||||||
|
public class DataSync {
|
||||||
|
@Autowired
|
||||||
|
OpFeignClient opFeignClient;
|
||||||
|
@Value("${global.qingju.accountNumber}")
|
||||||
|
public String accountNumber;
|
||||||
|
@Value("${global.qingju.empowerKey}")
|
||||||
|
String empowerKey;
|
||||||
|
|
||||||
|
@PostConstruct
|
||||||
|
public void init(){
|
||||||
|
Map<String,Object> params = new HashMap<>();
|
||||||
|
params.put("accountNumber", accountNumber);
|
||||||
|
params.put("empowerKey", empowerKey);
|
||||||
|
JSONObject json = opFeignClient.empower(params);
|
||||||
|
if(json.getString("shrgStatus").equals("S")) {
|
||||||
|
KeysEntity.passKey = json.getString("passKey");
|
||||||
|
KeysEntity.empowerText = json.getString("empowerText");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,34 @@
|
||||||
|
package net.shapelight.modules.tripartitePlatform.operatorPlatform;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import net.shapelight.modules.tripartitePlatform.operatorPlatform.config.OpFeignConfig;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
import javax.annotation.PostConstruct;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* name 指定调用rest接口对应服务名
|
||||||
|
* path 指定调用接口所在Controller的@RequestMapping对应路径,没有则不填
|
||||||
|
* 青桔话务平台
|
||||||
|
*/
|
||||||
|
@FeignClient(name = "operator-service", url = "${global.qingju.url}",configuration = OpFeignConfig.class)
|
||||||
|
@Component
|
||||||
|
public interface OpFeignClient {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取密钥 1800s
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostConstruct
|
||||||
|
@PostMapping("/empower")
|
||||||
|
JSONObject empower(@RequestBody Map<String,Object> params);
|
||||||
|
|
||||||
|
@PostMapping("/submitData")
|
||||||
|
JSONObject submitData(@RequestBody Map<String,Object> params);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
package net.shapelight.modules.tripartitePlatform.operatorPlatform;
|
||||||
|
|
||||||
|
import feign.RequestInterceptor;
|
||||||
|
import feign.RequestTemplate;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import net.shapelight.modules.job.entity.KeysEntity;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
public class OpFeignInterceptor implements RequestInterceptor {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void apply(RequestTemplate requestTemplate) {
|
||||||
|
requestTemplate.header("passKey", KeysEntity.passKey);
|
||||||
|
requestTemplate.header("empowerText", KeysEntity.empowerText);
|
||||||
|
log.info("feign拦截器");
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,30 @@
|
||||||
|
package net.shapelight.modules.tripartitePlatform.operatorPlatform;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import feign.hystrix.FallbackFactory;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class OpHystrix implements FallbackFactory<OpFeignClient> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public OpFeignClient create(Throwable throwable) {
|
||||||
|
return new OpFeignClient() {
|
||||||
|
@Override
|
||||||
|
public JSONObject empower(Map<String, Object> params) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("errormsg","获取密钥失败");
|
||||||
|
return jsonObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONObject submitData(Map<String, Object> params) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("errormsg",params.get("operation")+"失败");
|
||||||
|
return jsonObject;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
package net.shapelight.modules.tripartitePlatform.operatorPlatform.config;
|
||||||
|
|
||||||
|
import feign.Logger;
|
||||||
|
import feign.Request;
|
||||||
|
import net.shapelight.modules.tripartitePlatform.operatorPlatform.OpFeignInterceptor;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class OpFeignConfig {
|
||||||
|
@Bean
|
||||||
|
public Logger.Level feignLogerLevel(){
|
||||||
|
return Logger.Level.FULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public Request.Options options(){
|
||||||
|
return new Request.Options(5000,10000);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 注入自定义feign拦截器
|
||||||
|
@Bean
|
||||||
|
public OpFeignInterceptor opFeignInterceptor(){
|
||||||
|
return new OpFeignInterceptor();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,41 @@
|
||||||
|
package net.shapelight.modules.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ParentAndStudentVo {
|
||||||
|
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
private String parentName;
|
||||||
|
|
||||||
|
private Integer parentGender;
|
||||||
|
|
||||||
|
private String relation;
|
||||||
|
|
||||||
|
private String parentMobile;
|
||||||
|
|
||||||
|
private String personId;
|
||||||
|
|
||||||
|
private String studentName;
|
||||||
|
|
||||||
|
private String studentNumber;
|
||||||
|
|
||||||
|
private Integer studentGender;
|
||||||
|
|
||||||
|
private String roomName;
|
||||||
|
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
private Date bindTime;
|
||||||
|
|
||||||
|
private String faceImage;
|
||||||
|
|
||||||
|
private Date approvalTime;
|
||||||
|
|
||||||
|
private String approval;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
package net.shapelight.modules.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ParentVo {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
private String gender;
|
||||||
|
|
||||||
|
private Integer count;
|
||||||
|
|
||||||
|
private String mobile;
|
||||||
|
|
||||||
|
private String idCard;
|
||||||
|
|
||||||
|
private String registerType;
|
||||||
|
|
||||||
|
private String userId;
|
||||||
|
}
|
|
@ -3,7 +3,7 @@ spring:
|
||||||
type: com.alibaba.druid.pool.DruidDataSource
|
type: com.alibaba.druid.pool.DruidDataSource
|
||||||
druid:
|
druid:
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
url: jdbc:mysql://192.168.10.20:3306/cell_db_v10_pv_jd?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useSSL=false&rewriteBatchedStatements=true
|
url: jdbc:mysql://192.168.10.20:3306/cell_db_v11?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useSSL=false&rewriteBatchedStatements=true
|
||||||
username: user
|
username: user
|
||||||
password: user@server001
|
password: user@server001
|
||||||
# url: jdbc:mysql://39.96.9.232:3306/cell_db_v8_http?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useSSL=false&rewriteBatchedStatements=true
|
# url: jdbc:mysql://39.96.9.232:3306/cell_db_v8_http?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useSSL=false&rewriteBatchedStatements=true
|
||||||
|
|
|
@ -83,19 +83,20 @@ global:
|
||||||
db_password: root
|
db_password: root
|
||||||
db_host: localhost
|
db_host: localhost
|
||||||
db_port: 3306
|
db_port: 3306
|
||||||
minio:
|
|
||||||
endpoint: http://192.168.10.20:9000
|
|
||||||
port: 9000
|
|
||||||
accessKey: admin
|
|
||||||
secretKey: admin@C501
|
|
||||||
bucketName: cell
|
|
||||||
path: /root/minio/data/cell
|
|
||||||
# minio:
|
# minio:
|
||||||
# endpoint: https://c.xitu3d.com:19000
|
# endpoint: http://192.168.10.20:9000
|
||||||
# port: 19000
|
# port: 9000
|
||||||
# accessKey: 7885444af42e4b30c518c5be17c8850b
|
# accessKey: admin
|
||||||
# secretKey: 0fad3477fb9f60c7be75561db967e8d7
|
# secretKey: admin@C501
|
||||||
# bucketName: cell
|
# bucketName: cell
|
||||||
|
# path: /root/minio/data/cell
|
||||||
|
minio:
|
||||||
|
endpoint: https://c.xitu3d.com:19000
|
||||||
|
port: 19000
|
||||||
|
accessKey: 7885444af42e4b30c518c5be17c8850b
|
||||||
|
secretKey: 0fad3477fb9f60c7be75561db967e8d7
|
||||||
|
bucketName: school
|
||||||
|
path: /root/minio/data/cell
|
||||||
device:
|
device:
|
||||||
appId: 8e9b941923abd
|
appId: 8e9b941923abd
|
||||||
appSecret: Mjk0ODIxOTcwMTQ0NjkwNzA1NDE0MzcyNjgxMTQ0MDc0MjE
|
appSecret: Mjk0ODIxOTcwMTQ0NjkwNzA1NDE0MzcyNjgxMTQ0MDc0MjE
|
||||||
|
@ -112,6 +113,10 @@ global:
|
||||||
app:
|
app:
|
||||||
key: 9894480ac52e4
|
key: 9894480ac52e4
|
||||||
secret: Mjk0ODUzNzA2Mzk3NzEzMjU2OTIwOTk1NzUzMDI5MTQwNDI
|
secret: Mjk0ODUzNzA2Mzk3NzEzMjU2OTIwOTk1NzUzMDI5MTQwNDI
|
||||||
|
qingju:
|
||||||
|
url: http://api.xstongchuang.com/dataApiV1
|
||||||
|
accountNumber: S0001
|
||||||
|
empowerKey: oRAZd58WkmAx4oQUU4gqU_aYG_e0
|
||||||
|
|
||||||
shapelight:
|
shapelight:
|
||||||
cluster: false #集群配置 true集群环境 false单机环境,还需打开pom.xml里的spring-session-data-redis注释
|
cluster: false #集群配置 true集群环境 false单机环境,还需打开pom.xml里的spring-session-data-redis注释
|
||||||
|
|
|
@ -330,6 +330,11 @@
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getBuildNumber" resultType="string">
|
||||||
|
select number from ten_build
|
||||||
|
where build_id = #{buildId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,40 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="net.shapelight.modules.ten.dao.TenParentMapper">
|
||||||
|
|
||||||
|
<resultMap id="BaseResultMap" type="net.shapelight.modules.ten.entity.TenParent">
|
||||||
|
<id property="id" column="id" jdbcType="BIGINT"/>
|
||||||
|
<result property="name" column="name" jdbcType="VARCHAR"/>
|
||||||
|
<result property="gender" column="grade" jdbcType="TINYINT"/>
|
||||||
|
<result property="idCard" column="id_card" jdbcType="VARCHAR"/>
|
||||||
|
<result property="registerType" column="register_type" jdbcType="TINYINT"/>
|
||||||
|
<result property="userId" column="user_id" jdbcType="BIGINT"/>
|
||||||
|
</resultMap>
|
||||||
|
<resultMap id="BaseVoMap" type="net.shapelight.modules.vo.ParentVo">
|
||||||
|
<id property="id" column="id" jdbcType="BIGINT"/>
|
||||||
|
<result property="name" column="name" jdbcType="VARCHAR"/>
|
||||||
|
<result property="gender" column="gender" jdbcType="TINYINT"/>
|
||||||
|
<result property="idCard" column="id_card" jdbcType="VARCHAR"/>
|
||||||
|
<result property="registerType" column="register_type" jdbcType="TINYINT"/>
|
||||||
|
<result property="mobile" column="mobile" jdbcType="VARCHAR"/>
|
||||||
|
<result property="userId" column="user_id" jdbcType="BIGINT"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
id,name,
|
||||||
|
gender,id_card,register_type
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="getParentVoList" resultType="net.shapelight.modules.vo.ParentVo">
|
||||||
|
select t.*,a.* from ten_parent t left join app_user a on t.user_id = a.user_id
|
||||||
|
where 1=1
|
||||||
|
<if test="params.name != null and params.name!=''">
|
||||||
|
and t.name = #{params.name}
|
||||||
|
</if>
|
||||||
|
<if test="params.mobile != null and params.mobile!=''">
|
||||||
|
and t.mobile = #{params.mobile}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
|
@ -1301,10 +1301,37 @@
|
||||||
|
|
||||||
|
|
||||||
<select id="findByIdCardAndDept" resultType="net.shapelight.modules.ten.entity.TenPersonEntity">
|
<select id="findByIdCardAndDept" resultType="net.shapelight.modules.ten.entity.TenPersonEntity">
|
||||||
select * from ten_person
|
select * from ten_person where delete_flag = 0
|
||||||
where dept_id = #{deptId} and delete_flag = 0
|
|
||||||
and id_card = #{idCard}
|
and id_card = #{idCard}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectByCreateBy" resultMap="BaseResultMap">
|
||||||
|
select p.* from ten_person p where p.delete_flag = 0 and create_by = #{createBy}
|
||||||
|
<if test="key != null and key!=''">
|
||||||
|
and (p.name like CONCAT('%', '${key}', '%')
|
||||||
|
or p.mobile like CONCAT('%', '${key}', '%'))
|
||||||
|
</if>
|
||||||
|
<if test="status != null and status!='' and status == 0">
|
||||||
|
and p.status = #{status}
|
||||||
|
</if>
|
||||||
|
<if test="status != null and status!='' and status != 0">
|
||||||
|
and p.status != 0
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="findByRyId" resultType="net.shapelight.modules.ten.entity.TenPersonEntity">
|
||||||
|
select * from ten_person
|
||||||
|
where ryid = #{ryId} and id_card = #{idCard}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getByPersonIds" resultMap="BaseResultMap">
|
||||||
|
select * from ten_person
|
||||||
|
where delete_flag = 0 and person_id in
|
||||||
|
<foreach item="personId" collection="personIds" open="(" separator="," close=")">
|
||||||
|
#{personId}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -638,6 +638,19 @@
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getByPersonIds" resultMap="tenRecordMap">
|
||||||
|
select * from
|
||||||
|
(select * from ten_record_${cellId}
|
||||||
|
where delete_flag = 0 and person_id in
|
||||||
|
<foreach item="params.personId" collection="params.personIds" open="(" separator="," close=")">
|
||||||
|
#{personId}
|
||||||
|
</foreach>) a where 1=1
|
||||||
|
<if test="params.name != null and params.name != ''">
|
||||||
|
and a.name like CONCAT('%', '${params.name}', '%')
|
||||||
|
</if>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,79 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="net.shapelight.modules.ten.dao.TenRelationMapper">
|
||||||
|
|
||||||
|
<resultMap id="BaseResultMap" type="net.shapelight.modules.ten.entity.TenRelation">
|
||||||
|
<id property="id" column="id" jdbcType="BIGINT"/>
|
||||||
|
<result property="parentId" column="parent_id" jdbcType="BIGINT"/>
|
||||||
|
<result property="studentId" column="student_id" jdbcType="BIGINT"/>
|
||||||
|
<result property="relation" column="relation" jdbcType="VARCHAR"/>
|
||||||
|
<result property="status" column="status" jdbcType="TINYINT"/>
|
||||||
|
<result property="createTime" column="create_time" jdbcType="DATE"/>
|
||||||
|
<result property="detail" column="detail" jdbcType="VARCHAR"/>
|
||||||
|
</resultMap>
|
||||||
|
<resultMap id="BaseVoMap" type="net.shapelight.modules.vo.ParentAndStudentVo">
|
||||||
|
<id property="id" column="id" jdbcType="BIGINT"/>
|
||||||
|
<result property="parentName" column="name" jdbcType="VARCHAR"/>
|
||||||
|
<result property="parentGender" column="gender" jdbcType="INTEGER"/>
|
||||||
|
<result property="relation" column="relation" jdbcType="VARCHAR"/>
|
||||||
|
<result property="parentMobile" column="mobile" jdbcType="VARCHAR"/>
|
||||||
|
<result property="personId" column="student_id" jdbcType="BIGINT"/>
|
||||||
|
<result property="studentName" column="studentName" jdbcType="VARCHAR"/>
|
||||||
|
|
||||||
|
<result property="status" column="status" jdbcType="TINYINT"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
id
|
||||||
|
,parent_id,student_id,relation,status,create_time,detail
|
||||||
|
</sql>
|
||||||
|
<select id="getCount" resultType="java.lang.String">
|
||||||
|
select count(1)
|
||||||
|
from ten_relation
|
||||||
|
where parent_id = #{parentId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getAll" resultType="net.shapelight.modules.vo.ParentAndStudentVo">
|
||||||
|
SELECT
|
||||||
|
t.id,
|
||||||
|
f.NAME AS parentName,
|
||||||
|
f.gender AS parentGender,
|
||||||
|
t.relation,
|
||||||
|
a.mobile AS parentMobile,
|
||||||
|
t.student_id AS personId,
|
||||||
|
p.NAME AS studentName,
|
||||||
|
p.ryid AS studentNumber,
|
||||||
|
p.gender AS studentGender,
|
||||||
|
r.room_name,
|
||||||
|
t.status,
|
||||||
|
t.create_time as bindTime,
|
||||||
|
p.face_image,
|
||||||
|
t.approval_time,
|
||||||
|
t.approval
|
||||||
|
FROM
|
||||||
|
ten_relation t
|
||||||
|
LEFT JOIN app_user a ON t.parent_id = a.user_id
|
||||||
|
LEFT JOIN ten_parent f ON t.parent_id = f.user_id
|
||||||
|
LEFT JOIN ten_person p ON t.student_id = p.person_id
|
||||||
|
left join ten_room r on p.room_id = r.room_id
|
||||||
|
where 1=1
|
||||||
|
<if test="params.name!=null and params.name!=''">
|
||||||
|
and f.name = #{params.name}
|
||||||
|
</if>
|
||||||
|
<if test="params.idCard!=null and params.idCard!=''">
|
||||||
|
and f.id_card = #{params.idCard}
|
||||||
|
</if>
|
||||||
|
<if test="params.mobile!=null and params.mobile!=''">
|
||||||
|
and a.mobile = #{params.mobile}
|
||||||
|
</if>
|
||||||
|
<if test="params.status!=null and params.status!='' and params.status == 2">
|
||||||
|
and t.status = 2
|
||||||
|
</if>
|
||||||
|
<if test="params.status!=null and params.status!='' and params.status != 2">
|
||||||
|
and t.status != 2
|
||||||
|
</if>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
</mapper>
|
|
@ -42,6 +42,10 @@
|
||||||
select="net.shapelight.modules.ten.dao.TenCellDao.getCellName"
|
select="net.shapelight.modules.ten.dao.TenCellDao.getCellName"
|
||||||
column="cellId=cell_id">
|
column="cellId=cell_id">
|
||||||
</association>
|
</association>
|
||||||
|
<association property="buildNumber" javaType="String"
|
||||||
|
select="net.shapelight.modules.ten.dao.TenBuildDao.getBuildNumber"
|
||||||
|
column="buildId=build_id,cellId=cell_id">
|
||||||
|
</association>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<insert id="insert" parameterType="net.shapelight.modules.ten.entity.TenRoomEntity">
|
<insert id="insert" parameterType="net.shapelight.modules.ten.entity.TenRoomEntity">
|
||||||
|
@ -405,7 +409,7 @@
|
||||||
|
|
||||||
<select id="getLayerRooms" resultType="net.shapelight.modules.ten.entity.TenRoomEntity">
|
<select id="getLayerRooms" resultType="net.shapelight.modules.ten.entity.TenRoomEntity">
|
||||||
select * from ten_room where delete_flag = 0
|
select * from ten_room where delete_flag = 0
|
||||||
and build_id = #{buildId} and layer = #{layer}
|
and build_id = #{buildId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getBuildRooms" resultType="net.shapelight.modules.ten.entity.TenRoomEntity">
|
<select id="getBuildRooms" resultType="net.shapelight.modules.ten.entity.TenRoomEntity">
|
||||||
|
|
Loading…
Reference in New Issue