Compare commits
8 Commits
1787fb6b79
...
faa5b8553a
Author | SHA1 | Date |
---|---|---|
|
faa5b8553a | |
|
edc9e08711 | |
|
a7f61664f2 | |
|
0a9d610537 | |
|
fd2ccd530f | |
|
4ad55b92a4 | |
|
82d00f1c5b | |
|
3001e20b0d |
|
@ -157,17 +157,17 @@
|
||||||
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.guwan</groupId>
|
<groupId>com.alibaba</groupId>
|
||||||
<artifactId>easyexcel</artifactId>
|
<artifactId>easyexcel</artifactId>
|
||||||
<version>4.0.3</version>
|
<version>4.0.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
<dependency>
|
<!--<dependency>
|
||||||
<groupId>com.alibaba</groupId>
|
<groupId>com.alibaba</groupId>
|
||||||
<artifactId>easyexcel</artifactId>
|
<artifactId>easyexcel</artifactId>
|
||||||
<version>1.1.2-beta5</version>
|
<version>1.1.2-beta5</version>
|
||||||
</dependency>
|
</dependency>-->
|
||||||
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
@ -27,7 +27,6 @@ public class MybatisPlusConfig {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分表插件
|
* 分表插件
|
||||||
*/
|
*/
|
||||||
|
@ -40,7 +39,7 @@ public class MybatisPlusConfig {
|
||||||
DynamicTableNameInnerInterceptor dynamicTableNameInnerInterceptor = new DynamicTableNameInnerInterceptor();
|
DynamicTableNameInnerInterceptor dynamicTableNameInnerInterceptor = new DynamicTableNameInnerInterceptor();
|
||||||
dynamicTableNameInnerInterceptor.setTableNameHandler(
|
dynamicTableNameInnerInterceptor.setTableNameHandler(
|
||||||
//可以传多个表名参数,指定哪些表使用MonthTableNameHandler处理表名称
|
//可以传多个表名参数,指定哪些表使用MonthTableNameHandler处理表名称
|
||||||
new CustomizeTableNameHandler("ten_person_extract,mobile_device,mobile_package_order,mobile_call_logs")
|
new CustomizeTableNameHandler("ten_person_extract","mobile_device","mobile_package_order","mobile_call_logs","mobile_contact")
|
||||||
);
|
);
|
||||||
|
|
||||||
//以拦截器的方式处理表名称
|
//以拦截器的方式处理表名称
|
||||||
|
|
|
@ -10,7 +10,7 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public class CustomizeTableNameHandler implements TableNameHandler {
|
public class CustomizeTableNameHandler implements TableNameHandler {
|
||||||
//用于记录哪些表可以使用该月份动态表名处理器(即哪些表可以分表)
|
//用于记录哪些表可以使用该月份动态表名处理器(即哪些表可以分表)
|
||||||
private List<String> tableNames;
|
private final List<String> tableNames;
|
||||||
|
|
||||||
//构造函数,构造动态表名处理器的时候,传递tableNames参数
|
//构造函数,构造动态表名处理器的时候,传递tableNames参数
|
||||||
public CustomizeTableNameHandler(String ...tableNames) {
|
public CustomizeTableNameHandler(String ...tableNames) {
|
||||||
|
@ -39,4 +39,5 @@ public class CustomizeTableNameHandler implements TableNameHandler {
|
||||||
return tableName; //表名原样返回
|
return tableName; //表名原样返回
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package net.shapelight.common.utils;
|
package net.shapelight.common.utils;
|
||||||
|
|
||||||
import com.guwan.excel.EasyExcel;
|
import com.alibaba.excel.EasyExcel;
|
||||||
import com.guwan.excel.converters.longconverter.LongStringConverter;
|
import com.alibaba.excel.converters.longconverter.LongStringConverter;
|
||||||
import com.guwan.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
|
import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
|
@ -26,13 +26,12 @@ 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.fegin.OpFeignClient;
|
import net.shapelight.modules.fegin.client.OpFeignClient;
|
||||||
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.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.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;
|
||||||
|
|
|
@ -21,12 +21,11 @@ import net.shapelight.modules.sys.service.SysDeviceAppService;
|
||||||
import net.shapelight.modules.sys.service.SysUserService;
|
import net.shapelight.modules.sys.service.SysUserService;
|
||||||
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.fegin.OpFeignClient;
|
import net.shapelight.modules.fegin.client.OpFeignClient;
|
||||||
import net.shapelight.modules.vo.SchoolNameVo;
|
import net.shapelight.modules.vo.SchoolNameVo;
|
||||||
import org.apache.commons.codec.digest.DigestUtils;
|
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.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;
|
||||||
|
|
|
@ -9,7 +9,7 @@ import net.shapelight.common.utils.IpUtils;
|
||||||
import net.shapelight.common.utils.SnowflakeIdWorker;
|
import net.shapelight.common.utils.SnowflakeIdWorker;
|
||||||
import net.shapelight.modules.app.annotation.Login;
|
import net.shapelight.modules.app.annotation.Login;
|
||||||
import net.shapelight.modules.app.annotation.LoginUser;
|
import net.shapelight.modules.app.annotation.LoginUser;
|
||||||
import net.shapelight.modules.fegin.OpFeignClient;
|
import net.shapelight.modules.fegin.client.OpFeignClient;
|
||||||
import net.shapelight.modules.mobile.entity.MobilePackage;
|
import net.shapelight.modules.mobile.entity.MobilePackage;
|
||||||
import net.shapelight.modules.mobile.entity.MobilePackageOrder;
|
import net.shapelight.modules.mobile.entity.MobilePackageOrder;
|
||||||
import net.shapelight.modules.mobile.service.MobilePackageOrderService;
|
import net.shapelight.modules.mobile.service.MobilePackageOrderService;
|
||||||
|
@ -40,7 +40,7 @@ public class AppParentWxController {
|
||||||
MobilePackageService packageService;
|
MobilePackageService packageService;
|
||||||
@Autowired
|
@Autowired
|
||||||
GlobalValue globalValue;
|
GlobalValue globalValue;
|
||||||
@Qualifier("net.shapelight.modules.fegin.OpFeignClient")
|
@Qualifier("net.shapelight.modules.fegin.client.OpFeignClient")
|
||||||
@Autowired
|
@Autowired
|
||||||
private OpFeignClient opFeignClient;
|
private OpFeignClient opFeignClient;
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
package net.shapelight.modules.excel.model;
|
package net.shapelight.modules.excel.model;
|
||||||
|
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import com.alibaba.excel.metadata.BaseRowModel;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class PersonModel extends BaseRowModel implements Serializable {
|
public class PersonModel implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@ package net.shapelight.modules.fegin;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import net.shapelight.modules.fegin.client.OpFeignClient;
|
||||||
import net.shapelight.modules.job.entity.KeysEntity;
|
import net.shapelight.modules.job.entity.KeysEntity;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
@ -17,7 +18,7 @@ import java.util.Map;
|
||||||
@Component
|
@Component
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class DataSync {
|
public class DataSync {
|
||||||
/*@Autowired
|
@Autowired
|
||||||
OpFeignClient opFeignClient;
|
OpFeignClient opFeignClient;
|
||||||
@Value("${global.qingju.accountNumber}")
|
@Value("${global.qingju.accountNumber}")
|
||||||
public String accountNumber;
|
public String accountNumber;
|
||||||
|
@ -34,5 +35,5 @@ public class DataSync {
|
||||||
KeysEntity.passKey = json.getString("passKey");
|
KeysEntity.passKey = json.getString("passKey");
|
||||||
KeysEntity.empowerText = json.getString("empowerText");
|
KeysEntity.empowerText = json.getString("empowerText");
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,74 +0,0 @@
|
||||||
package net.shapelight.modules.fegin;
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public JSONObject getToken(Map<String, Object> params) {
|
|
||||||
JSONObject jsonObject = new JSONObject();
|
|
||||||
jsonObject.put("errorMessage","token获取失败");
|
|
||||||
return jsonObject;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public JSONObject createIotGroupId(Map<String, Object> params) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public JSONObject removeIotGroupDevice(Map<String, Object> params) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public JSONObject addIotGroupDevice(Map<String, Object> params) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public JSONObject getIotGroupInfo(Map<String, Object> params) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public JSONObject activeLicenseDevice(Map<String, Object> params) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public JSONObject getLicenseDeviceInfo(Map<String, Object> params) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public JSONObject createOrder(Map<String, Object> params) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
package net.shapelight.modules.fegin.client;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import net.shapelight.modules.fegin.hystrix.OpHystrix;
|
||||||
|
import net.shapelight.modules.fegin.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,fallbackFactory = OpHystrix.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);
|
||||||
|
|
||||||
|
@PostMapping("/getData")
|
||||||
|
JSONObject getData(@RequestBody Map<String,Object> params);
|
||||||
|
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package net.shapelight.modules.fegin;
|
package net.shapelight.modules.fegin.client;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import net.shapelight.modules.fegin.config.OpFeignConfig;
|
import net.shapelight.modules.fegin.config.OpFeignConfig;
|
||||||
|
@ -9,7 +9,6 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -19,19 +18,7 @@ import java.util.Map;
|
||||||
*/
|
*/
|
||||||
@FeignClient(name = "operator-service", url = "${global.wx.url}",configuration = OpFeignConfig.class)
|
@FeignClient(name = "operator-service", url = "${global.wx.url}",configuration = OpFeignConfig.class)
|
||||||
@Component
|
@Component
|
||||||
public interface OpFeignClient {
|
public interface WxFeignClient {
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取密钥 1800s
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@PostConstruct
|
|
||||||
@PostMapping("/empower")
|
|
||||||
JSONObject empower(@RequestBody Map<String,Object> params);
|
|
||||||
|
|
||||||
@PostMapping("/submitData")
|
|
||||||
JSONObject submitData(@RequestBody Map<String,Object> params);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
获取token
|
获取token
|
||||||
*/
|
*/
|
|
@ -2,7 +2,7 @@ package net.shapelight.modules.fegin.config;
|
||||||
|
|
||||||
import feign.Logger;
|
import feign.Logger;
|
||||||
import feign.Request;
|
import feign.Request;
|
||||||
import net.shapelight.modules.fegin.OpFeignInterceptor;
|
import net.shapelight.modules.fegin.interceptor.OpFeignInterceptor;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
package net.shapelight.modules.fegin.hystrix;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
|
|
||||||
|
import feign.hystrix.FallbackFactory;
|
||||||
|
import net.shapelight.modules.fegin.client.OpFeignClient;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONObject getData(Map<String, Object> params) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package net.shapelight.modules.fegin;
|
package net.shapelight.modules.fegin.interceptor;
|
||||||
|
|
||||||
import feign.RequestInterceptor;
|
import feign.RequestInterceptor;
|
||||||
import feign.RequestTemplate;
|
import feign.RequestTemplate;
|
||||||
|
@ -14,8 +14,8 @@ public class OpFeignInterceptor implements RequestInterceptor {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void apply(RequestTemplate requestTemplate) {
|
public void apply(RequestTemplate requestTemplate) {
|
||||||
requestTemplate.header("access_token", redisUtils.get("wxToken").toString());
|
//requestTemplate.header("access_token", redisUtils.get("wxToken").toString());
|
||||||
//requestTemplate.header("empowerText", KeysEntity.empowerText);
|
requestTemplate.header("empowerText", KeysEntity.empowerText);
|
||||||
log.info("feign拦截器");
|
log.info("feign拦截器");
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -3,7 +3,7 @@ package net.shapelight.modules.job.task;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.shapelight.modules.job.entity.KeysEntity;
|
import net.shapelight.modules.job.entity.KeysEntity;
|
||||||
import net.shapelight.modules.fegin.OpFeignClient;
|
import net.shapelight.modules.fegin.client.OpFeignClient;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
|
@ -0,0 +1,99 @@
|
||||||
|
package net.shapelight.modules.job.task;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import net.shapelight.common.handler.CustomizeTableNameHandler;
|
||||||
|
import net.shapelight.modules.fegin.client.OpFeignClient;
|
||||||
|
import net.shapelight.modules.job.entity.KeysEntity;
|
||||||
|
import net.shapelight.modules.mobile.entity.MobileDevice;
|
||||||
|
import net.shapelight.modules.mobile.entity.MobileDeviceGroup;
|
||||||
|
import net.shapelight.modules.mobile.service.MobileDeviceGroupService;
|
||||||
|
import net.shapelight.modules.mobile.service.MobileDeviceService;
|
||||||
|
import net.shapelight.modules.sys.controller.AbstractController;
|
||||||
|
import net.shapelight.modules.ten.entity.TenUserScopeEntity;
|
||||||
|
import net.shapelight.modules.ten.service.impl.TenUserScopeServiceImpl;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class TerminalListSyncTask extends AbstractController implements ITask {
|
||||||
|
@Autowired
|
||||||
|
private OpFeignClient feignClient;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MobileDeviceGroupService mobileDeviceGroupService;
|
||||||
|
@Autowired
|
||||||
|
private MobileDeviceService mobileDeviceService;
|
||||||
|
|
||||||
|
@Value("${global.qingju.accountNumber}")
|
||||||
|
String accountNumber;
|
||||||
|
@Value("${global.qingju.empowerKey}")
|
||||||
|
String empowerKey;
|
||||||
|
@Autowired
|
||||||
|
private TenUserScopeServiceImpl tenUserScopeService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run(String params) throws Exception {
|
||||||
|
syncTerminal();
|
||||||
|
syncTerminalGroup();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void syncTerminalGroup() throws Exception {
|
||||||
|
Map<String, Object> params = new HashMap<String, Object>();
|
||||||
|
params.put("accountNumber", accountNumber);
|
||||||
|
params.put("empowerKey", empowerKey);
|
||||||
|
params.put("operation", "ghTerminalGroupGetList");
|
||||||
|
params.put("passKey", KeysEntity.passKey);
|
||||||
|
Map<String, Object> queryParams = feignClient.getData(params);
|
||||||
|
queryParams.put("otherSchoolCode", "xtzg");
|
||||||
|
params.put("queryParams",queryParams);
|
||||||
|
JSONObject jsonObject = feignClient.getData(params);
|
||||||
|
TenUserScopeEntity tenUserScopeEntity = tenUserScopeService.getOne(new LambdaQueryWrapper<TenUserScopeEntity>()
|
||||||
|
.eq(TenUserScopeEntity::getUserId,getUserId()));
|
||||||
|
if(jsonObject.getString("shrgStatus").equals("S")) {
|
||||||
|
List<JSONObject> list = jsonObject.getJSONArray("list").toJavaList(JSONObject.class);
|
||||||
|
list.forEach(item -> {
|
||||||
|
MobileDeviceGroup mdg = new MobileDeviceGroup();
|
||||||
|
mdg.setOpenId(item.getString("terminalGroupUuid"));
|
||||||
|
mdg.setGroupName(item.getString("terminalGroupName"));
|
||||||
|
mdg.setDeviceCount(item.getInteger("terminalCount"));
|
||||||
|
mobileDeviceGroupService.save(mdg);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void syncTerminal() throws Exception {
|
||||||
|
Map<String, Object> params = new HashMap<String, Object>();
|
||||||
|
params.put("accountNumber", accountNumber);
|
||||||
|
params.put("empowerKey", empowerKey);
|
||||||
|
params.put("operation", "ghTerminalGetList");
|
||||||
|
params.put("passKey", KeysEntity.passKey);
|
||||||
|
Map<String, Object> queryParams = feignClient.getData(params);
|
||||||
|
queryParams.put("otherSchoolCode", "xtzg");
|
||||||
|
//params.put("queryParams",queryParams);
|
||||||
|
JSONObject jsonObject = feignClient.getData(params);
|
||||||
|
TenUserScopeEntity tenUserScopeEntity = tenUserScopeService.getOne(new LambdaQueryWrapper<TenUserScopeEntity>()
|
||||||
|
.eq(TenUserScopeEntity::getUserId,getUserId()));
|
||||||
|
if(jsonObject.getString("shrgStatus").equals("S")) {
|
||||||
|
List<JSONObject> list = jsonObject.getJSONArray("list").toJavaList(JSONObject.class);
|
||||||
|
|
||||||
|
CustomizeTableNameHandler.setData(tenUserScopeEntity.getTenantId().toString());
|
||||||
|
list.forEach(item -> {
|
||||||
|
MobileDevice mobileDevice = new MobileDevice();
|
||||||
|
mobileDevice.setOpenId(item.getString("terminalGroupUuid"));
|
||||||
|
mobileDevice.setName(item.getString("terminalName"));
|
||||||
|
mobileDevice.setSn(item.getString("terminalSn"));
|
||||||
|
mobileDevice.setKey(item.getString("key"));
|
||||||
|
mobileDevice.setGroupName(item.getString("terminalGroupName"));
|
||||||
|
//mobileDevice.setGroupId(item.getString(""))
|
||||||
|
mobileDeviceService.save(mobileDevice);
|
||||||
|
});
|
||||||
|
CustomizeTableNameHandler.removeData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
package net.shapelight.modules.mobile.controler;
|
||||||
|
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import net.shapelight.common.utils.R;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("ghAppController")
|
||||||
|
@Api(value = "设备接口",tags = "设备接口")
|
||||||
|
public class DeviceClientController {
|
||||||
|
|
||||||
|
public R getData(@RequestBody Map<String,Object> params) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return R.ok().put("data", params.get("data"));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,33 +1,46 @@
|
||||||
package net.shapelight.modules.mobile.controler;
|
package net.shapelight.modules.mobile.controler;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
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.handler.CustomizeTableNameHandler;
|
|
||||||
import net.shapelight.common.utils.PageUtils;
|
|
||||||
import net.shapelight.common.utils.R;
|
import net.shapelight.common.utils.R;
|
||||||
import net.shapelight.common.utils.SnowflakeIdWorker;
|
import net.shapelight.modules.fegin.client.OpFeignClient;
|
||||||
|
import net.shapelight.modules.job.entity.KeysEntity;
|
||||||
import net.shapelight.modules.mobile.dto.mobileDevice.MobileDeviceAddDto;
|
import net.shapelight.modules.mobile.dto.mobileDevice.MobileDeviceAddDto;
|
||||||
import net.shapelight.modules.mobile.dto.mobileDevice.MobileDeviceQueryDto;
|
import net.shapelight.modules.mobile.dto.mobileDevice.MobileDeviceQueryDto;
|
||||||
import net.shapelight.modules.mobile.entity.MobileDevice;
|
import net.shapelight.modules.mobile.entity.MobileDevice;
|
||||||
import net.shapelight.modules.mobile.service.MobileDeviceService;
|
import net.shapelight.modules.mobile.service.MobileDeviceService;
|
||||||
import net.shapelight.modules.sys.controller.AbstractController;
|
import net.shapelight.modules.sys.controller.AbstractController;
|
||||||
import org.apache.ibatis.annotations.Delete;
|
import net.shapelight.modules.ten.entity.TenUserScopeEntity;
|
||||||
|
import net.shapelight.modules.ten.service.impl.TenUserScopeServiceImpl;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("mobile/device/")
|
@RequestMapping("mobile/device/")
|
||||||
@Api("话机设备管理")
|
@Api(value="话务设备管理",tags="话务设备管理")
|
||||||
public class DeviceController extends AbstractController {
|
public class DeviceController extends AbstractController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
MobileDeviceService mobileDeviceService;
|
MobileDeviceService mobileDeviceService;
|
||||||
|
@Autowired
|
||||||
|
private OpFeignClient feignClient;
|
||||||
|
|
||||||
|
@Value("${global.qingju.accountNumber}")
|
||||||
|
String accountNumber;
|
||||||
|
@Value("${global.qingju.empowerKey}")
|
||||||
|
String empowerKey;
|
||||||
|
@Autowired
|
||||||
|
private TenUserScopeServiceImpl tenUserScopeService;
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("list")
|
@GetMapping("list")
|
||||||
|
@ -58,8 +71,26 @@ public class DeviceController extends AbstractController {
|
||||||
mobileDeviceQueryDto.setName(name);
|
mobileDeviceQueryDto.setName(name);
|
||||||
mobileDeviceQueryDto.setGroupId(groupId);
|
mobileDeviceQueryDto.setGroupId(groupId);
|
||||||
mobileDeviceQueryDto.setApkVersion(apkVersion);
|
mobileDeviceQueryDto.setApkVersion(apkVersion);
|
||||||
|
Map<String, Object> params = new HashMap<String, Object>();
|
||||||
|
params.put("accountNumber", accountNumber);
|
||||||
|
params.put("empowerText", KeysEntity.empowerText);
|
||||||
|
params.put("operation", "ghTerminalGroupGetList");
|
||||||
|
params.put("passKey", KeysEntity.passKey);
|
||||||
|
Map<String, Object> queryParams = new HashMap<>();
|
||||||
|
TenUserScopeEntity tenUserScopeEntity = tenUserScopeService.getOne(new LambdaQueryWrapper<TenUserScopeEntity>().eq(TenUserScopeEntity::getUserId,getUserId()));
|
||||||
|
queryParams.put("otherSchoolCode", tenUserScopeEntity.getCellId().toString());
|
||||||
|
params.put("queryParams",queryParams);
|
||||||
|
JSONObject jsonObject = feignClient.getData(params);
|
||||||
|
if(jsonObject.getString("shrgStatus").equals("S")) {
|
||||||
|
JSONArray list = jsonObject.getJSONArray("list");
|
||||||
|
int totalSize = list.size();
|
||||||
|
long start = (page-1) * size;
|
||||||
|
long end = Math.min((page) * size, totalSize);
|
||||||
|
return R.ok().put("data",list.subList(Math.toIntExact(start), Math.toIntExact(end)));
|
||||||
|
}
|
||||||
|
|
||||||
return R.ok().put("data", mobileDeviceService.list(mobileDeviceQueryDto));
|
//return R.ok().put("data", mobileDeviceService.list(mobileDeviceQueryDto));
|
||||||
|
return R.error().put("data","获取公话组失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("add")
|
@PostMapping("add")
|
||||||
|
|
|
@ -1,34 +1,51 @@
|
||||||
package net.shapelight.modules.mobile.controler;
|
package net.shapelight.modules.mobile.controler;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
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 lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import net.shapelight.common.utils.BeanUtils;
|
|
||||||
//import net.shapelight.common.utils.ExcelUtils;
|
//import net.shapelight.common.utils.ExcelUtils;
|
||||||
import net.shapelight.common.utils.ExcelUtils;
|
import net.shapelight.common.utils.ExcelUtils;
|
||||||
import net.shapelight.common.utils.R;
|
import net.shapelight.common.utils.R;
|
||||||
|
import net.shapelight.modules.fegin.client.OpFeignClient;
|
||||||
|
import net.shapelight.modules.job.entity.KeysEntity;
|
||||||
import net.shapelight.modules.mobile.dto.mobileDeviceGroup.MobileDeviceGruopQueryDto;
|
import net.shapelight.modules.mobile.dto.mobileDeviceGroup.MobileDeviceGruopQueryDto;
|
||||||
import net.shapelight.modules.mobile.dto.mobileDeviceGroup.MobileDeviceGroupAddDto;
|
import net.shapelight.modules.mobile.dto.mobileDeviceGroup.MobileDeviceGroupAddDto;
|
||||||
import net.shapelight.modules.mobile.service.MobileDeviceGroupService;
|
import net.shapelight.modules.mobile.service.MobileDeviceGroupService;
|
||||||
import net.shapelight.modules.mobile.vo.mobileDeviceGroup.MobileDeviceGroupVo;
|
import net.shapelight.modules.mobile.vo.mobileDeviceGroup.MobileDeviceGroupVo;
|
||||||
|
import net.shapelight.modules.sys.controller.AbstractController;
|
||||||
|
import net.shapelight.modules.ten.entity.TenUserScopeEntity;
|
||||||
|
import net.shapelight.modules.ten.service.impl.TenUserScopeServiceImpl;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("mobile/device/group/")
|
@RequestMapping("mobile/device/group/")
|
||||||
@Api("话机设备组管理")
|
@Api(value = "话机设备组管理",tags = "话机设备组管理")
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class DeviceGroupController {
|
public class DeviceGroupController extends AbstractController {
|
||||||
|
|
||||||
private final MobileDeviceGroupService mobileDeviceGroupService;
|
private final MobileDeviceGroupService mobileDeviceGroupService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private OpFeignClient feignClient;
|
||||||
|
|
||||||
|
@Value("${global.qingju.accountNumber}")
|
||||||
|
String accountNumber;
|
||||||
|
@Value("${global.qingju.empowerKey}")
|
||||||
|
String empowerKey;
|
||||||
|
@Autowired
|
||||||
|
private TenUserScopeServiceImpl tenUserScopeService;
|
||||||
|
|
||||||
@GetMapping("list")
|
@GetMapping("list")
|
||||||
@ApiOperation("话机设备组列表")
|
@ApiOperation("话机设备组列表")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
|
@ -48,7 +65,30 @@ public class DeviceGroupController {
|
||||||
mobileDeviceGruopQueryDto.setGroupId(groupId);
|
mobileDeviceGruopQueryDto.setGroupId(groupId);
|
||||||
mobileDeviceGruopQueryDto.setStatus(status);
|
mobileDeviceGruopQueryDto.setStatus(status);
|
||||||
|
|
||||||
return R.ok().put("data", mobileDeviceGroupService.list(mobileDeviceGruopQueryDto));
|
Map<String, Object> params = new HashMap<String, Object>();
|
||||||
|
params.put("accountNumber", accountNumber);
|
||||||
|
params.put("empowerText", KeysEntity.empowerText);
|
||||||
|
params.put("operation", "ghTerminalGetList");
|
||||||
|
params.put("passKey", KeysEntity.passKey);
|
||||||
|
Map<String, Object> queryParams = new HashMap<>();
|
||||||
|
TenUserScopeEntity tenUserScopeEntity = tenUserScopeService.getOne(new LambdaQueryWrapper<TenUserScopeEntity>().eq(TenUserScopeEntity::getUserId,getUserId()));
|
||||||
|
queryParams.put("otherSchoolCode", tenUserScopeEntity.getCellId().toString());
|
||||||
|
params.put("queryParams",queryParams);
|
||||||
|
queryParams.put("otherSchoolCode", tenUserScopeEntity.getCellId().toString());
|
||||||
|
params.put("queryParams",queryParams);
|
||||||
|
JSONObject jsonObject = feignClient.getData(params);
|
||||||
|
if(jsonObject.getString("shrgStatus").equals("S")) {
|
||||||
|
JSONArray list = jsonObject.getJSONArray("list");
|
||||||
|
int totalSize = list.size();
|
||||||
|
long start = (page-1) * size;
|
||||||
|
long end = Math.min(page * size, totalSize);
|
||||||
|
return R.ok().put("data",list.subList(Math.toIntExact(start), Math.toIntExact(end)));
|
||||||
|
}
|
||||||
|
|
||||||
|
//return R.ok().put("data", mobileDeviceService.list(mobileDeviceQueryDto));
|
||||||
|
return R.error().put("data","获取话机列表失败");
|
||||||
|
|
||||||
|
//return R.ok().put("data", mobileDeviceGroupService.list(mobileDeviceGruopQueryDto));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("mobile/package/")
|
@RequestMapping("mobile/package/")
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@Api("公话套餐管理")
|
@Api(value = "公话套餐管理",tags = "公话套餐管理")
|
||||||
public class MobilePackageController extends AbstractController {
|
public class MobilePackageController extends AbstractController {
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
package net.shapelight.modules.mobile.coverter;
|
package net.shapelight.modules.mobile.coverter;
|
||||||
|
|
||||||
|
|
||||||
import com.guwan.excel.converters.Converter;
|
import com.alibaba.excel.converters.Converter;
|
||||||
import com.guwan.excel.enums.CellDataTypeEnum;
|
import com.alibaba.excel.enums.CellDataTypeEnum;
|
||||||
import com.guwan.excel.metadata.GlobalConfiguration;
|
import com.alibaba.excel.metadata.GlobalConfiguration;
|
||||||
import com.guwan.excel.metadata.data.WriteCellData;
|
import com.alibaba.excel.metadata.data.WriteCellData;
|
||||||
import com.guwan.excel.metadata.property.ExcelContentProperty;
|
import com.alibaba.excel.metadata.property.ExcelContentProperty;
|
||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,79 @@
|
||||||
|
package net.shapelight.modules.mobile.entity;
|
||||||
|
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.hibernate.validator.constraints.Length;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @TableName mobile_contact
|
||||||
|
*/
|
||||||
|
@TableName("mobile_contact")
|
||||||
|
@ApiModel("联系人信息")
|
||||||
|
@Data
|
||||||
|
public class MobileContact implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 联系人ID
|
||||||
|
*/
|
||||||
|
@NotNull(message="[联系人ID]不能为空")
|
||||||
|
@ApiModelProperty("联系人ID")
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
private Long contactId;
|
||||||
|
/**
|
||||||
|
* 联系人称呼
|
||||||
|
*/
|
||||||
|
@Size(max= 20,message="编码长度不能超过20")
|
||||||
|
@ApiModelProperty("联系人称呼")
|
||||||
|
@Length(max= 20,message="编码长度不能超过20")
|
||||||
|
private String callName;
|
||||||
|
/**
|
||||||
|
* 联系人电话
|
||||||
|
*/
|
||||||
|
@Size(max= 20,message="编码长度不能超过20")
|
||||||
|
@ApiModelProperty("联系人电话")
|
||||||
|
@Length(max= 20,message="编码长度不能超过20")
|
||||||
|
private String mobile;
|
||||||
|
/**
|
||||||
|
* 学生ID
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("学生ID")
|
||||||
|
private Long personId;
|
||||||
|
/**
|
||||||
|
* 排序字段
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("排序字段")
|
||||||
|
private Integer sort;
|
||||||
|
/**
|
||||||
|
* 家长ID
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("家长ID")
|
||||||
|
private Long parentId;
|
||||||
|
/**
|
||||||
|
* 绑定状态
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("绑定状态")
|
||||||
|
private Integer bindStatus;
|
||||||
|
/**
|
||||||
|
* 是否主联系人
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("是否主联系人")
|
||||||
|
private Integer isMain;
|
||||||
|
/**
|
||||||
|
* 绑定时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("绑定时间")
|
||||||
|
private Date bindTime;
|
||||||
|
|
||||||
|
}
|
|
@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
import org.hibernate.validator.constraints.Length;
|
||||||
|
|
||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
|
@ -121,5 +122,92 @@ public class MobileDevice implements Serializable {
|
||||||
@TableLogic
|
@TableLogic
|
||||||
private Integer deleteFlag;
|
private Integer deleteFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 三方ID
|
||||||
|
*/
|
||||||
|
@Size(max= 50,message="编码长度不能超过50")
|
||||||
|
@ApiModelProperty("三方ID")
|
||||||
|
@Length(max= 50,message="编码长度不能超过50")
|
||||||
|
private String openId;
|
||||||
|
/**
|
||||||
|
* 心跳频率(毫秒)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("心跳频率(毫秒)")
|
||||||
|
private Integer heartbeatFrequency;
|
||||||
|
/**
|
||||||
|
* 单次通话时长
|
||||||
|
*/
|
||||||
|
@NotNull(message="[单次通话时长]不能为空")
|
||||||
|
@ApiModelProperty("单次通话时长")
|
||||||
|
private Integer callTime;
|
||||||
|
/**
|
||||||
|
* 开机时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("开机时间")
|
||||||
|
private Date timeOn;
|
||||||
|
/**
|
||||||
|
* 关机时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("关机时间")
|
||||||
|
private Date timeOff;
|
||||||
|
/**
|
||||||
|
* 禁拨电话
|
||||||
|
*/
|
||||||
|
@Size(max= 255,message="编码长度不能超过255")
|
||||||
|
@ApiModelProperty("禁拨电话")
|
||||||
|
@Length(max= 255,message="编码长度不能超过255")
|
||||||
|
private String forbidPhone;
|
||||||
|
/**
|
||||||
|
* 拨号方式(all:视频+语音video:视频sim:语音)
|
||||||
|
*/
|
||||||
|
@NotBlank(message="[拨号方式(all:视频+语音video:视频sim:语音)]不能为空")
|
||||||
|
@Size(max= 10,message="编码长度不能超过10")
|
||||||
|
@ApiModelProperty("拨号方式(all:视频+语音video:视频sim:语音)")
|
||||||
|
@Length(max= 10,message="编码长度不能超过10")
|
||||||
|
private String phoneType;
|
||||||
|
/**
|
||||||
|
* 是否显示留言按钮(Y:显示N不显示)
|
||||||
|
*/
|
||||||
|
@NotBlank(message="[是否显示留言按钮(Y:显示N不显示)]不能为空")
|
||||||
|
@Size(max= 2,message="编码长度不能超过2")
|
||||||
|
@ApiModelProperty("是否显示留言按钮(Y:显示N不显示)")
|
||||||
|
@Length(max= 2,message="编码长度不能超过2")
|
||||||
|
private String messageFlag;
|
||||||
|
/**
|
||||||
|
* 拔打SOS电话是否要人
|
||||||
|
脸认证(Y:要人脸认证N不要人脸认证。)
|
||||||
|
*/
|
||||||
|
@NotBlank(message="[拔打SOS电话是否要人 脸认证(Y:要人脸认证N不要人脸认证。)]不能为空")
|
||||||
|
@Size(max= 2,message="编码长度不能超过2")
|
||||||
|
@ApiModelProperty("拔打SOS电话是否要人 脸认证(Y:要人脸认证N不要人脸认证。)")
|
||||||
|
@Length(max= 2,message="编码长度不能超过2")
|
||||||
|
private String checkSosPhone;
|
||||||
|
/**
|
||||||
|
* 是否显示成绩查询按钮(Y显示N不显示)
|
||||||
|
*/
|
||||||
|
@NotBlank(message="[是否显示成绩查询按钮(Y显示N不显示)]不能为空")
|
||||||
|
@Size(max= 2,message="编码长度不能超过2")
|
||||||
|
@ApiModelProperty("是否显示成绩查询按钮(Y显示N不显示)")
|
||||||
|
@Length(max= 2,message="编码长度不能超过2")
|
||||||
|
private String achievementFlag;
|
||||||
|
/**
|
||||||
|
* 预警通话时长
|
||||||
|
*/
|
||||||
|
@NotNull(message="[预警通话时长]不能为空")
|
||||||
|
@ApiModelProperty("预警通话时长")
|
||||||
|
private Integer warningCallTime;
|
||||||
|
/**
|
||||||
|
* 是否显示请假按钮(Y显示N不显示)
|
||||||
|
*/
|
||||||
|
@NotBlank(message="[是否显示请假按钮(Y显示N不显示)]不能为空")
|
||||||
|
@Size(max= 2,message="编码长度不能超过2")
|
||||||
|
@ApiModelProperty("是否显示请假按钮(Y显示N不显示)")
|
||||||
|
@Length(max= 2,message="编码长度不能超过2")
|
||||||
|
private String userLeaveFlag;
|
||||||
|
|
||||||
|
private String key;
|
||||||
|
|
||||||
|
private String groupName;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
import org.springframework.data.annotation.CreatedDate;
|
import org.springframework.data.annotation.CreatedDate;
|
||||||
|
import org.springframework.data.annotation.Id;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
@ -24,7 +25,7 @@ public class MobileDeviceGroup implements Serializable {
|
||||||
/**
|
/**
|
||||||
* 设备组id
|
* 设备组id
|
||||||
*/
|
*/
|
||||||
@TableId
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
@ApiModelProperty(name = "设备组ID")
|
@ApiModelProperty(name = "设备组ID")
|
||||||
private Long groupId;
|
private Long groupId;
|
||||||
|
|
||||||
|
@ -98,4 +99,6 @@ public class MobileDeviceGroup implements Serializable {
|
||||||
@TableLogic
|
@TableLogic
|
||||||
private Integer deleteFlag;
|
private Integer deleteFlag;
|
||||||
|
|
||||||
|
private String openId;
|
||||||
|
|
||||||
}
|
}
|
|
@ -86,173 +86,4 @@ public class MobilePackageOrder implements Serializable {
|
||||||
@ApiModelProperty("到期时间")
|
@ApiModelProperty("到期时间")
|
||||||
private Date expireTime;
|
private Date expireTime;
|
||||||
|
|
||||||
/**
|
|
||||||
* 订单ID
|
|
||||||
*/
|
|
||||||
private void setOrderId(Long orderId){
|
|
||||||
this.orderId = orderId;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 学生ID
|
|
||||||
*/
|
|
||||||
private void setPersonId(Long personId){
|
|
||||||
this.personId = personId;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 套餐ID
|
|
||||||
*/
|
|
||||||
private void setPackageId(Long packageId){
|
|
||||||
this.packageId = packageId;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 支付金额
|
|
||||||
*/
|
|
||||||
private void setPayment(BigDecimal payment){
|
|
||||||
this.payment = payment;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 付款时间
|
|
||||||
*/
|
|
||||||
private void setPayTime(Date payTime){
|
|
||||||
this.payTime = payTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 支付状态(1已支付0未支付)
|
|
||||||
*/
|
|
||||||
private void setPayStatus(Integer payStatus){
|
|
||||||
this.payStatus = payStatus;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生效时间
|
|
||||||
*/
|
|
||||||
private void setEffectiveDate(Date effectiveDate){
|
|
||||||
this.effectiveDate = effectiveDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 剩余时长
|
|
||||||
*/
|
|
||||||
private void setRemainderTime(Integer remainderTime){
|
|
||||||
this.remainderTime = remainderTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 剩余次数
|
|
||||||
*/
|
|
||||||
private void setRemainderCount(Integer remainderCount){
|
|
||||||
this.remainderCount = remainderCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生效状态
|
|
||||||
*/
|
|
||||||
private void setStatus(Integer status){
|
|
||||||
this.status = status;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 学生姓名
|
|
||||||
*/
|
|
||||||
private void setPersonName(String personName){
|
|
||||||
this.personName = personName;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 到期时间
|
|
||||||
*/
|
|
||||||
private void setExpireTime(Date expireTime){
|
|
||||||
this.expireTime = expireTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 订单ID
|
|
||||||
*/
|
|
||||||
private Long getOrderId(){
|
|
||||||
return this.orderId;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 学生ID
|
|
||||||
*/
|
|
||||||
private Long getPersonId(){
|
|
||||||
return this.personId;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 套餐ID
|
|
||||||
*/
|
|
||||||
private Long getPackageId(){
|
|
||||||
return this.packageId;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 支付金额
|
|
||||||
*/
|
|
||||||
private BigDecimal getPayment(){
|
|
||||||
return this.payment;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 付款时间
|
|
||||||
*/
|
|
||||||
private Date getPayTime(){
|
|
||||||
return this.payTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 支付状态(1已支付0未支付)
|
|
||||||
*/
|
|
||||||
private Integer getPayStatus(){
|
|
||||||
return this.payStatus;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生效时间
|
|
||||||
*/
|
|
||||||
private Date getEffectiveDate(){
|
|
||||||
return this.effectiveDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 剩余时长
|
|
||||||
*/
|
|
||||||
private Integer getRemainderTime(){
|
|
||||||
return this.remainderTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 剩余次数
|
|
||||||
*/
|
|
||||||
private Integer getRemainderCount(){
|
|
||||||
return this.remainderCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生效状态
|
|
||||||
*/
|
|
||||||
private Integer getStatus(){
|
|
||||||
return this.status;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 学生姓名
|
|
||||||
*/
|
|
||||||
private String getPersonName(){
|
|
||||||
return this.personName;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 到期时间
|
|
||||||
*/
|
|
||||||
private Date getExpireTime(){
|
|
||||||
return this.expireTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
package net.shapelight.modules.mobile.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import net.shapelight.modules.mobile.entity.MobileContact;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhangbo
|
||||||
|
* @description 针对表【mobile_contact】的数据库操作Mapper
|
||||||
|
* @createDate 2024-11-18 16:03:51
|
||||||
|
* @Entity net.shapelight.modules.mobile.MobileContact
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface MobileContactMapper extends BaseMapper<MobileContact> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
package net.shapelight.modules.mobile.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import net.shapelight.modules.mobile.entity.MobileContact;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhangbo
|
||||||
|
* @description 针对表【mobile_contact】的数据库操作Service
|
||||||
|
* @createDate 2024-11-18 13:29:24
|
||||||
|
*/
|
||||||
|
public interface MobileContactService extends IService<MobileContact> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package net.shapelight.modules.mobile.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import net.shapelight.modules.mobile.entity.MobileContact;
|
||||||
|
import net.shapelight.modules.mobile.service.MobileContactService;
|
||||||
|
import net.shapelight.modules.mobile.mapper.MobileContactMapper;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhangbo
|
||||||
|
* @description 针对表【mobile_contact】的数据库操作Service实现
|
||||||
|
* @createDate 2024-11-18 13:29:24
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class MobileContactServiceImpl extends ServiceImpl<MobileContactMapper, MobileContact>
|
||||||
|
implements MobileContactService{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package net.shapelight.modules.mobile.vo.mobileDeviceGroup;
|
package net.shapelight.modules.mobile.vo.mobileDeviceGroup;
|
||||||
|
|
||||||
import com.guwan.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
|
@ -16,10 +16,9 @@ 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.fegin.OpFeignClient;
|
import net.shapelight.modules.fegin.client.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.beans.factory.annotation.Value;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
|
@ -17,11 +17,10 @@ import net.shapelight.modules.ten.entity.TenParent;
|
||||||
import net.shapelight.modules.ten.entity.TenRelation;
|
import net.shapelight.modules.ten.entity.TenRelation;
|
||||||
import net.shapelight.modules.ten.service.TenParentService;
|
import net.shapelight.modules.ten.service.TenParentService;
|
||||||
import net.shapelight.modules.ten.service.TenRelationService;
|
import net.shapelight.modules.ten.service.TenRelationService;
|
||||||
import net.shapelight.modules.fegin.OpFeignClient;
|
import net.shapelight.modules.fegin.client.OpFeignClient;
|
||||||
import net.shapelight.modules.vo.ParentVo;
|
import net.shapelight.modules.vo.ParentVo;
|
||||||
import org.apache.commons.codec.digest.DigestUtils;
|
import org.apache.commons.codec.digest.DigestUtils;
|
||||||
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.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@ import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.shapelight.common.config.GlobalValue;
|
import net.shapelight.common.config.GlobalValue;
|
||||||
import net.shapelight.common.config.MinioConfig;
|
import net.shapelight.common.config.MinioConfig;
|
||||||
|
import net.shapelight.common.handler.CustomizeTableNameHandler;
|
||||||
import net.shapelight.common.utils.*;
|
import net.shapelight.common.utils.*;
|
||||||
import net.shapelight.commons.engine.sdk.PalmSDK;
|
import net.shapelight.commons.engine.sdk.PalmSDK;
|
||||||
import net.shapelight.commons.engine.sdk.SdkImageUtils;
|
import net.shapelight.commons.engine.sdk.SdkImageUtils;
|
||||||
|
@ -27,6 +28,8 @@ 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.app.service.impl.AppUserScopeServiceImpl;
|
||||||
import net.shapelight.modules.excel.model.PersonModel;
|
import net.shapelight.modules.excel.model.PersonModel;
|
||||||
|
import net.shapelight.modules.mobile.entity.MobileContact;
|
||||||
|
import net.shapelight.modules.mobile.service.impl.MobileContactServiceImpl;
|
||||||
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;
|
||||||
|
@ -35,13 +38,12 @@ import net.shapelight.modules.sys.service.SysUserService;
|
||||||
import net.shapelight.modules.sys.service.impl.SysDictServiceImpl;
|
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.fegin.OpFeignClient;
|
import net.shapelight.modules.fegin.client.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.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.beans.factory.annotation.Value;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
@ -105,6 +107,8 @@ public class TenPersonController extends AbstractController {
|
||||||
private AppUserScopeServiceImpl appUserScopeService;
|
private AppUserScopeServiceImpl appUserScopeService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private TenRelationService relationService;
|
private TenRelationService relationService;
|
||||||
|
@Autowired
|
||||||
|
private MobileContactServiceImpl mobileContactServiceImpl;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -327,7 +331,10 @@ public class TenPersonController extends AbstractController {
|
||||||
person.setDeptAllName(deptAllName);
|
person.setDeptAllName(deptAllName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CustomizeTableNameHandler.setData(String.valueOf(person.getCellId()));
|
||||||
|
List<MobileContact> list = mobileContactServiceImpl.list(new LambdaQueryWrapper<MobileContact>().eq(MobileContact::getPersonId,person.getPersonId()));
|
||||||
|
CustomizeTableNameHandler.removeData();
|
||||||
|
person.setMobileContactList(list);
|
||||||
return R.ok().put("data", person);
|
return R.ok().put("data", person);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -339,6 +346,12 @@ public class TenPersonController extends AbstractController {
|
||||||
@ApiOperation(value = "查询户室内所有成员", response = TenPersonEntity.class)
|
@ApiOperation(value = "查询户室内所有成员", response = TenPersonEntity.class)
|
||||||
public R findByRoomId(@PathVariable("roomId") Long personId, @PathVariable("cellId") Long cellId) {
|
public R findByRoomId(@PathVariable("roomId") Long personId, @PathVariable("cellId") Long cellId) {
|
||||||
List<TenPersonEntity> person = tenPersonService.getByRoomId(personId, cellId, null);
|
List<TenPersonEntity> person = tenPersonService.getByRoomId(personId, cellId, null);
|
||||||
|
person.forEach(item -> {
|
||||||
|
CustomizeTableNameHandler.setData(String.valueOf(item.getCellId()));
|
||||||
|
List<MobileContact> list = mobileContactServiceImpl.list(new LambdaQueryWrapper<MobileContact>().eq(MobileContact::getPersonId,item.getPersonId()));
|
||||||
|
item.setMobileContactList(list);
|
||||||
|
CustomizeTableNameHandler.setData(String.valueOf(item.getCellId()));
|
||||||
|
});
|
||||||
return R.ok().put("data", person);
|
return R.ok().put("data", person);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,9 +13,8 @@ import net.shapelight.modules.ten.entity.TenUserScopeEntity;
|
||||||
import net.shapelight.modules.ten.service.TenParentService;
|
import net.shapelight.modules.ten.service.TenParentService;
|
||||||
import net.shapelight.modules.ten.service.TenRelationService;
|
import net.shapelight.modules.ten.service.TenRelationService;
|
||||||
import net.shapelight.modules.ten.service.TenUserScopeService;
|
import net.shapelight.modules.ten.service.TenUserScopeService;
|
||||||
import net.shapelight.modules.fegin.OpFeignClient;
|
import net.shapelight.modules.fegin.client.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.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
|
@ -16,11 +16,10 @@ 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.fegin.OpFeignClient;
|
import net.shapelight.modules.fegin.client.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.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import net.shapelight.common.base.BaseEntity;
|
import net.shapelight.common.base.BaseEntity;
|
||||||
|
import net.shapelight.modules.mobile.entity.MobileContact;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 人员表
|
* 人员表
|
||||||
|
@ -368,4 +369,8 @@ public class TenPersonEntity extends BaseEntity implements Serializable {
|
||||||
private String pvRight;
|
private String pvRight;
|
||||||
private Integer featureType;
|
private Integer featureType;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
@ApiModelProperty("联系人信息")
|
||||||
|
private List<MobileContact> mobileContactList;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,6 @@ package net.shapelight.modules.ten.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.alibaba.excel.EasyExcelFactory;
|
import com.alibaba.excel.EasyExcelFactory;
|
||||||
import com.alibaba.excel.metadata.Sheet;
|
|
||||||
import com.arcsoft.face.FaceInfo;
|
import com.arcsoft.face.FaceInfo;
|
||||||
import com.arcsoft.face.enums.ExtractType;
|
import com.arcsoft.face.enums.ExtractType;
|
||||||
import com.arcsoft.face.toolkit.ImageFactory;
|
import com.arcsoft.face.toolkit.ImageFactory;
|
||||||
|
@ -26,17 +25,18 @@ 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.face.dto.FaceRecognitionResDTO;
|
import net.shapelight.modules.face.dto.FaceRecognitionResDTO;
|
||||||
import net.shapelight.modules.face.service.FaceEngineService;
|
import net.shapelight.modules.face.service.FaceEngineService;
|
||||||
|
import net.shapelight.modules.mobile.entity.MobileContact;
|
||||||
|
import net.shapelight.modules.mobile.service.MobileContactService;
|
||||||
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.entity.SysDictEntity;
|
||||||
import net.shapelight.modules.sys.service.impl.SysDictServiceImpl;
|
import net.shapelight.modules.sys.service.impl.SysDictServiceImpl;
|
||||||
import net.shapelight.modules.ten.dao.TenRelationMapper;
|
import net.shapelight.modules.ten.dao.TenRelationMapper;
|
||||||
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.fegin.OpFeignClient;
|
import net.shapelight.modules.fegin.client.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.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.beans.factory.annotation.Value;
|
||||||
import org.springframework.cache.annotation.CacheEvict;
|
import org.springframework.cache.annotation.CacheEvict;
|
||||||
import org.springframework.cache.annotation.Cacheable;
|
import org.springframework.cache.annotation.Cacheable;
|
||||||
|
@ -107,6 +107,8 @@ public class TenPersonServiceImpl implements TenPersonService {
|
||||||
private FaceEngineService faceEngineService;
|
private FaceEngineService faceEngineService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private TenRelationMapper tenRelationMapper;
|
private TenRelationMapper tenRelationMapper;
|
||||||
|
@Autowired
|
||||||
|
private MobileContactService mobileContactService;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -158,6 +160,9 @@ public class TenPersonServiceImpl implements TenPersonService {
|
||||||
new QueryWrapper<TenPersonExtractEntity>()
|
new QueryWrapper<TenPersonExtractEntity>()
|
||||||
.eq("person_id", personEntity.getPersonId())
|
.eq("person_id", personEntity.getPersonId())
|
||||||
);
|
);
|
||||||
|
List<MobileContact> mobileContacts = mobileContactService.list(new LambdaQueryWrapper<MobileContact>().eq(MobileContact::getPersonId,personEntity.getPersonId()));
|
||||||
|
CustomizeTableNameHandler.removeData();
|
||||||
|
personEntity.setMobileContactList(mobileContacts);
|
||||||
if (extracts != null) {
|
if (extracts != null) {
|
||||||
personEntity.setExtractCount(extracts.size());
|
personEntity.setExtractCount(extracts.size());
|
||||||
personEntity.setExtractList(extracts);
|
personEntity.setExtractList(extracts);
|
||||||
|
@ -174,7 +179,6 @@ public class TenPersonServiceImpl implements TenPersonService {
|
||||||
personEntity.setDeptAllName(deptAllName);
|
personEntity.setDeptAllName(deptAllName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CustomizeTableNameHandler.removeData();
|
|
||||||
}
|
}
|
||||||
return new PageUtils(page);
|
return new PageUtils(page);
|
||||||
}
|
}
|
||||||
|
@ -467,6 +471,14 @@ public class TenPersonServiceImpl implements TenPersonService {
|
||||||
appUser.setCurrentScopeId(appScope.getUserScopeId());
|
appUser.setCurrentScopeId(appScope.getUserScopeId());
|
||||||
appUserService.updateById(appUser);
|
appUserService.updateById(appUser);
|
||||||
}
|
}
|
||||||
|
if (entity.getPersonType().equals(Constant.PERSON_TYPE_OWNER)) {
|
||||||
|
CustomizeTableNameHandler.setData(String.valueOf(entity.getCellId()));
|
||||||
|
entity.getMobileContactList().forEach(item -> {
|
||||||
|
item.setPersonId(entity.getPersonId());
|
||||||
|
});
|
||||||
|
mobileContactService.saveBatch(entity.getMobileContactList());
|
||||||
|
CustomizeTableNameHandler.removeData();
|
||||||
|
}
|
||||||
|
|
||||||
//发送设备通知
|
//发送设备通知
|
||||||
List<TenDeviceVo> devList = tenDeviceService.findByCellId(entity.getCellId());
|
List<TenDeviceVo> devList = tenDeviceService.findByCellId(entity.getCellId());
|
||||||
|
@ -1462,6 +1474,14 @@ public class TenPersonServiceImpl implements TenPersonService {
|
||||||
}
|
}
|
||||||
|
|
||||||
tenPersonDao.updateById(entity);
|
tenPersonDao.updateById(entity);
|
||||||
|
if (entity.getPersonType().equals(Constant.PERSON_TYPE_OWNER)) {
|
||||||
|
CustomizeTableNameHandler.setData(String.valueOf(entity.getCellId()));
|
||||||
|
/* entity.getMobileContactList().forEach(item -> {
|
||||||
|
item.setPersonId(entity.getPersonId());
|
||||||
|
});*/
|
||||||
|
mobileContactService.updateBatchById(entity.getMobileContactList());
|
||||||
|
CustomizeTableNameHandler.removeData();
|
||||||
|
}
|
||||||
//配置同步数据
|
//配置同步数据
|
||||||
List<TenPersonSyncEntity> syncEntitys = tenPersonSyncService.findByPersonId(entity.getPersonId(), entity.getCellId());
|
List<TenPersonSyncEntity> syncEntitys = tenPersonSyncService.findByPersonId(entity.getPersonId(), entity.getCellId());
|
||||||
for (TenPersonSyncEntity syncEn : syncEntitys) {
|
for (TenPersonSyncEntity syncEn : syncEntitys) {
|
||||||
|
@ -1994,7 +2014,7 @@ public class TenPersonServiceImpl implements TenPersonService {
|
||||||
PersonExcelListener listener = new PersonExcelListener(imageFiles, this, this.tenCellDeptService,tenantId);
|
PersonExcelListener listener = new PersonExcelListener(imageFiles, this, this.tenCellDeptService,tenantId);
|
||||||
try {
|
try {
|
||||||
excelStream = new BufferedInputStream(new FileInputStream(excelFileStr));
|
excelStream = new BufferedInputStream(new FileInputStream(excelFileStr));
|
||||||
EasyExcelFactory.readBySax(excelStream, new Sheet(1, 1, PersonModel.class), listener);
|
EasyExcelFactory.read(excelStream,PersonModel.class, listener);
|
||||||
excelStream.close();
|
excelStream.close();
|
||||||
list.addAll(listener.getList());
|
list.addAll(listener.getList());
|
||||||
} catch (Exception exp) {
|
} catch (Exception exp) {
|
||||||
|
|
|
@ -5,7 +5,7 @@ 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.fegin.OpFeignClient;
|
import net.shapelight.modules.fegin.client.OpFeignClient;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.cache.annotation.CacheEvict;
|
import org.springframework.cache.annotation.CacheEvict;
|
||||||
import org.springframework.cache.annotation.Cacheable;
|
import org.springframework.cache.annotation.Cacheable;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package net.shapelight.modules.ten.service.impl;
|
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.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
|
|
@ -141,7 +141,8 @@ config:
|
||||||
version: 4.1
|
version: 4.1
|
||||||
app-id: SUQLGn78W5o7StEEbm6WTTfaMgAxSsN8HwJziApVyNN
|
app-id: SUQLGn78W5o7StEEbm6WTTfaMgAxSsN8HwJziApVyNN
|
||||||
sdk-key: 7dJ9RqEhc3mPCatuUceKjgYwZXfX83n3QHz4xb6biPiG
|
sdk-key: 7dJ9RqEhc3mPCatuUceKjgYwZXfX83n3QHz4xb6biPiG
|
||||||
active-key: 86L1-11TK-313B-Y8KG
|
#active-key: 86L1-11TK-313B-Y8KG
|
||||||
|
active-key: 86L1-11TK-312W-R246
|
||||||
#active-key: 82K1-11TT-K11Y-BHQE
|
#active-key: 82K1-11TT-K11Y-BHQE
|
||||||
active-file:
|
active-file:
|
||||||
detect-pool-size: 16
|
detect-pool-size: 16
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
<?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.mobile.mapper.MobileContactMapper">
|
||||||
|
|
||||||
|
<resultMap id="BaseResultMap" type="net.shapelight.modules.mobile.entity.MobileContact">
|
||||||
|
<id property="contactId" column="contact_id" jdbcType="BIGINT"/>
|
||||||
|
<result property="callName" column="call_name" jdbcType="VARCHAR"/>
|
||||||
|
<result property="mobile" column="mobile" jdbcType="VARCHAR"/>
|
||||||
|
<result property="personId" column="person_id" jdbcType="BIGINT"/>
|
||||||
|
<result property="sort" column="sort" jdbcType="INTEGER"/>
|
||||||
|
<result property="parentId" column="parent_id" jdbcType="BIGINT"/>
|
||||||
|
<result property="bindStatus" column="bind_status" jdbcType="TINYINT"/>
|
||||||
|
<result property="isMain" column="is_main" jdbcType="TINYINT"/>
|
||||||
|
<result property="bindTime" column="bind_time" jdbcType="TIMESTAMP"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
contact_id,call_name,mobile,
|
||||||
|
person_id,sort,parent_id,
|
||||||
|
bind_status,is_main,bind_time
|
||||||
|
</sql>
|
||||||
|
</mapper>
|
|
@ -88,7 +88,7 @@
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<update id="createMobileDevice" parameterType="String">
|
<update id="createMobileDevice" parameterType="String">
|
||||||
create table if not exists `mobile_device_${teantId}` like `mobile_device`;
|
create table if not exists `mobile_device_${tenantId}` like `mobile_device`;
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<select id="queryList" resultMap="tenCellMap">
|
<select id="queryList" resultMap="tenCellMap">
|
||||||
|
|
Loading…
Reference in New Issue