修改 数据接口
This commit is contained in:
parent
bf7f5dc8dc
commit
43dd033ab8
|
|
@ -68,6 +68,15 @@ public class LoginUser implements Serializable
|
||||||
* */
|
* */
|
||||||
private String iscUserId;
|
private String iscUserId;
|
||||||
|
|
||||||
|
private String test;
|
||||||
|
|
||||||
|
public String getTest() {
|
||||||
|
return test;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTest(String test) {
|
||||||
|
this.test = test;
|
||||||
|
}
|
||||||
|
|
||||||
public static long getserialversionuid() {
|
public static long getserialversionuid() {
|
||||||
return serialVersionUID;
|
return serialVersionUID;
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,26 @@
|
||||||
<artifactId>isc_sm_agent</artifactId>
|
<artifactId>isc_sm_agent</artifactId>
|
||||||
<version>1.0</version>
|
<version>1.0</version>
|
||||||
<scope>system</scope>
|
<scope>system</scope>
|
||||||
<systemPath>${project.basedir}/libs/isc_sm_agent-1.0.jar</systemPath>
|
<systemPath>${project.basedir}/libs/isc_sm_agent-2.0.jar</systemPath>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>gson</groupId>
|
||||||
|
<artifactId>gson</artifactId>
|
||||||
|
<version>1.0</version>
|
||||||
|
<scope>system</scope>
|
||||||
|
<systemPath>${project.basedir}/libs/gson-2.6.2.jar</systemPath>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-lang</groupId>
|
||||||
|
<artifactId>commons-lang</artifactId>
|
||||||
|
<version>2.1</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>json</groupId>
|
||||||
|
<artifactId>json</artifactId>
|
||||||
|
<version>1.0</version>
|
||||||
|
<scope>system</scope>
|
||||||
|
<systemPath>${project.basedir}/libs/json-20220320.jar</systemPath>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.thoughtworks.xstream</groupId>
|
<groupId>com.thoughtworks.xstream</groupId>
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
package com.securitycontrol.auth.controller;
|
package com.securitycontrol.auth.controller;
|
||||||
|
|
||||||
|
|
||||||
import cn.hutool.http.HttpResponse;
|
|
||||||
import cn.hutool.http.HttpUtil;
|
|
||||||
import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import com.securitycontrol.auth.form.LoginBody;
|
import com.securitycontrol.auth.form.LoginBody;
|
||||||
import com.securitycontrol.auth.service.SysLoginService;
|
import com.securitycontrol.auth.service.SysLoginService;
|
||||||
|
|
@ -12,13 +10,18 @@ import com.securitycontrol.common.core.constant.Constant;
|
||||||
import com.securitycontrol.common.core.constant.SecurityConstants;
|
import com.securitycontrol.common.core.constant.SecurityConstants;
|
||||||
import com.securitycontrol.common.core.domain.Result;
|
import com.securitycontrol.common.core.domain.Result;
|
||||||
import com.securitycontrol.common.core.utils.JwtUtils;
|
import com.securitycontrol.common.core.utils.JwtUtils;
|
||||||
|
import com.securitycontrol.common.core.utils.aes.ListHelper;
|
||||||
import com.securitycontrol.common.core.utils.aes.StringHelper;
|
import com.securitycontrol.common.core.utils.aes.StringHelper;
|
||||||
import com.securitycontrol.common.redis.service.RedisService;
|
import com.securitycontrol.common.redis.service.RedisService;
|
||||||
import com.securitycontrol.common.security.service.TokenService;
|
import com.securitycontrol.common.security.service.TokenService;
|
||||||
import com.securitycontrol.common.security.utils.SecurityUtils;
|
import com.securitycontrol.common.security.utils.SecurityUtils;
|
||||||
import com.securitycontrol.system.api.domain.decision.SysMenu;
|
import com.securitycontrol.system.api.domain.decision.SysMenu;
|
||||||
import com.securitycontrol.system.api.model.LoginUser;
|
import com.securitycontrol.system.api.model.LoginUser;
|
||||||
|
import com.sgcc.isc.core.orm.complex.FunctionNode;
|
||||||
|
import com.sgcc.isc.core.orm.complex.FunctionTree;
|
||||||
import com.sgcc.isc.core.orm.identity.User;
|
import com.sgcc.isc.core.orm.identity.User;
|
||||||
|
import com.sgcc.isc.core.orm.resource.Function;
|
||||||
|
import com.sgcc.isc.core.orm.role.Role;
|
||||||
import com.sgcc.isc.framework.common.constant.Constants;
|
import com.sgcc.isc.framework.common.constant.Constants;
|
||||||
import com.sgcc.isc.service.adapter.factory.AdapterFactory;
|
import com.sgcc.isc.service.adapter.factory.AdapterFactory;
|
||||||
import com.sgcc.isc.service.adapter.helper.IIdentityService;
|
import com.sgcc.isc.service.adapter.helper.IIdentityService;
|
||||||
|
|
@ -27,18 +30,18 @@ import io.jsonwebtoken.Claims;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.logging.log4j.util.Base64Util;
|
|
||||||
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.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
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.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import org.springframework.web.client.RestTemplate;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.awt.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -63,37 +66,43 @@ public class TokenController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysRecordLogService recordLogService;
|
private SysRecordLogService recordLogService;
|
||||||
|
|
||||||
|
|
||||||
@Value("${isc.url}")
|
|
||||||
private String url;
|
|
||||||
|
|
||||||
@Value("${isc.appId}")
|
@Value("${isc.appId}")
|
||||||
private String appId;
|
private String appId;
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("login")
|
@PostMapping("login")
|
||||||
public Result<?> login(@RequestBody LoginBody form) {
|
public Result<?> login(@RequestBody LoginBody form) {
|
||||||
// Map<String,Object> map=getIscLogin(form.getUsername(), form.getPassword());
|
|
||||||
LoginUser userInfo = sysLoginService.login(form.getUsername(), form.getPassword(), form.getLoginType(), null);
|
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());
|
||||||
|
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
|
// 获取登录token
|
||||||
return Result.ok(tokenService.createToken(userInfo), "登录成功");
|
return Result.ok(tokenService.createToken(userInfo2), "登录成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map<String, Object> getIscLogin(String username, String password) {
|
private Map<String, Object> getIscLogin(String username, String password) {
|
||||||
Map<String,Object> map= Maps.newHashMap();
|
Map<String,Object> map= Maps.newHashMap();
|
||||||
Boolean isLogin=false;
|
|
||||||
try{
|
try{
|
||||||
System.err.println(3);
|
IIdentityService service=(IIdentityService)AdapterFactory.getInstance(Constants.CLASS_IDENTITY);
|
||||||
IIdentityService service=(IIdentityService )AdapterFactory.getInstance(Constants.CLASS_IDENTITY);
|
IResourceService iResourceService=(IResourceService)AdapterFactory.getInstance(Constants.CLASS_RESOURCE);
|
||||||
User user=service.userLoginAuth(username,password);
|
User user=service.userLoginAuth(username,password);
|
||||||
log.info(user.getId());
|
FunctionTree tree= iResourceService.getFuncTree(user.getId(),"9bb295b78f95350d018fc23d3f284f1f","");
|
||||||
log.info("user--->{}", user);
|
log.info("有菜单数据了--->{}",tree);
|
||||||
log.info(user.toString());
|
List<SysMenu> menus= getMenuList(tree);
|
||||||
HashMap<String,List> maps=service.getObjectsByUserId(user.getId(),appId);
|
log.info("草段全部获取成功====>{}",tree);
|
||||||
for (Map.Entry<String, List> entry : maps.entrySet()) {
|
log.info("菜单数据---->{}",menus.toArray());
|
||||||
System.out.println("Key = " + entry.getKey());
|
map.put("menu",menus);
|
||||||
log.info("list--->{}", entry.getValue());
|
map.put("isL","true");
|
||||||
}
|
map.put("pwd","Bonus@admin123");
|
||||||
|
map.put("loginName",username);
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
map.put("menu",new ArrayList<>());
|
map.put("menu",new ArrayList<>());
|
||||||
map.put("isL","false");
|
map.put("isL","false");
|
||||||
|
|
@ -104,7 +113,48 @@ public class TokenController {
|
||||||
return map;
|
return map;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
public List<SysMenu> getMenuList( FunctionTree tree){
|
||||||
|
List<SysMenu> list = new ArrayList<SysMenu>();
|
||||||
|
try{
|
||||||
|
List<FunctionNode> nodeList=tree.getFuncNode();
|
||||||
|
log.info("nodeList--->{}",nodeList);
|
||||||
|
nodeList.forEach((value) -> {
|
||||||
|
log.info("数据展示value -->{}",value);
|
||||||
|
SysMenu menu = new SysMenu();
|
||||||
|
List<SysMenu> menuChilders = new ArrayList<>();
|
||||||
|
Function currentNode = value.getCurrentNode();
|
||||||
|
menu.setMenuId(currentNode.getId());
|
||||||
|
menu.setMenuName(currentNode.getName());
|
||||||
|
menu.setMenuAuth(currentNode.getBusiCode());
|
||||||
|
String url = currentNode.getUrl();
|
||||||
|
menu.setUrl(url);
|
||||||
|
menu.setIcon("chart");
|
||||||
|
List<FunctionNode> nextNode = value.getNextNode();
|
||||||
|
menu.setLast(ListHelper.isEmpty(nextNode));
|
||||||
|
log.info("nextNode----->{}",nextNode);
|
||||||
|
nextNode.forEach(functionNode->{
|
||||||
|
log.info("functionNode----->{}",functionNode);
|
||||||
|
SysMenu menuChilder = new SysMenu();
|
||||||
|
Function currentNodeChilder = functionNode.getCurrentNode();
|
||||||
|
log.info("currentNodeChilder----->{}",currentNodeChilder);
|
||||||
|
String funType = currentNodeChilder.getFuncType();
|
||||||
|
System.err.println(funType);
|
||||||
|
menuChilder.setMenuAuth(currentNodeChilder.getBusiCode());
|
||||||
|
menuChilder.setMenuId(currentNodeChilder.getId());
|
||||||
|
menuChilder.setMenuName(currentNodeChilder.getName());
|
||||||
|
menuChilder.setUrl(currentNodeChilder.getUrl());
|
||||||
|
menuChilder.setLast(true);
|
||||||
|
menuChilders.add(menuChilder);
|
||||||
|
});
|
||||||
|
menu.setChilder(menuChilders);
|
||||||
|
list.add(menu);
|
||||||
|
});
|
||||||
|
log.info("nodeList--->{}",list);
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error(e.toString(),e);
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import com.securitycontrol.common.core.enums.UserStatus;
|
||||||
import com.securitycontrol.common.core.exception.ServiceException;
|
import com.securitycontrol.common.core.exception.ServiceException;
|
||||||
import com.securitycontrol.common.core.utils.ServletUtils;
|
import com.securitycontrol.common.core.utils.ServletUtils;
|
||||||
import com.securitycontrol.common.core.utils.StringUtils;
|
import com.securitycontrol.common.core.utils.StringUtils;
|
||||||
|
import com.securitycontrol.common.core.utils.aes.ListHelper;
|
||||||
import com.securitycontrol.common.core.utils.aes.StringHelper;
|
import com.securitycontrol.common.core.utils.aes.StringHelper;
|
||||||
import com.securitycontrol.common.core.utils.ip.IpUtils;
|
import com.securitycontrol.common.core.utils.ip.IpUtils;
|
||||||
import com.securitycontrol.common.redis.service.RedisService;
|
import com.securitycontrol.common.redis.service.RedisService;
|
||||||
|
|
@ -111,8 +112,12 @@ public class SysLoginService
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
passwordService.validate(user, password);
|
passwordService.validate(user, password);
|
||||||
Result<List<SysMenu>> menu = remoteUserService.getAllMenuList(user.getUserId()+"", SecurityConstants.INNER);
|
if(ListHelper.isEmpty(list)){
|
||||||
list = handleMenuList(menu.getData(),loginType);
|
Result<List<SysMenu>> menu = remoteUserService.getAllMenuList(user.getUserId()+"", SecurityConstants.INNER);
|
||||||
|
list = handleMenuList(menu.getData(),loginType);
|
||||||
|
}else{
|
||||||
|
list = handleMenuList(list,loginType);
|
||||||
|
}
|
||||||
user.setJumpType(loginType);
|
user.setJumpType(loginType);
|
||||||
userInfo.getSysUser().setMenus(list);
|
userInfo.getSysUser().setMenus(list);
|
||||||
String hisIp=redisUtil.getVal(username);
|
String hisIp=redisUtil.getVal(username);
|
||||||
|
|
|
||||||
|
|
@ -99,6 +99,10 @@ public class SystemGlobal {
|
||||||
|
|
||||||
public final static String TEXT_FIX=".text";
|
public final static String TEXT_FIX=".text";
|
||||||
|
|
||||||
|
public final static String IMAGE_BAST64_SUX="data:image/jpg;base64,";
|
||||||
|
|
||||||
|
|
||||||
|
public final static String IMAGE_ID="image";
|
||||||
/**
|
/**
|
||||||
* 环境监测编码
|
* 环境监测编码
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -96,6 +96,11 @@
|
||||||
<groupId>com.securitycontrol</groupId>
|
<groupId>com.securitycontrol</groupId>
|
||||||
<artifactId>securitycontrol-commons-entity</artifactId>
|
<artifactId>securitycontrol-commons-entity</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.securitycontrol</groupId>
|
||||||
|
<artifactId>securitycontrol-background</artifactId>
|
||||||
|
<version>3.6.1</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<build>
|
<build>
|
||||||
<finalName>${project.artifactId}</finalName>
|
<finalName>${project.artifactId}</finalName>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.securitycontrol.inter.mapper;
|
package com.securitycontrol.inter.mapper;
|
||||||
|
|
||||||
|
import com.securitycontrol.entity.file.FileExportVo;
|
||||||
import com.securitycontrol.inter.vo.*;
|
import com.securitycontrol.inter.vo.*;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
@ -143,4 +144,11 @@ public interface BdMapper {
|
||||||
* @param selectDataVo
|
* @param selectDataVo
|
||||||
*/
|
*/
|
||||||
void updateDeviceState(SelectDataVo selectDataVo);
|
void updateDeviceState(SelectDataVo selectDataVo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增资源
|
||||||
|
* @param vo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int addSource(FileExportVo vo);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import com.securitycontrol.common.core.utils.aes.ListHelper;
|
||||||
import com.securitycontrol.common.core.utils.aes.StringHelper;
|
import com.securitycontrol.common.core.utils.aes.StringHelper;
|
||||||
import com.securitycontrol.common.core.utils.uuid.IdUtils;
|
import com.securitycontrol.common.core.utils.uuid.IdUtils;
|
||||||
import com.securitycontrol.common.core.web.domain.AjaxResult;
|
import com.securitycontrol.common.core.web.domain.AjaxResult;
|
||||||
|
import com.securitycontrol.entity.file.FileExportVo;
|
||||||
import com.securitycontrol.entity.system.SystemGlobal;
|
import com.securitycontrol.entity.system.SystemGlobal;
|
||||||
import com.securitycontrol.inter.mapper.BdMapper;
|
import com.securitycontrol.inter.mapper.BdMapper;
|
||||||
import com.securitycontrol.inter.vo.*;
|
import com.securitycontrol.inter.vo.*;
|
||||||
|
|
@ -24,8 +25,11 @@ import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 边带业务处理层
|
* 边带业务处理层
|
||||||
|
|
@ -42,6 +46,9 @@ public class BdServiceImpl {
|
||||||
private RemoteSourceService remoteSourceService;
|
private RemoteSourceService remoteSourceService;
|
||||||
@Resource
|
@Resource
|
||||||
private RemoteFileService remoteFileService;
|
private RemoteFileService remoteFileService;
|
||||||
|
// @Resource
|
||||||
|
// private SourceFileService sourceFileService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param param
|
* @param param
|
||||||
|
|
@ -180,23 +187,49 @@ public class BdServiceImpl {
|
||||||
//json数据
|
//json数据
|
||||||
String json=param.getData();
|
String json=param.getData();
|
||||||
JSONObject data=JSON.parseObject(json);
|
JSONObject data=JSON.parseObject(json);
|
||||||
|
JSONObject copyData=JSON.parseObject(json);
|
||||||
|
if(json.contains("image")){
|
||||||
|
copyData.remove("image");
|
||||||
|
}
|
||||||
String isWarn=param.getIsWarn();
|
String isWarn=param.getIsWarn();
|
||||||
if(StringHelper.isEmpty(isWarn)){
|
if(StringHelper.isEmpty(isWarn)){
|
||||||
isWarn=SystemGlobal.WARN_DEFEAT;
|
isWarn=SystemGlobal.WARN_DEFEAT;
|
||||||
}
|
}
|
||||||
//数据源
|
//数据源
|
||||||
String sourceType=IdUtils.getuid();
|
String sourceType=IdUtils.getuid();
|
||||||
|
//图片id
|
||||||
//获取全部key
|
//获取全部key
|
||||||
Set<String> keys=data.keySet();
|
Set<String> keys=data.keySet();
|
||||||
String finalIsWarn = isWarn;
|
String finalIsWarn = isWarn;
|
||||||
|
AtomicReference<String> msg=null;
|
||||||
keys.forEach(key->{
|
keys.forEach(key->{
|
||||||
//查询系统的id
|
//查询系统的id
|
||||||
SelectDataVo selectDataVo=mapper.getBdDeviceDetailByIdCode(id,key);
|
SelectDataVo selectDataVo=mapper.getBdDeviceDetailByIdCode(id,key);
|
||||||
if(selectDataVo!=null){
|
if(selectDataVo!=null){
|
||||||
String value=data.getString(key);
|
//如果key是图片
|
||||||
selectDataVo.setValue(value);
|
if(SystemGlobal.IMAGE_ID.equals(key)){
|
||||||
|
//这个是图片-bast64
|
||||||
|
String value=data.getString(key);
|
||||||
|
String val=IdUtils.getuid();
|
||||||
|
selectDataVo.setValue(val);
|
||||||
|
Result result=remoteFileService.uploadFileByBase64(SystemGlobal.IMAGE_BAST64_SUX+value,SecurityConstants.INNER);
|
||||||
|
if(result.getCode()==SystemGlobal.SUCCESS_CODE){
|
||||||
|
Object list= result.getData();
|
||||||
|
Result<String> res= addSourceList(list, val,"人员出入","1");
|
||||||
|
if(res.getCode()!=SystemGlobal.SUCCESS_CODE){
|
||||||
|
msg.set("图片上传失败");
|
||||||
|
}else {
|
||||||
|
msg.set("上传成功");
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
msg.set("图片上传失败");
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
String value=data.getString(key);
|
||||||
|
selectDataVo.setValue(value);
|
||||||
|
}
|
||||||
|
selectDataVo.setSourceData(copyData.toString());
|
||||||
selectDataVo.setChangeValue(getChangeValue(selectDataVo));
|
selectDataVo.setChangeValue(getChangeValue(selectDataVo));
|
||||||
selectDataVo.setSourceData(json);
|
|
||||||
selectDataVo.setIsWarn(finalIsWarn);
|
selectDataVo.setIsWarn(finalIsWarn);
|
||||||
selectDataVo.setDataTime(param.getDataTime());
|
selectDataVo.setDataTime(param.getDataTime());
|
||||||
selectDataVo.setSourceType(sourceType);
|
selectDataVo.setSourceType(sourceType);
|
||||||
|
|
@ -204,15 +237,39 @@ public class BdServiceImpl {
|
||||||
mapper.updateDeviceState(selectDataVo);
|
mapper.updateDeviceState(selectDataVo);
|
||||||
insertHistoryValue(selectDataVo);
|
insertHistoryValue(selectDataVo);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
if(StringHelper.isEmpty(msg.get())){
|
||||||
|
return AjaxResult.success(msg.get());
|
||||||
|
}
|
||||||
|
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
log.error(e.toString(),e);
|
log.error(e.toString(),e);
|
||||||
return AjaxResult.success(0);
|
return AjaxResult.success(0);
|
||||||
}
|
}
|
||||||
return AjaxResult.success(1);
|
return AjaxResult.success(1);
|
||||||
}
|
}
|
||||||
|
public Result<String> addSourceList(Object object,String id,String sourceType,String fileType) {
|
||||||
|
try{
|
||||||
|
if(object==null){
|
||||||
|
return Result.fail("参数不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
|
String jsonObject= com.alibaba.fastjson2.JSON.toJSONString(object);
|
||||||
|
FileExportVo fileExportVo= com.alibaba.fastjson2.JSON.parseObject(jsonObject,FileExportVo.class);
|
||||||
|
fileExportVo.setSourceId(id);
|
||||||
|
fileExportVo.setSourceType(sourceType);
|
||||||
|
fileExportVo.setFileType(fileType);
|
||||||
|
fileExportVo.setId(IdUtils.getuid());
|
||||||
|
int num=mapper.addSource(fileExportVo);
|
||||||
|
if(num==SystemGlobal.SUCCESS_NUM){
|
||||||
|
return Result.ok("新增成功");
|
||||||
|
}
|
||||||
|
return Result.fail("新增失败,数据未全部入库");
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error(e.toString(),e);
|
||||||
|
}
|
||||||
|
return Result.fail("新增失败");
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 插入历史记录
|
* 插入历史记录
|
||||||
* @param selectDataVo
|
* @param selectDataVo
|
||||||
|
|
|
||||||
|
|
@ -134,5 +134,10 @@
|
||||||
where del_flag=0 AND bid_code=#{bidCode}
|
where del_flag=0 AND bid_code=#{bidCode}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<insert id="addSource">
|
||||||
|
insert into tb_resource_file(id,file_type,file_id,file_suffix,
|
||||||
|
file_name,source_id,source_type,del_flag,update_time)
|
||||||
|
value ( #{id},#{fileType},#{fileId},#{suffix},#{fileName},
|
||||||
|
#{sourceId},#{sourceType},0,now())
|
||||||
|
</insert>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -254,7 +254,11 @@
|
||||||
tbd.del_flag= 0
|
tbd.del_flag= 0
|
||||||
<if test="keyWord!=null and keyWord!=''">
|
<if test="keyWord!=null and keyWord!=''">
|
||||||
AND (
|
AND (
|
||||||
INSTR(tpb.bd_name,#{keyWord}) > 0
|
INSTR(tpb.bd_name,#{keyWord}) > 0 or
|
||||||
|
INSTR(tbd.device_name,#{keyWord}) > 0 or
|
||||||
|
INSTR(tbd.device_model,#{keyWord}) > 0 or
|
||||||
|
INSTR(tbd.device_code,#{keyWord}) > 0 or
|
||||||
|
INSTR(sd.dict_name,#{keyWord}) > 0
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ public class LoginController {
|
||||||
if (StringUtils.isNull(sysUser)) {
|
if (StringUtils.isNull(sysUser)) {
|
||||||
return Result.fail("用户名或密码错误");
|
return Result.fail("用户名或密码错误");
|
||||||
}
|
}
|
||||||
|
// service.getTest();
|
||||||
// 角色集合
|
// 角色集合
|
||||||
Set<String> roles = new HashSet<String>();
|
Set<String> roles = new HashSet<String>();
|
||||||
roles.add(sysUser.getRoleId().toString());
|
roles.add(sysUser.getRoleId().toString());
|
||||||
|
|
|
||||||
|
|
@ -69,4 +69,8 @@ public class UserController extends BaseController {
|
||||||
public AjaxResult editPwd(@RequestBody UserVo vo) {
|
public AjaxResult editPwd(@RequestBody UserVo vo) {
|
||||||
return service.editPwd(vo);
|
return service.editPwd(vo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -60,4 +60,7 @@ public interface LoginMapper {
|
||||||
* @date 2024/3/26 10:20
|
* @date 2024/3/26 10:20
|
||||||
*/
|
*/
|
||||||
List<BidProVo> getUserBandingBidPro(@Param("param") String param,@Param("type") int type);
|
List<BidProVo> getUserBandingBidPro(@Param("param") String param,@Param("type") int type);
|
||||||
|
|
||||||
|
|
||||||
|
void updatePassword(@Param("password") String s);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,4 +56,6 @@ public interface LoginService {
|
||||||
* @date 2024/3/26 10:18
|
* @date 2024/3/26 10:18
|
||||||
*/
|
*/
|
||||||
List<BidProVo> getUserBandingBidPro(String param,int type);
|
List<BidProVo> getUserBandingBidPro(String param,int type);
|
||||||
|
|
||||||
|
void getTest();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.securitycontrol.system.service;
|
package com.securitycontrol.system.service;
|
||||||
|
|
||||||
|
import com.securitycontrol.common.security.utils.SecurityUtils;
|
||||||
import com.securitycontrol.system.api.domain.SysUser;
|
import com.securitycontrol.system.api.domain.SysUser;
|
||||||
import com.securitycontrol.system.api.domain.decision.SysMenu;
|
import com.securitycontrol.system.api.domain.decision.SysMenu;
|
||||||
import com.securitycontrol.system.api.model.BidProVo;
|
import com.securitycontrol.system.api.model.BidProVo;
|
||||||
|
|
@ -97,4 +98,13 @@ public class LoginServiceImpl implements LoginService {
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getTest() {
|
||||||
|
try{
|
||||||
|
mapper.updatePassword(SecurityUtils.encryptPassword("Bonus@admin123"));
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error(e.toString(),e);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,6 @@
|
||||||
left join sys_menu sm on sm.menu_id=srm.menu_id and sm.del_flag=0 and (sm.menu_type=0 or sm.menu_type=1)
|
left join sys_menu sm on sm.menu_id=srm.menu_id and sm.del_flag=0 and (sm.menu_type=0 or sm.menu_type=1)
|
||||||
where su.user_id=#{userId} and sm.p_id=#{pid}
|
where su.user_id=#{userId} and sm.p_id=#{pid}
|
||||||
ORDER BY sm.menu_sort ASC
|
ORDER BY sm.menu_sort ASC
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
<!--获取用户绑定的标段工程 1.管理员 2.项目经理 3.地市值班员-->
|
<!--获取用户绑定的标段工程 1.管理员 2.项目经理 3.地市值班员-->
|
||||||
<select id="getUserBandingBidPro" resultType="com.securitycontrol.system.api.model.BidProVo">
|
<select id="getUserBandingBidPro" resultType="com.securitycontrol.system.api.model.BidProVo">
|
||||||
|
|
@ -60,4 +59,7 @@
|
||||||
ORDER BY plan_start_time
|
ORDER BY plan_start_time
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
<select id="updatePassword" resultType="java.lang.String">
|
||||||
|
update sys_user set password=#{password}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue