isc集成 开发及修改

This commit is contained in:
haozq 2024-09-07 11:55:57 +08:00
parent 93b0023ac8
commit 23632d13e5
29 changed files with 388 additions and 148 deletions

View File

@ -0,0 +1,54 @@
package com.securitycontrol.auth.controller;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Maps;
import com.securitycontrol.auth.form.IscUserInfo;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.client.ResourceAccessException;
import org.springframework.web.client.RestTemplate;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.Map;
public class IscLoginController {
public static Map<String,String> getUserTicket(String url,String ticket, String model, String accessToken,String loginIndex) {
Map<String,String> map= Maps.newHashMap();
System.out.println("走了ticket=="+ticket);
IscUserInfo user = null;
try {
String userInfo = "";
if (model.equals("xn")) {
userInfo = (new RestTemplate()).getForObject(url + "/serviceValidate" + "?" + "ticket" + "=" + ticket + "&service=" + loginIndex, String.class, new Object[0]);
System.out.println("--------------------------------------------------------------------------------"+userInfo.toString());
} else {
userInfo = (new RestTemplate()).getForObject(url + "/oauth2.0/profile" + "?" + "access_token" + "=" + accessToken, String.class, new Object[0]);
}
if (userInfo.contains("authenticationFailure") || userInfo.contains("error")) {
throw new RuntimeException("ticket或accessToken不正确请重新校验其可用性");
} else {
String cd = URLDecoder.decode(userInfo, "UTF-8");
if (model.equals("xn")) {
cd = cd.substring(cd.indexOf("<cas:user>"), cd.indexOf("</cas:user>"));
cd = cd.replace("<cas:user>", "");
}
user = JSONObject.parseObject(cd, IscUserInfo.class);
// 用户校验
map.put("password","Bonus@admin123");
map.put("username",user.getIscAdCode());
map.put("iscUserId",user.getIscUserId());
map.put("nickName",user.getName());
//验证用户
}
} catch (ResourceAccessException | UnsupportedEncodingException var5) {
map.put("msg","用户登录异常");
throw new RuntimeException("ISC CAS 认证服务连接失败,无法获取用户信息", var5);
}
return map;
}
}

View File

@ -63,40 +63,55 @@ public class TokenController {
private TokenService tokenService;
@Resource
private RedisService redisUtil;
public static String NULL_STRING="null";
@Autowired
private SysLoginService sysLoginService;
@Autowired
private SysRecordLogService recordLogService;
@Value("${isc.appId}")
private String appId;
/**
* 省侧施工大屏
*/
@Value("${isc.sc_web_index}")
public String sc_web_index;
/**
* 后台
*/
@Value("${isc.ht_index}")
public String ht_index;
/**
* 施工
*/
@Value("${isc.sg_wb_index}")
public String sg_wb_index;
@Value("${isc.url}")
public String url;
@PostMapping("login")
public Result<?> login(@RequestBody LoginBody form) {
// String logType=form.getLoginType();
// Map<String,String> map;
// if("1".equals(logType)){
// map=IscLoginController.getUserTicket(url,form.getTicket(),"xn",form.getAccessToken(),sc_web_index);
// }else if("2".equals(logType)){
// map=IscLoginController.getUserTicket(url,form.getTicket(),"xn",form.getAccessToken(),sc_web_index);
// }else{
// map=IscLoginController.getUserTicket(url,form.getTicket(),"xn",form.getAccessToken(),ht_index);
// }
// String username=map.get("username");
// System.err.println("username="+username);
// String password=map.get("password");
// System.err.println("password="+password);
// String iscUserId=map.get("iscUserId");
// System.err.println("iscUserId="+iscUserId);
LoginUser userInfo2 = sysLoginService.login(form.getUsername(),form.getPassword(), form.getLoginType(), null);
// 获取登录token
// userInfo2.setIscUserId(iscUserId);
return Result.ok(tokenService.createToken(userInfo2), "登录成功");
// String osName = System.getProperty("os.name").toLowerCase();
// if (osName.contains("windows")) {
//// LoginUser userInfo2 = sysLoginService.login(form.getUsername(),form.getPassword(), form.getLoginType(), null);
//// // 获取登录token
//// return Result.ok(tokenService.createToken(userInfo2), "登录成功");
// }
// Map<String,Object> map=getIscLogin(form.getUsername(), form.getPassword());
// iscLogin(form.getUsername(), form.getPassword());
// List<SysMenu> menu= (List) map.get("menu");
// String password=map.get("pwd").toString();
// log.info("密码====>{}",password);
// LoginUser userInfo2 = sysLoginService.login(form.getUsername(),password, form.getLoginType(), menu);
// // 获取登录token
// return Result.ok(tokenService.createToken(userInfo2), "登录成功");
}
private Map<String, Object> getIscLogin(String username, String password) {

View File

@ -13,14 +13,29 @@ public class LoginBody{
*/
private String username;
/**
* 票据
*/
private String ticket;
/**
* 用户密码
*/
private String password;
private String accessToken;
@ApiModelProperty("1.省侧大屏 2.施工现场大屏 3.app")
private String loginType;
public String getAccessToken() {
return accessToken;
}
public void setAccessToken(String accessToken) {
this.accessToken = accessToken;
}
public String getUsername()
{
return username;
@ -48,4 +63,12 @@ public class LoginBody{
public void setLoginType(String loginType) {
this.loginType = loginType;
}
public String getTicket() {
return ticket;
}
public void setTicket(String ticket) {
this.ticket = ticket;
}
}

View File

@ -90,27 +90,27 @@ public class SysLoginService
recordLogService.recordLogininfor(username,null,"用户登录","对不起,您的账号:" + username + " 已锁定",1,0,"{'username':'"+username+"'",startTime);
throw new ServiceException("对不起,您的账号:" + username + " 已锁定",201);
}
if(StringHelper.isEmpty(loginType)){
if(!user.getLoginType().contains(Constant.BACK_LOGIN)){
recordLogService.recordLogininfor(username,null,"用户登录","无登录后台权限",1,0,"{'username':'"+username+"'",startTime);
throw new ServiceException("对不起,您的账号:" + username + " 无登录后台权限",201);
}
}else if(Constant.SC_SCREEN.equals(loginType)){
if(!user.getLoginType().contains(Constant.SC_SCREEN)){
recordLogService.recordLogininfor(username,null,"省侧大屏用户登录","无登录省侧大屏权限",1,0,"{'username':'"+username+"'",startTime);
throw new ServiceException("对不起,您的账号:" + username + " 无登录省侧大屏权限",201);
}
}else if(Constant.SG_SCREEN.equals(loginType)){
if(!user.getLoginType().contains(Constant.SG_SCREEN)){
recordLogService.recordLogininfor(username,null,"施工大屏用户登录","无登录施工大屏权限",1,0,"{'username':'"+username+"'",startTime);
throw new ServiceException("对不起,您的账号:" + username + " 无登录施工大屏权限",201);
}
}else if(Constant.APP_LOGIN.equals(loginType)){
if(!user.getLoginType().contains(Constant.APP_LOGIN)){
recordLogService.recordLogininfor(username,null,"APP用户登录","无登录APP权限",1,0,"{'username':'"+username+"'",startTime);
throw new ServiceException("对不起,您的账号:" + username + " 无登录APP权限",201);
}
}
// if(StringHelper.isEmpty(loginType)){
// if(!user.getLoginType().contains(Constant.BACK_LOGIN)){
// recordLogService.recordLogininfor(username,null,"用户登录","无登录后台权限",1,0,"{'username':'"+username+"'",startTime);
// throw new ServiceException("对不起,您的账号:" + username + " 无登录后台权限",201);
// }
// }else if(Constant.SC_SCREEN.equals(loginType)){
// if(!user.getLoginType().contains(Constant.SC_SCREEN)){
// recordLogService.recordLogininfor(username,null,"省侧大屏用户登录","无登录省侧大屏权限",1,0,"{'username':'"+username+"'",startTime);
// throw new ServiceException("对不起,您的账号:" + username + " 无登录省侧大屏权限",201);
// }
// }else if(Constant.SG_SCREEN.equals(loginType)){
// if(!user.getLoginType().contains(Constant.SG_SCREEN)){
// recordLogService.recordLogininfor(username,null,"施工大屏用户登录","无登录施工大屏权限",1,0,"{'username':'"+username+"'",startTime);
// throw new ServiceException("对不起,您的账号:" + username + " 无登录施工大屏权限",201);
// }
// }else if(Constant.APP_LOGIN.equals(loginType)){
// if(!user.getLoginType().contains(Constant.APP_LOGIN)){
// recordLogService.recordLogininfor(username,null,"APP用户登录","无登录APP权限",1,0,"{'username':'"+username+"'",startTime);
// throw new ServiceException("对不起,您的账号:" + username + " 无登录APP权限",201);
// }
// }
passwordService.validate(user, password);
if(ListHelper.isEmpty(list)){
Result<List<SysMenu>> menu = remoteUserService.getAllMenuList(user.getUserId()+"", SecurityConstants.INNER);

View File

@ -14,16 +14,16 @@ spring:
active: dev
cloud:
nacos:
username: nacos
password: Jjsp@nacos2023
discovery:
username: nacos
password: Jjsp@nacos2023
namespace: jjzhgd
# 服务注册地址
#server-addr: 27.50.49.56:21625
server-addr: 127.0.0.1:8848
config:
username: nacos
password: Jjsp@nacos2023
namespace: jjzhgd
config:
namespace: jjzhgd
#server-addr: 27.50.49.56:21625
server-addr: 127.0.0.1:8848
# 配置文件格式
file-extension: yml
@ -34,6 +34,16 @@ spring:
jasypt:
encryptor:
password: Encrypt
#isc:
# appId: 9bb295b78f95350d018fc23d3f284f1f
# url: 10.138.107.32:17002/isc_frontmv_serv/userLoginAuth
isc:
url: http://iscssotest.ah.sgcc.com.cn/isc_sso
#省侧大屏首页
sc_web_index: http://27.50.49.56:21624/zhgd-web/scIndex.html
#施工大屏首页
sg_wb_index: http://27.50.49.56:21624/zhgd-web/sgIndex.html
#后台shouted
ht_index: http://27.50.49.56:21624/zhgd-ht/#/ywgllogin
appId: 9bb295b78f95350d018fc23d3f284f1f
url: 10.138.107.32:17002/isc_frontmv_serv/userLoginAuth
dateUrl: http://10.212.209.109/isc_mp/

View File

@ -77,7 +77,7 @@ public class Constant {
/**人员闸机编码*/
public final static String PERSON_CAR_TYPE = "1907";
/**车辆闸机编码*/
public final static String CAR_GATE = "1911";
public final static String CAR_GATE = "1907";
/**人员闸机检测名称*/
public final static String PERSON = "绑定人";
public final static String CAR = "车牌号";
@ -85,7 +85,10 @@ public class Constant {
public final static String ACCESS_TIME = "出入时间";
public final static String ACCESS_TYPE = "出入类型";
public final static String ACCESS_TYPE_IN = "";
public final static String ACCESS_TYPE_IN2 = "";
public final static String ACCESS_TYPE_OUT = "";
public final static String ACCESS_TYPE_OUT2 = "";
public final static String TYPE = "1";
/**安全帽*/
public final static String AQM = "1804";

View File

@ -65,6 +65,7 @@ public class TokenService {
Map<String, Object> rspMap = new HashMap<String, Object>(50);
String jwtToken=JwtUtils.createToken(claimsMap);
rspMap.put("access_token", jwtToken);
rspMap.put("iscUserId", loginUser.getIscUserId());
rspMap.put("us", JSON.toJSONString(loginUser.getSysUser()));
int time=60*120;
redisService.set("token:"+jwtToken,jwtToken,time);

View File

@ -15,25 +15,24 @@ spring:
active: dev
cloud:
nacos:
username: nacos
password: Jjsp@nacos2023
discovery:
username: nacos
password: Jjsp@nacos2023
namespace: jjzhgd
# 服务注册地址
# server-addr: 27.50.49.56:18848
server-addr: 127.0.0.1:8848
# server-addr: 10.138.225.186:28848
namespace: jjzhgd
config:
# 配置中心地址
# server-addr: 27.50.49.56:18848
server-addr: 127.0.0.1:8848
namespace: jjzhgd
# 配置文件格式
file-extension: yml
#server-addr: 10.145.34.32:8848
# 共享配置
shared-configs:
- vsc-dev.yml
username: nacos
password: Jjsp@nacos2023
namespace: jjzhgd
# server-addr: 10.138.132.188:18848
management:
server:

View File

@ -17,16 +17,13 @@ spring:
active: dev
cloud:
nacos:
username: nacos
password: Jjsp@nacos2023
namespace: jjzhgd
discovery:
username: nacos
password: Jjsp@nacos2023
server-addr: 127.0.0.1:8848
namespace: jjzhgd
server-addr: 27.50.49.56:21625
config:
username: nacos
password: Jjsp@nacos2023
namespace: jjzhgd
server-addr: 127.0.0.1:8848
server-addr: 27.50.49.56:21625
# 配置文件格式
file-extension: yml
# 共享配置

View File

@ -1,5 +1,6 @@
package com.securitycontrol.background.controller;
import com.github.pagehelper.PageInfo;
import com.securitycontrol.background.service.DeviceService;
import com.securitycontrol.common.core.domain.Result;
import com.securitycontrol.common.core.web.controller.BaseController;

View File

@ -182,7 +182,7 @@ public class ExportFileController {
public void exportTodayTaskData(HttpServletRequest request, HttpServletResponse response, TodayTaskDto dto) {
try {
List<TodayTaskExportVo> todayTaskExportVoList = new ArrayList<>();
List<TodayTaskVo> todayTaskVoList = iTodayTaskService.getToDayTaskLists(dto);
List<TodayTaskVo> todayTaskVoList = iTodayTaskService.getToDayTaskListsExport(dto);
for (int i = 0; i < todayTaskVoList.size(); i++) {
todayTaskVoList.get(i).setClassId((i + 1) + "");
TodayTaskExportVo todayTaskExportVo = new TodayTaskExportVo();

View File

@ -1,5 +1,6 @@
package com.securitycontrol.background.controller;
import com.github.pagehelper.PageInfo;
import com.securitycontrol.background.service.ITodayTaskService;
import com.securitycontrol.common.core.web.controller.BaseController;
import com.securitycontrol.common.core.web.domain.AjaxResult;
@ -7,6 +8,7 @@ import com.securitycontrol.common.core.web.page.TableDataInfo;
import com.securitycontrol.common.log.annotation.Log;
import com.securitycontrol.common.log.enums.OperationType;
import com.securitycontrol.entity.background.dto.TodayTaskDto;
import com.securitycontrol.entity.background.vo.DeviceVo;
import com.securitycontrol.entity.background.vo.TodayTaskVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
@ -34,8 +36,7 @@ public class TodayTaskController extends BaseController {
@Log(title = "风险值班管理", menu = "风险值班管理->当日任务", grade = OperationType.QUERY_BUSINESS, details = "查询班组", type = "业务日志")
public TableDataInfo getToDayTaskLists(TodayTaskDto dto) {
startPage();
List<TodayTaskVo> list = service.getToDayTaskLists(dto);
return getDataTable(list);
return service.getToDayTaskLists(dto);
}
@ApiOperation(value = "远程巡视详情")

View File

@ -200,4 +200,11 @@ public interface HumanManageMapper {
* @date 2024/4/19 16:01
*/
String getUserBingCup(@Param("params") HumanManageVo vo,@Param("typeCode")String typeCode);
/**
* 人员进出记录
* @param dto
* @return
*/
List<UserAccessVo> getUserAccessList(ParamDto dto);
}

View File

@ -60,4 +60,11 @@ public interface VehicleMapper {
* @date 2024/4/18 11:00
*/
String getCarAccessLists(String value);
/**
* 车辆荆楚记录
* @param dto
* @return
*/
List<VehicleVo> getCardAccess(VehicleVo dto);
}

View File

@ -1,6 +1,7 @@
package com.securitycontrol.background.service;
import com.securitycontrol.common.core.web.domain.AjaxResult;
import com.securitycontrol.common.core.web.page.TableDataInfo;
import com.securitycontrol.entity.background.dto.TodayTaskDto;
import com.securitycontrol.entity.background.vo.TodayTaskVo;
@ -22,7 +23,7 @@ public interface ITodayTaskService {
* @author cwchen
* @date 2024/3/23 13:21
*/
List<TodayTaskVo> getToDayTaskLists(TodayTaskDto dto);
TableDataInfo getToDayTaskLists(TodayTaskDto dto);
/**
* 远程巡视详情
@ -44,4 +45,6 @@ public interface ITodayTaskService {
* @date 2024/3/23 16:40
*/
AjaxResult getBallTimeList(TodayTaskDto dto);
List<TodayTaskVo> getToDayTaskListsExport(TodayTaskDto dto);
}

View File

@ -266,29 +266,31 @@ public class HumanServiceImpl implements HumanService {
@Override
public List<UserAccessVo> getPersonnelAccessLists(ParamDto dto) {
List<UserAccessVo> list = new ArrayList<>();
try {
dto.setTypeCode(Constant.PERSON_CAR_TYPE);
dto.setModeName(Constant.PERSON);
UserAccessVo userDetail = mapper.getUserDeatail(dto);
String decryptIdNumber = AesCbcUtils.decrypt(userDetail.getIdNumber());
if(decryptIdNumber != null){
userDetail.setIdNumber(decryptIdNumber);
}
list = mapper.getPersonnelAccessLists(dto);
for (UserAccessVo vo : list) {
String value = vo.getValue();
vo.setIdNumber(userDetail.getIdNumber());
vo.setUserPhone(userDetail.getUserPhone());
vo.setUserName(userDetail.getUserName());
String data = mapper.getUserAccessLists(value);
if(StringUtils.isNotEmpty(data)){
String[] dataArr = data.split(",");
setUserAccessData(vo,dataArr);
}
}
} catch (Exception e) {
log.error(e.toString(),e);
}
list=mapper.getUserAccessList(dto);
// try {
// dto.setTypeCode(Constant.PERSON_CAR_TYPE);
// dto.setModeName(Constant.PERSON);
// UserAccessVo userDetail = mapper.getUserDeatail(dto);
// String decryptIdNumber = AesCbcUtils.decrypt(userDetail.getIdNumber());
// if(decryptIdNumber != null){
// userDetail.setIdNumber(decryptIdNumber);
// }
// list = mapper.getPersonnelAccessLists(dto);
// for (UserAccessVo vo : list) {
// String value = vo.getValue();
// vo.setIdNumber(userDetail.getIdNumber());
// vo.setUserPhone(userDetail.getUserPhone());
// vo.setUserName(userDetail.getUserName());
// String data = mapper.getUserAccessLists(value);
// if(StringUtils.isNotEmpty(data)){
// String[] dataArr = data.split(",");
// setUserAccessData(vo,dataArr);
// }
// }
// } catch (Exception e) {
// log.error(e.toString(),e);
// }
return list;
}

View File

@ -292,7 +292,7 @@ public class TbAreaServiceImpl implements TbAreaService {
Result result1 = remoteFileService.mostUploadFile(files,SecurityConstants.INNER);
if(result1.getCode()!=SystemGlobal.SUCCESS_CODE){
mapper.deleteData(dto);
Result.fail("文件服务未连接,文件上传失败");
return Result.fail("文件服务未连接,文件上传失败");
}
List<Object> list= (List<Object>) result1.getData();
Result<String> result2= sourceFileService.addSourceList(list, dto.getId(),"三维文件","0");

View File

@ -1,10 +1,13 @@
package com.securitycontrol.background.service.impl;
import com.github.pagehelper.PageInfo;
import com.securitycontrol.background.mapper.ITodayTaskMapper;
import com.securitycontrol.background.service.ITodayTaskService;
import com.securitycontrol.common.core.constant.HttpStatus;
import com.securitycontrol.common.core.utils.aes.DateTimeHelper;
import com.securitycontrol.common.core.utils.aes.StringHelper;
import com.securitycontrol.common.core.web.domain.AjaxResult;
import com.securitycontrol.common.core.web.page.TableDataInfo;
import com.securitycontrol.entity.background.dto.TodayTaskDto;
import com.securitycontrol.entity.background.vo.DeviceUpDownVo;
import com.securitycontrol.entity.background.vo.TodayTaskVo;
@ -35,7 +38,42 @@ public class TodayTaskServiceImpl implements ITodayTaskService {
private ThreadPoolTaskExecutor testTaskExecutor;
@Override
public List<TodayTaskVo> getToDayTaskLists(TodayTaskDto dto) {
public TableDataInfo getToDayTaskLists(TodayTaskDto dto) {
// 多线程执行操作存放的数据集合
List<TodayTaskVo> list = new ArrayList<>();
List<Future> futureList = new ArrayList<>();
List<TodayTaskVo> newList = new ArrayList<>();
try {
dto = handleParams(dto);
list = mapper.getToDayTaskLists(dto);
for (TodayTaskVo todayTaskVo : list) {
Future<TodayTaskVo> future = testTaskExecutor.submit(new Callable<TodayTaskVo>() {
@Override
public TodayTaskVo call() throws Exception {
// 查询督查人
String checkUserName = mapper.getCheckUser(todayTaskVo.getCheckUserId());
todayTaskVo.setCheckUserName(checkUserName);
return todayTaskVo;
}
});
futureList.add(future);
}
for (Future<TodayTaskVo> future : futureList) {
TodayTaskVo todayTaskVo = future.get();
newList.add(todayTaskVo);
}
} catch (Exception e) {
log.error("获取当日任务列表", e);
}
TableDataInfo rspData = new TableDataInfo();
rspData.setCode(HttpStatus.SUCCESS);
rspData.setRows(newList);
rspData.setMsg("查询成功");
rspData.setTotal(new PageInfo(list).getTotal());
return rspData;
}
@Override
public List<TodayTaskVo> getToDayTaskListsExport(TodayTaskDto dto) {
// 多线程执行操作存放的数据集合
List<Future> futureList = new ArrayList<>();
List<TodayTaskVo> newList = new ArrayList<>();

View File

@ -95,28 +95,33 @@ public class VehicleServiceImpl implements VehicleService {
@Override
public List<VehicleVo> getLists(VehicleVo dto) {
List<VehicleVo> list = new ArrayList<>();
String date = dto.getDate();
if (!StringUtils.isEmpty(date)) {
String[] arr = date.split("@");
dto.setStartDate(arr[0]);
dto.setEndDate(arr[1]);
}
try {
dto.setTypeCode(Constant.CAR_GATE);
dto.setModeName(Constant.CAR);
list = mapper.getLists(dto);
for (VehicleVo vo : list) {
String value = vo.getValue();
String data = mapper.getCarAccessLists(value);
if(StringUtils.isNotEmpty(data)){
String[] dataArr = data.split(",");
setCarAccessData(vo,dataArr);
}
}
} catch (Exception e) {
log.error("获取进出场记录列表",e);
}
list=mapper.getCardAccess(dto);
// List<VehicleVo> list = new ArrayList<>();
// String date = dto.getDate();
// if (!StringUtils.isEmpty(date)) {
// String[] arr = date.split("@");
// dto.setStartDate(arr[0]);
// dto.setEndDate(arr[1]);
// }
// try {
// dto.setTypeCode(Constant.CAR_GATE);
// dto.setModeName(Constant.CAR);
// list = mapper.getLists(dto);
// for (VehicleVo vo : list) {
// String value = vo.getValue();
// String data = mapper.getCarAccessLists(value);
// if(StringUtils.isNotEmpty(data)){
// String[] dataArr = data.split(",");
// setCarAccessData(vo,dataArr);
// }
// }
// } catch (Exception e) {
// log.error("获取进出场记录列表",e);
// }
return list;
}

View File

@ -17,16 +17,16 @@ spring:
active: dev
cloud:
nacos:
username: nacos
password: Jjsp@nacos2023
discovery:
# server-addr: 27.50.49.56:18848
server-addr: 127.0.0.1:8848
namespace: jjzhgd
username: nacos
password: ENC(xLup+kLqCG2IPXSawqFfeqJAy3BwMz/ElXZNia2uutPwbjfjEUrhqyO4RRV6TAob)
config:
# server-addr: 27.50.49.56:18848
server-addr: 127.0.0.1:8848
namespace: jjzhgd
username: nacos
password: ENC(xLup+kLqCG2IPXSawqFfeqJAy3BwMz/ElXZNia2uutPwbjfjEUrhqyO4RRV6TAob)
# 配置文件格式
file-extension: yml
# 共享配置

View File

@ -154,6 +154,15 @@
</if>
WHERE tbd.devic_type = #{typeCode} AND tdd.mode_name = #{modeName} AND tbd.del_flag = 0
</select>
<select id="getUserAccessList" resultType="com.securitycontrol.entity.background.vo.UserAccessVo">
select id_number idNumber,access_time accessTime,user_name userName,user_phone userPhone,user_id userId,
case WHEN access_type= '0' then '进场' ELSE '出场' end accessType
from tb_user_access
where user_id=#{id}
<if test="startTime!=null and startTime!='' and endTime!=null and endTime!=''">
AND access_time BETWEEN CONCAT(#{startTime},' 00:00:00') AND CONCAT(#{endTime},' 23:59:59')
</if>
</select>
<select id="getBindHis" resultType="java.lang.Integer">
select count(1)
from tb_user_bind_cap
@ -202,4 +211,5 @@
LEFT JOIN tb_device td ON tubc.device_id = td.device_id AND td.device_type = #{typeCode}
WHERE tubc.people_id = #{params.userId} AND tubc.bind_status = '1'
</select>
</mapper>

View File

@ -20,6 +20,7 @@
</select>
<select id="getLists" resultType="com.securitycontrol.entity.background.vo.VehicleVo">
SELECT thdv.source_type AS value
FROM tb_bd_device tbd
INNER JOIN tb_device_detail tdd ON tbd.device_id = tdd.device_id AND tdd.del_flag = 0
@ -30,7 +31,15 @@
INNER JOIN tb_car tc ON tc.car_num = thdv.val AND tc.id = #{id}
WHERE tbd.devic_type = #{typeCode} AND tdd.mode_name = #{modeName} AND tbd.del_flag = 0
</select>
<select id="getCardAccess" resultType="com.securitycontrol.entity.background.vo.VehicleVo">
SELECT accesss_time accesssTime,
CASE access_type WHEN '1' THEN '进' WHEN '0' THEN '出' END AS accessType
from tb_car_access
where car_id=#{id}
<if test="startDate!=null and startDate!='' and endDate!=null and endDate!=''">
AND accesss_time BETWEEN CONCAT(#{startDate},' 00:00:00') AND CONCAT(#{endDate},' 23:59:59')
</if>
</select>
<select id="getListsDto" resultType="com.securitycontrol.entity.background.dto.VehicleDto">
SELECT accesss_time as accesssTime,car_num as carNum,
case WHEN access_type= '0' then '入场' ELSE '出场' end accessType
@ -49,6 +58,7 @@
GROUP BY thdv.source_type
</select>
<!--新增/修改-->
<insert id="addOrUpdateVehicle">
<if test="type == 1">

View File

@ -16,16 +16,15 @@ spring:
active: dev
cloud:
nacos:
namespace: jjzhgd
username: nacos
password: Jjsp@nacos2023
discovery:
server-addr: 127.0.0.1:8848
namespace: jjzhgd
username: nacos
password: Jjsp@nacos2023
# server-addr: 27.50.49.56:21625
config:
server-addr: 127.0.0.1:8848
namespace: jjzhgd
username: nacos
password: Jjsp@nacos2023
# server-addr: 27.50.49.56:21625
# 配置文件格式
file-extension: yml
# 共享配置

View File

@ -37,12 +37,12 @@ public class VscScreenApplication implements CommandLineRunner {
@Resource
private StringEncryptor encryptor;
@Autowired
private ApplicationContext applicationContext;
@Override
public void run(String... args) throws Exception {
String nacos = encrypt("Jjsp@nacos2023" );
String mysql = encrypt("bonus@admin123" );
String mogodb = encrypt("Bonus@admin123!" );
System.out.println( "mysql原始明文密码加密后的结果为" + mysql );
System.out.println( "nacos原始明文密码加密后的结果为" + nacos );
System.out.println( "mogodb原始明文密码加密后的结果为" + mogodb );

View File

@ -47,4 +47,17 @@ public interface AccessMgeMapper {
*/
List<AccessMgeVo> getPerStatisticsList(AccessMgeDto dto);
/**
* 查询车辆下拉选
* @param dto
* @return
*/
List<AccessMgeVo> getCardList(AccessMgeDto dto);
/**
* 人员出入记录
* @param dto
* @return
*/
List<AccessMgeVo> getUserList(AccessMgeDto dto);
}

View File

@ -176,13 +176,16 @@ public class AccessMgeServiceImpl implements AccessMgeService {
// type 1.车辆 2.人员
List<AccessMgeVo> list = new ArrayList<>();
try {
dto.setTypeCode(Objects.equals(Constant.TYPE, type) ? Constant.CAR_GATE : Constant.PERSON_CAR_TYPE);
dto.setModeName(Objects.equals(Constant.TYPE, type) ? Constant.CAR : Constant.PERSON);
if (StringHelper.isEmpty(dto.getStartDate())) {
dto.setStartDate(DateTimeHelper.getNowDate());
dto.setEndDate(DateTimeHelper.getNowDate());
}
list = Objects.equals(Constant.TYPE, type) ? mapper.getVehicleStatisticsList(dto) : mapper.getPerStatisticsList(dto);
// dto.setTypeCode(Objects.equals(Constant.TYPE, type) ? Constant.CAR_GATE : Constant.PERSON_CAR_TYPE);
// dto.setModeName(Objects.equals(Constant.TYPE, type) ? Constant.CAR : Constant.PERSON);
// if (StringHelper.isEmpty(dto.getStartDate())) {
// dto.setStartDate(DateTimeHelper.getNowDate());
// dto.setEndDate(DateTimeHelper.getNowDate());
// }
// list = Objects.equals(Constant.TYPE, type) ? mapper.getVehicleStatisticsList(dto) : mapper.getPerStatisticsList(dto);
list = Objects.equals(Constant.TYPE, type) ? mapper.getCardList(dto) : mapper.getUserList(dto);
} catch (Exception e) {
log.error(Objects.equals(Constant.TYPE, type) ? "获取车辆出入场记录" : "获取人员出入场记录", e);
}
@ -201,7 +204,8 @@ public class AccessMgeServiceImpl implements AccessMgeService {
dto.setStartDate(dateArr[0]);
dto.setEndDate(dateArr[1]);
AccessMgeVo vo = new AccessMgeVo();
list = Objects.equals(Constant.TYPE, type) ? mapper.getVehicleStatisticsList(dto) : mapper.getPerStatisticsList(dto);
list = Objects.equals(Constant.TYPE, type) ? mapper.getCardList(dto) : mapper.getUserList(dto);
// list = Objects.equals(Constant.TYPE, type) ? mapper.getVehicleStatisticsList(dto) : mapper.getPerStatisticsList(dto);
// 今日入 今日出 当月入 当月出
int jtrNum = 0, jrcNum = 0, dyrNum = 0, dycNum = 0;
for (AccessMgeVo mgeVo : list) {

View File

@ -17,17 +17,17 @@ spring:
active: dev
cloud:
nacos:
username: nacos
password: ENC(WEXrSAwB34//rIMP9XgKly1MKnwitpClyMfZuVheQhyn3FwbNJXJ60M3N8Z6QlXr)
discovery:
# server-addr: 27.50.49.56:21625
server-addr: 127.0.0.1:8848
namespace: jjzhgd
username: nacos
password: Jjsp@nacos2023
config:
# server-addr: 27.50.49.56:21625
server-addr: 127.0.0.1:8848
namespace: jjzhgd
username: nacos
password: Jjsp@nacos2023
# 配置文件格式
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:

View File

@ -21,7 +21,8 @@
<!--车辆出入场记录-->
<select id="getVehicleStatisticsList" resultType="com.securitycontrol.entity.screen.vo.AccessMgeVo">
SELECT r.proName,r.accessTime AS accesssTime,r.carNum,r.accessType,tc.user_name AS userName,tc.phone
SELECT any_value(r.proName) proName,any_value(r.accessTime) AS accesssTime,any_value(r.carNum) carNum,any_value(r.accessType) accessType,
any_value(tc.user_name) AS userName,any_value(tc.phone) phone,r.source_type
FROM (
SELECT thdv.val,tp.pro_name AS proName,thdv.source_type,a.val AS accessTime,b.val AS carNum,c.val AS accessType
FROM tb_his_device_value thdv
@ -62,7 +63,7 @@
</if>
</where>
GROUP BY r.source_type
ORDER BY r.accessTime DESC
</select>
<!--人员出入照片-->
@ -87,7 +88,9 @@
<!--人员出入场记录-->
<select id="getPerStatisticsList" resultType="com.securitycontrol.entity.screen.vo.AccessMgeVo">
SELECT r.proName,r.accessTime AS accesssTime,r.personName AS userName,r.image,r.type AS accessType
SELECT any_value(r.proName) proName,any_value(r.accessTime) AS accesssTime,
any_value(r.personName) AS userName,any_value(r.image) image,
any_value(r.type) AS accessType,r.source_type
FROM (
SELECT tp.pro_name AS proName,thdv.source_type,a.val AS accessTime,b.val AS personName,c.val AS image,d.val AS type
FROM tb_his_device_value thdv
@ -134,6 +137,41 @@
</if>
</where>
GROUP BY r.source_type
ORDER BY r.accessTime DESC
</select>
<select id="getCardList" resultType="com.securitycontrol.entity.screen.vo.AccessMgeVo">
SELECT tca.accesss_time accesssTime,tca.car_num carNum,car.user_name userName ,car.phone,pro.pro_name proName,
CASE tca.access_type WHEN '1' THEN '进' WHEN '0' THEN '出' END AS accessType
from tb_car_access tca
left join tb_car car on car.id=tca.car_id
LEFT JOIN tb_project pro on pro.bid_code=car.bid_code
WHERE car.bid_code = #{bidCode}
<if test="startDate!=null and startDate!='' and endDate!=null and endDate!=''">
AND tca.accesss_time BETWEEN CONCAT(#{startDate},' 00:00:00') AND CONCAT(#{endDate},' 23:59:59')
</if>
<if test="proName!=null and proName!=''">
AND INSTR(pro.pro_name,#{proName}) > 0
</if>
<if test="carNum!=null and carNum!=''">
AND INSTR(car.car_num,#{carNum}) > 0
</if>
</select>
<select id="getUserList" resultType="com.securitycontrol.entity.screen.vo.AccessMgeVo">
select tua.id_number idNumber,tua.access_time accesssTime,tua.user_name userName,tua.user_phone userPhone,tua.user_id userId,
case WHEN access_type= '0' then '入' ELSE '出' end accessType,
pro.pro_name proName ,ttp.phone
from tb_user_access tua
left join t_team_people ttp on ttp.user_id=tua.user_id
LEFT JOIN tb_work_team twt on twt.team_id=ttp.team_id
left join tb_project pro on pro.bid_code=twt.bid_code
WHERE pro.bid_code = #{bidCode}
<if test="startDate!=null and startDate!='' and endDate!=null and endDate!=''">
AND tua.access_time BETWEEN CONCAT(#{startDate},' 00:00:00') AND CONCAT(#{endDate},' 23:59:59')
</if>
<if test="userName!=null and userName!=''">
AND INSTR(tua.user_name,#{userName}) > 0
</if>
<if test="proName!=null and proName!=''">
AND INSTR(pro.pro_name,#{proName}) > 0
</if>
</select>
</mapper>

View File

@ -17,15 +17,15 @@ spring:
active: dev
cloud:
nacos:
username: nacos
password: Jjsp@nacos2023
discovery:
# server-addr: 27.50.49.56:21625
server-addr: 127.0.0.1:8848
username: nacos
password: Jjsp@nacos2023
namespace: jjzhgd
config:
# server-addr: 27.50.49.56:21625
server-addr: 127.0.0.1:8848
username: nacos
password: Jjsp@nacos2023
namespace: jjzhgd
# 配置文件格式
file-extension: yml