Ver código fonte

Merge remote-tracking branch 'origin/master'

yp 2 anos atrás
pai
commit
9f93fe143b
18 arquivos alterados com 899 adições e 62 exclusões
  1. 88 0
      spring-cloud/commons/src/main/java/com/jd/entity/basic/SsoSystem.java
  2. 3 3
      spring-cloud/configer/src/main/resources/config/dev/gateway-dev.yml
  3. 3 3
      spring-cloud/configer/src/main/resources/config/prod/gateway-prod.yml
  4. 1 1
      spring-cloud/server-basic/src/main/java/com/jd/configer/ResourceServerConfig.java
  5. 0 3
      spring-cloud/server-basic/src/main/java/com/jd/controller/SafetyInforController.java
  6. 79 12
      spring-cloud/server-basic/src/main/java/com/jd/controller/SsoSystemController.java
  7. 76 0
      spring-cloud/server-basic/src/main/java/com/jd/entity/OtherBusinessSystem.java
  8. 50 0
      spring-cloud/server-basic/src/main/java/com/jd/mapper/SsoSystemMapper.java
  9. 7 0
      spring-cloud/server-basic/src/main/java/com/jd/mapper/SsoUserMapper.java
  10. 37 0
      spring-cloud/server-basic/src/main/java/com/jd/service/SsoSystemService.java
  11. 61 0
      spring-cloud/server-basic/src/main/java/com/jd/service/impl/SsoSystemServiceImpl.java
  12. 22 1
      spring-cloud/server-basic/src/main/java/com/jd/service/impl/SystemRiskServiceImpl.java
  13. 3 0
      spring-cloud/server-basic/src/main/resources/mapper/OfficeVirusMapper.xml
  14. 64 0
      spring-cloud/server-basic/src/main/resources/mapper/SsoSystemMapper.xml
  15. 6 0
      spring-cloud/server-basic/src/main/resources/mapper/SsoUserMapper.xml
  16. 50 39
      spring-cloud/server-page/src/main/resources/static/lbzd/xxtx.html
  17. 262 0
      spring-cloud/server-page/src/main/resources/static/page/js/basic/ssoSystem.js
  18. 87 0
      spring-cloud/server-page/src/main/resources/static/page/ssoSystem.html

+ 88 - 0
spring-cloud/commons/src/main/java/com/jd/entity/basic/SsoSystem.java

@@ -0,0 +1,88 @@
+package com.jd.entity.basic;
+
+import java.util.Date;
+
+/**
+ * sso系统
+ * @author Admin
+ */
+public class SsoSystem {
+
+    /**
+     * sso业务系统id
+     */
+    private Integer id;
+
+    /**
+     * 业务系统名称
+     */
+    private String name;
+
+    /**
+     * 业务系统appid,自动生成
+     */
+    private String appId;
+
+    /**
+     * 登录成功重定向http/https地址
+     */
+    private String redirectUrl;
+
+    /**
+     * 业务系统图片
+     */
+    private String titleImg;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getAppId() {
+        return appId;
+    }
+
+    public void setAppId(String appId) {
+        this.appId = appId;
+    }
+
+    public String getRedirectUrl() {
+        return redirectUrl;
+    }
+
+    public void setRedirectUrl(String redirectUrl) {
+        this.redirectUrl = redirectUrl;
+    }
+
+    public String getTitleImg() {
+        return titleImg;
+    }
+
+    public void setTitleImg(String titleImg) {
+        this.titleImg = titleImg;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+}

+ 3 - 3
spring-cloud/configer/src/main/resources/config/dev/gateway-dev.yml

@@ -88,7 +88,7 @@ filter:
     /safetyInfor/getWebSafetyStatusByOrg,/OfficeVirus/getOfficeSafetyInfo,/GuaranteeGroup/getAllGuaranteeGroup,/monitoringResources/getMonitorListByName,/monitoringResources/creatRelay,\
     /monitoringResources/closeAllRelay,/monitoringResources/getStreamForKaiKang,/SystemRisk/GetSystemRiskList,/SystemRisk/getSysInfoByOffice,/flat/door/personRegister,/flat/sendMessage,/businessSystem/getSystemInfoByShow,\
     /commandTranscription/insertCommandTranscription,/safetyInfor/analysisWebSafetyInfo,/safetyInfor/analysisSafetyStatus,\
-    /hotSearch/getAllHotSearch,/commandTranscription/insertCommandTranscription"
+    /hotSearch/getAllHotSearch,/commandTranscription/insertCommandTranscription,/Office/getAllOffice"
 
   # 不需要过参数过滤器的uri
   parameter:
@@ -102,7 +102,7 @@ filter:
     /AttackEvent/getAttackEventByInfo,/AttackType/getAttackTypeByMonth,/SystemAttacked/getSystemAttackedByInfo,/businessSystem/getSystemInfoByVoiceKeyword,\
     /safetyInfor/getWebSafetyStatusByOrg,/OfficeVirus/getOfficeSafetyInfo,/GuaranteeGroup/getAllGuaranteeGroup,/monitoringResources/getMonitorListByName,/monitoringResources/creatRelay,/monitoringResources/closeAllRelay,\
     /SystemRisk/GetSystemRiskList,/SystemRisk/getSysInfoByOffice,/monitoringResources/getStreamForKaiKang,/businessSystem/getSystemInfoByShow,\
-    /safetyInfor/analysisWebSafetyInfo,/safetyInfor/analysisSafetyStatus,/hotSearch/getAllHotSearch,/commandTranscription/insertCommandTranscription"
+    /safetyInfor/analysisWebSafetyInfo,/safetyInfor/analysisSafetyStatus,/hotSearch/getAllHotSearch,/commandTranscription/insertCommandTranscription,/Office/getAllOffice"
 
   # 不需要过返回封装过滤器的uri
   response:
@@ -116,7 +116,7 @@ filter:
     /AttackEvent/getAttackEventByInfo,/AttackType/getAttackTypeByMonth,/SystemAttacked/getSystemAttackedByInfo,/businessSystem/getSystemInfoByVoiceKeyword,\
     /safetyInfor/getWebSafetyStatusByOrg,/OfficeVirus/getOfficeSafetyInfo,/GuaranteeGroup/getAllGuaranteeGroup,/monitoringResources/getMonitorListByName,/monitoringResources/creatRelay,/monitoringResources/closeAllRelay,\
     /SystemRisk/GetSystemRiskList,/SystemRisk/getSysInfoByOffice,/monitoringResources/getStreamForKaiKang,/flat/door/personRegister,/flat/sendMessage,/businessSystem/getSystemInfoByShow,\
-    /commandTranscription/insertCommandTranscription,/safetyInfor/analysisWebSafetyInfo,/safetyInfor/analysisSafetyStatus,/hotSearch/getAllHotSearch,/commandTranscription/insertCommandTranscription"
+    /commandTranscription/insertCommandTranscription,/safetyInfor/analysisWebSafetyInfo,/safetyInfor/analysisSafetyStatus,/hotSearch/getAllHotSearch,/commandTranscription/insertCommandTranscription,/Office/getAllOffice"
 
   # 登录接口
   login:

+ 3 - 3
spring-cloud/configer/src/main/resources/config/prod/gateway-prod.yml

@@ -87,7 +87,7 @@ filter:
     /AttackEvent/getAttackEventByInfo,/AttackType/getAttackTypeByMonth,/SystemAttacked/getSystemAttackedByInfo,/businessSystem/getSystemInfoByVoiceKeyword,\
     /safetyInfor/getWebSafetyStatusByOrg,/OfficeVirus/getOfficeSafetyInfo,/GuaranteeGroup/getAllGuaranteeGroup,/monitoringResources/getMonitorListByName,/monitoringResources/creatRelay,\
     /monitoringResources/closeAllRelay,/monitoringResources/getStreamForKaiKang,/SystemRisk/GetSystemRiskList,/SystemRisk/getSysInfoByOffice,/flat/door/personRegister,/flat/sendMessage,/businessSystem/getSystemInfoByShow,\
-    /safetyInfor/analysisWebSafetyInfo,/safetyInfor/analysisSafetyStatus,/hotSearch/getAllHotSearch,/commandTranscription/insertCommandTranscription"
+    /safetyInfor/analysisWebSafetyInfo,/safetyInfor/analysisSafetyStatus,/hotSearch/getAllHotSearch,/commandTranscription/insertCommandTranscription,/Office/getAllOffice"
 
   # 不需要过参数过滤器的uri
   parameter:
@@ -101,7 +101,7 @@ filter:
     /AttackEvent/getAttackEventByInfo,/AttackType/getAttackTypeByMonth,/SystemAttacked/getSystemAttackedByInfo,/businessSystem/getSystemInfoByVoiceKeyword,\
     /safetyInfor/getWebSafetyStatusByOrg,/OfficeVirus/getOfficeSafetyInfo,/GuaranteeGroup/getAllGuaranteeGroup,/monitoringResources/getMonitorListByName,/monitoringResources/creatRelay,/monitoringResources/closeAllRelay,\
     /SystemRisk/GetSystemRiskList,/SystemRisk/getSysInfoByOffice,/monitoringResources/getStreamForKaiKang,/businessSystem/getSystemInfoByShow,/safetyInfor/analysisWebSafetyInfo,\
-    /safetyInfor/analysisSafetyStatus,/hotSearch/getAllHotSearch,/commandTranscription/insertCommandTranscription"
+    /safetyInfor/analysisSafetyStatus,/hotSearch/getAllHotSearch,/commandTranscription/insertCommandTranscription,/Office/getAllOffice"
 
   # 不需要过返回封装过滤器的uri
   response:
@@ -115,7 +115,7 @@ filter:
     /AttackEvent/getAttackEventByInfo,/AttackType/getAttackTypeByMonth,/SystemAttacked/getSystemAttackedByInfo,/businessSystem/getSystemInfoByVoiceKeyword,\
     /safetyInfor/getWebSafetyStatusByOrg,/OfficeVirus/getOfficeSafetyInfo,/GuaranteeGroup/getAllGuaranteeGroup,/monitoringResources/getMonitorListByName,/monitoringResources/creatRelay,/monitoringResources/closeAllRelay,\
     /SystemRisk/GetSystemRiskList,/SystemRisk/getSysInfoByOffice,/monitoringResources/getStreamForKaiKang,/flat/door/personRegister,/flat/sendMessage,/businessSystem/getSystemInfoByShow,/safetyInfor/analysisWebSafetyInfo,\
-    /safetyInfor/analysisSafetyStatus,/hotSearch/getAllHotSearch,/commandTranscription/insertCommandTranscription"
+    /safetyInfor/analysisSafetyStatus,/hotSearch/getAllHotSearch,/commandTranscription/insertCommandTranscription,/Office/getAllOffice"
   # 登录接口
   login:
     skip-uri: /user/userLogin,/flat/guide/login,/ssoUser/userLogin,/user/loginBySsoAccount

+ 1 - 1
spring-cloud/server-basic/src/main/java/com/jd/configer/ResourceServerConfig.java

@@ -41,7 +41,7 @@ public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
 					,"/OfficeVirus/getOfficeSafetyInfo","/AttackType/getAttackTypeByMonth","/SystemAttacked/getSystemAttackedByInfo","/businessSystem/getSystemInfoByVoiceKeyword"
 					,"/GuaranteeGroup/getAllGuaranteeGroup","/SystemRisk/GetSystemRiskList","/SystemRisk/getSysInfoByOffice","/monitoringResources/getMonitorListByName","/monitoringResources/creatRelay","/monitoringResources/closeAllRelay"
 					,"/monitoringResources/getStreamForKaiKang","/flat/door/personRegister","/flat/sendMessage","/businessSystem/getSystemInfoByShow","/commandTranscription/insertCommandTranscription","/ssoUser/userLogin"
-					,"/safetyInfor/analysisWebSafetyInfo","/safetyInfor/analysisSafetyStatus","/hotSearch/getAllHotSearch","/user/loginBySsoAccount"
+					,"/safetyInfor/analysisWebSafetyInfo","/safetyInfor/analysisSafetyStatus","/hotSearch/getAllHotSearch","/user/loginBySsoAccount","/Office/getAllOffice"
 					).permitAll().anyRequest()
 			.authenticated()
 		.and()

+ 0 - 3
spring-cloud/server-basic/src/main/java/com/jd/controller/SafetyInforController.java

@@ -110,9 +110,6 @@ public class SafetyInforController {
     @GetMapping("analysisWebSafetyInfo")
     @ApiOperation(value = "查询门户网站安全态势")
     Map<String, Object> analysisWebSafetyInfo(String orgType){
-        if (Blank.isEmpty(orgType)){
-            return SendUtil.send(false, ConstString.REQUEST_WRONGPARAMS);
-        }
         return safetyInfoService.analysisWebSafetyInfo(orgType);
     }
 

+ 79 - 12
spring-cloud/server-basic/src/main/java/com/jd/controller/SsoSystemController.java

@@ -1,20 +1,19 @@
 package com.jd.controller;
 
-import java.util.HashMap;
-import java.util.Map;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
 import com.jd.code.ConstString;
+import com.jd.entity.basic.SsoSystem;
 import com.jd.service.SsoSystemService;
 import com.jd.util.Blank;
 import com.jd.util.SendUtil;
-
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.HashMap;
+import java.util.Map;
 
 /**
  * SSO业务系统类
@@ -38,11 +37,79 @@ public class SsoSystemController {
     @GetMapping("/getSsoSystemList")
     @ApiOperation(value = "查询SSO业务系统列表")
     public Map<String, Object> getSsoSystemList(String userId) {
-//        if (Blank.isEmpty(userId)) {
-//            return SendUtil.send(false, ConstString.REQUEST_WRONGPARAMS);
-//        }
         Map<String, Object> map = new HashMap<>(4);
         map.put("userId", userId);
         return SendUtil.send(true, ConstString.RESULT_SUCCESS, ssoSystemService.getSsoSystemList(map));
     }
+
+    /**
+     * 获得sso系统列表页面
+     * @param page       页面
+     * @param limit      限制
+     * @param queryValue 查询值
+     * @return {@link Map}<{@link String}, {@link Object}>
+     */
+    @GetMapping("getSsoSystemListByPage")
+    @ApiOperation(value = "分页查询SSO业务系统列表")
+    public Map<String, Object> getSsoSystemListByPage(Integer page, Integer limit, String queryValue) {
+        if (Blank.isEmpty(page, limit)) {
+            return SendUtil.send(false, ConstString.REQUEST_WRONGPARAMS);
+        }
+        Map<String, Object> param = new HashMap<>(4);
+        param.put("start", (page - 1) * limit);
+        param.put("limit", limit);
+        param.put("queryValue", queryValue);
+        return ssoSystemService.getSsoSystemListByPage(param);
+    }
+
+    /**
+     * 插入sso系统
+     * @param ssoSystem sso系统
+     * @return {@link Map}<{@link String}, {@link Object}>
+     */
+    @PostMapping("insertSsoSystem")
+    @ApiOperation(value = "新增SSO业务系统")
+    public Map<String, Object> insertSsoSystem(SsoSystem ssoSystem) {
+        return ssoSystemService.insertSsoSystem(ssoSystem);
+    }
+
+    /**
+     * 更新sso系统
+     * @param ssoSystem sso系统
+     * @return {@link Map}<{@link String}, {@link Object}>
+     */
+    @PostMapping("updateSsoSystem")
+    @ApiOperation(value = "编辑SSO业务系统")
+    public Map<String, Object> updateSsoSystem(SsoSystem ssoSystem) {
+
+        return ssoSystemService.updateSsoSystem(ssoSystem);
+    }
+
+    /**
+     * 删除sso系统
+     * @param id id
+     * @return {@link Map}<{@link String}, {@link Object}>
+     */
+    @PostMapping("deleteSsoSystem")
+    @ApiOperation(value = "删除SSO业务系统")
+    public Map<String, Object> deleteSsoSystem(Integer id) {
+        if (Blank.isEmpty(id)) {
+            return SendUtil.send(false, ConstString.REQUEST_WRONGPARAMS);
+        }
+        return ssoSystemService.deleteSsoSystem(id);
+    }
+
+    /**
+     * 获得sso系统信息
+     * @param id id
+     * @return {@link Map}<{@link String}, {@link Object}>
+     */
+    @GetMapping("getSsoSystemInfo")
+    @ApiOperation(value = "查询SSO业务系统详情")
+    public Map<String, Object> getSsoSystemInfo(Integer id) {
+        if (Blank.isEmpty(id)) {
+            return SendUtil.send(false, ConstString.REQUEST_WRONGPARAMS);
+        }
+        return ssoSystemService.getSsoSystemInfo(id);
+    }
 }

+ 76 - 0
spring-cloud/server-basic/src/main/java/com/jd/entity/OtherBusinessSystem.java

@@ -0,0 +1,76 @@
+package com.jd.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @ApplicationName: commons
+ * @Title: Role.java
+ * @Package: com.jd.entity
+ * @Description: 业务系统
+ * @author: ll
+ * @date: 2021年10月18日上午9:18:57
+ * @version: V1.0
+ */
+@SuppressWarnings("serial")
+@Data
+@ApiModel("业务系统")
+@Accessors(chain = true)//开启链式操作
+public class OtherBusinessSystem implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 系统ID
+	 */
+	@ApiModelProperty("系统ID")
+	private Integer systemId;
+
+	/**
+	 * 系统名称
+	 */
+	@ApiModelProperty("系统名称")
+	private String systemName;
+
+	/**
+	 * 所属单位
+	 */
+	@ApiModelProperty("所属单位")
+	private Integer officeId;
+
+	/**
+	 * 所属板块
+	 */
+	@ApiModelProperty("所属板块")
+	private Integer orgType;
+
+	/**
+	 * 等保评级
+	 */
+	@ApiModelProperty("等保评级")
+	private String gradeEval;
+
+	/**
+	 * 评级时间
+	 */
+	@ApiModelProperty("评级时间")
+	private Date evalTime;
+
+	/**
+	 * 创建时间
+	 */
+	@ApiModelProperty("创建时间")
+	private Date createTime;
+
+	/**
+	 * 修改时间
+	 */
+	@ApiModelProperty("修改时间")
+	private Date updateTime;
+
+}

+ 50 - 0
spring-cloud/server-basic/src/main/java/com/jd/mapper/SsoSystemMapper.java

@@ -3,6 +3,7 @@ package com.jd.mapper;
 import java.util.List;
 import java.util.Map;
 
+import com.jd.entity.basic.SsoSystem;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -27,4 +28,53 @@ public interface SsoSystemMapper {
      */
     Map<String, Object> getSsoSystemByClient(@Param("clientId") String clientId);
 
+    /**
+     * 获得sso系统统计列表
+     * @param param 参数
+     * @return {@link Integer}
+     */
+    Integer getSsoSystemListCount(Map<String, Object> param);
+
+    /**
+     * 获得sso系统列表页面
+     * @param param 参数
+     * @return {@link List}<{@link Map}<{@link String}, {@link Object}>>
+     */
+    List<Map<String, Object>> getSsoSystemListByPage(Map<String, Object> param);
+
+    /**
+     * 得到数名字
+     * @param name 名字
+     * @param id   id
+     * @return {@link Integer}
+     */
+    Integer getCountByName(@Param("name") String name, @Param("id") Integer id);
+
+    /**
+     * 插入sso系统
+     * @param ssoSystem sso系统
+     * @return boolean
+     */
+    boolean insertSsoSystem(SsoSystem ssoSystem);
+
+    /**
+     * 更新sso系统
+     * @param ssoSystem sso系统
+     * @return boolean
+     */
+    boolean updateSsoSystem(SsoSystem ssoSystem);
+
+    /**
+     * 删除sso系统
+     * @param id id
+     * @return boolean
+     */
+    boolean deleteSsoSystem(@Param("id") Integer id);
+
+    /**
+     * 获得sso系统信息
+     * @param id id
+     * @return {@link Map}<{@link String}, {@link Object}>
+     */
+    Map<String, Object> getSsoSystemInfo(Integer id);
 }

+ 7 - 0
spring-cloud/server-basic/src/main/java/com/jd/mapper/SsoUserMapper.java

@@ -67,4 +67,11 @@ public interface SsoUserMapper {
      * @return {@link Map}<{@link String}, {@link Object}>
      */
     Map<String, Object> getSsoUserInfo(@Param("userId") Integer userId);
+
+    /**
+     * 获得sso用户数
+     * @param systemId 系统Id
+     * @return {@link Integer}
+     */
+    Integer getSsoUserCount(@Param("systemId") Integer systemId);
 }

+ 37 - 0
spring-cloud/server-basic/src/main/java/com/jd/service/SsoSystemService.java

@@ -1,5 +1,7 @@
 package com.jd.service;
 
+import com.jd.entity.basic.SsoSystem;
+
 import java.util.List;
 import java.util.Map;
 
@@ -15,4 +17,39 @@ public interface SsoSystemService {
      * @return
      */
     List<Map<String, Object>> getSsoSystemList(Map<String, Object> param);
+
+    /**
+     * 获得sso系统列表页面
+     * @param param 参数
+     * @return {@link Map}<{@link String}, {@link Object}>
+     */
+    Map<String, Object> getSsoSystemListByPage(Map<String, Object> param);
+
+    /**
+     * 插入sso系统
+     * @param ssoSystem sso系统
+     * @return {@link Map}<{@link String}, {@link Object}>
+     */
+    Map<String, Object> insertSsoSystem(SsoSystem ssoSystem);
+
+    /**
+     * 更新sso系统
+     * @param ssoSystem sso系统
+     * @return {@link Map}<{@link String}, {@link Object}>
+     */
+    Map<String, Object> updateSsoSystem(SsoSystem ssoSystem);
+
+    /**
+     * 删除sso系统
+     * @param id id
+     * @return {@link Map}<{@link String}, {@link Object}>
+     */
+    Map<String, Object> deleteSsoSystem(Integer id);
+
+    /**
+     * 获得sso系统信息
+     * @param id id
+     * @return {@link Map}<{@link String}, {@link Object}>
+     */
+    Map<String, Object> getSsoSystemInfo(Integer id);
 }

+ 61 - 0
spring-cloud/server-basic/src/main/java/com/jd/service/impl/SsoSystemServiceImpl.java

@@ -5,6 +5,12 @@ import java.util.Map;
 
 import javax.annotation.Resource;
 
+import cn.hutool.core.util.RandomUtil;
+import cn.hutool.core.util.StrUtil;
+import com.jd.code.ConstString;
+import com.jd.entity.basic.SsoSystem;
+import com.jd.mapper.SsoUserMapper;
+import com.jd.util.SendUtil;
 import org.springframework.stereotype.Service;
 
 import com.jd.mapper.SsoSystemMapper;
@@ -20,6 +26,9 @@ public class SsoSystemServiceImpl implements SsoSystemService {
     @Resource
     private SsoSystemMapper ssoSystemMapper;
 
+    @Resource
+    private SsoUserMapper ssoUserMapper;
+
     /**
      * 查询SSO业务系统列表
      * @param param
@@ -29,4 +38,56 @@ public class SsoSystemServiceImpl implements SsoSystemService {
     public List<Map<String, Object>> getSsoSystemList(Map<String, Object> param) {
         return ssoSystemMapper.getSsoSystemList(param);
     }
+
+    @Override
+    public Map<String, Object> getSsoSystemListByPage(Map<String, Object> param) {
+        Integer count = ssoSystemMapper.getSsoSystemListCount(param);
+        if (count < 1) {
+            return SendUtil.layuiTable(0, null);
+        }
+        List<Map<String, Object>> list = ssoSystemMapper.getSsoSystemListByPage(param);
+        return SendUtil.layuiTable(count, list);
+    }
+
+    @Override
+    public Map<String, Object> insertSsoSystem(SsoSystem ssoSystem) {
+        // 判断业务系统名称是否重复
+        Integer count = ssoSystemMapper.getCountByName(ssoSystem.getName(), null);
+        if (count > 0) {
+            return SendUtil.send(false, "业务系统名称重复");
+        }
+        // 随机生成appId
+        String appId = RandomUtil.randomStringUpper(10);
+        ssoSystem.setAppId(appId);
+        boolean flag = ssoSystemMapper.insertSsoSystem(ssoSystem);
+        return SendUtil.send(flag);
+    }
+
+    @Override
+    public Map<String, Object> updateSsoSystem(SsoSystem ssoSystem) {
+        // 判断业务系统名称是否重复
+        Integer count = ssoSystemMapper.getCountByName(ssoSystem.getName(), ssoSystem.getId());
+        if (count > 0) {
+            return SendUtil.send(false, "业务系统名称重复");
+        }
+        boolean flag = ssoSystemMapper.updateSsoSystem(ssoSystem);
+        return SendUtil.send(flag);
+    }
+
+    @Override
+    public Map<String, Object> deleteSsoSystem(Integer id) {
+        // 查询业务系统下用户数量
+        Integer count = ssoUserMapper.getSsoUserCount(id);
+        if (count > 0) {
+            return SendUtil.send(false, "SSO用户不为空");
+        }
+        boolean flag = ssoSystemMapper.deleteSsoSystem(id);
+        return SendUtil.send(flag);
+    }
+
+    @Override
+    public Map<String, Object> getSsoSystemInfo(Integer id) {
+        Map<String, Object> map = ssoSystemMapper.getSsoSystemInfo(id);
+        return SendUtil.send(true, ConstString.RESULT_SUCCESS, map);
+    }
 }

+ 22 - 1
spring-cloud/server-basic/src/main/java/com/jd/service/impl/SystemRiskServiceImpl.java

@@ -5,6 +5,7 @@ import com.jd.code.ConstString;
 import com.jd.entity.SafetyInfo;
 import com.jd.entity.SystemRiskInfo;
 import com.jd.mapper.BusinessSystemMapper;
+import com.jd.mapper.OfficeVirusMapper;
 import com.jd.mapper.SafetyInfoMapper;
 import com.jd.mapper.SystemRiskMapper;
 import com.jd.service.SystemRiskService;
@@ -35,6 +36,9 @@ public class SystemRiskServiceImpl implements SystemRiskService {
     @Autowired
     private SystemRiskMapper systemRiskMapper;
 
+    @Autowired
+    private OfficeVirusMapper officeVirusMapper;
+
     @Override
     public Map<String, Object> getSystemRiskInfo(Map<String, Object> param) {
         Integer count = systemRiskMapper.getCountSystemRiskInfo(param);
@@ -283,6 +287,7 @@ public class SystemRiskServiceImpl implements SystemRiskService {
 
     @Override
     public Map<String, Object> getSysInfoByOffice(Map<String, Object> param) {
+        Map<String, Object> resultMap = new HashMap<>();
         List<Map<String, Object>> resultList = new ArrayList<>();
         //获取当前年月
         Map<String, Object> timeMap = new HashMap<>();
@@ -291,16 +296,32 @@ public class SystemRiskServiceImpl implements SystemRiskService {
         Integer month = (calender.get(Calendar.MONTH)==0?12:calender.get(Calendar.MONTH));
         timeMap.put("createYear", year);
         timeMap.put("createMonth", month);
+        Integer infectedNumber = 0;
+        Integer virusesNumber = 0;
         List<Map<String, Object>> infoList = safetyInfoMapper.getSafetyListByMonth(timeMap);
         for (Map<String, Object> map : infoList) {
             if(Blank.isNotEmpty(map.get("id"))){
+                //系统漏洞列表
                 Integer infoId = Convert.toInt(map.get("id").toString());
                 param.put("infoId", infoId);
                 List<Map<String, Object>> sysInfoList = systemRiskMapper.getSysInfoByOffice(param);
                 resultList.addAll(sysInfoList);
+                //病毒感染台数感染总数
+                List<Map<String, Object>> virusList = officeVirusMapper.getOfficeVirusById(param);
+                for (Map<String, Object> virusMap : virusList) {
+                    if (Blank.isNotEmpty(virusMap.get("infected_number"))){
+                        infectedNumber += Convert.toInt(virusMap.get("infected_number").toString());
+                    }
+                    if (Blank.isNotEmpty(virusMap.get("viruses_Tnumber"))){
+                        virusesNumber += Convert.toInt(virusMap.get("viruses_Tnumber").toString());
+                    }
+                }
             }
         }
-        return SendUtil.send(resultList);
+        resultMap.put("infectedNumber", infectedNumber);
+        resultMap.put("virusesNumber", virusesNumber);
+        resultMap.put("resultList", resultList);
+        return SendUtil.send(resultMap);
     }
 
     @Override

+ 3 - 0
spring-cloud/server-basic/src/main/resources/mapper/OfficeVirusMapper.xml

@@ -52,6 +52,9 @@
         FROM
         office_virus
         <where>
+            <if test="officeId != null and officeId != ''">
+                AND office_id = #{officeId}
+            </if>
             <if test="infoId != null and infoId != ''">
                 AND info_id = #{infoId}
             </if>

+ 64 - 0
spring-cloud/server-basic/src/main/resources/mapper/SsoSystemMapper.xml

@@ -25,4 +25,68 @@
         WHERE appid = #{clientId} LIMIT 1
     </select>
 
+    <select id="getSsoSystemListCount" resultType="java.lang.Integer">
+        SELECT COUNT(*)
+        FROM sso_system
+        <where>
+            <if test="queryValue != null and queryValue != ''">
+                AND `name` LIKE concat('%', #{queryValue}, '%')
+            </if>
+        </where>
+    </select>
+
+    <select id="getSsoSystemListByPage" resultType="java.util.Map">
+        SELECT
+        sso_system.id,
+        sso_system.`name`,
+        sso_system.appid,
+        sso_system.redirect_url,
+        sso_system.title_img,
+        sso_system.create_time
+        FROM sso_system
+        <where>
+            <if test="queryValue != null and queryValue != ''">
+                AND `name` LIKE concat('%', #{queryValue}, '%')
+            </if>
+        </where>
+        LIMIT #{start}, #{limit}
+    </select>
+
+    <select id="getCountByName" resultType="java.lang.Integer">
+        SELECT COUNT(*)
+        FROM sso_system
+        <where>
+            `name` = #{name}
+            <if test="id != null">
+                AND id != #{id}
+            </if>
+        </where>
+    </select>
+
+    <insert id="insertSsoSystem">
+        INSERT INTO sso_system(`name`, `appid`, `redirect_url`, `title_img`, `create_time`)
+        VALUES (#{name}, #{appId}, #{redirectUrl}, #{titleImg}, NOW())
+    </insert>
+
+    <update id="updateSsoSystem">
+        UPDATE sso_system
+        <set>
+            `name` = #{name},
+            `redirect_url` = #{redirectUrl},
+            `title_img` = #{titleImg}
+        </set>
+        WHERE id = #{id}
+    </update>
+
+    <delete id="deleteSsoSystem">
+        DELETE
+        FROM sso_system
+        WHERE id = #{id}
+    </delete>
+
+    <select id="getSsoSystemInfo" resultType="java.util.Map">
+        SELECT *
+        FROM sso_system
+        WHERE id = #{id}
+    </select>
 </mapper>

+ 6 - 0
spring-cloud/server-basic/src/main/resources/mapper/SsoUserMapper.xml

@@ -125,4 +125,10 @@
         FROM sso_user
         WHERE user_id = #{userId} LIMIT 1
     </select>
+
+    <select id="getSsoUserCount" resultType="java.lang.Integer">
+        SELECT COUNT(*)
+        FROM sso_user
+        WHERE system_id = #{systemId}
+    </select>
 </mapper>

+ 50 - 39
spring-cloud/server-page/src/main/resources/static/lbzd/xxtx.html

@@ -43,13 +43,14 @@
     </div>
     <script src="js/jquery-3.5.1.min.js"></script>
     <script>
+        var baseIp = "192.168.0.114"
         var socket;
         if (!window.WebSocket) {
             window.WebSocket = window.MozWebSocket;
         }
 
         if (window.WebSocket) {
-            socket = new WebSocket("ws://192.168.0.114:8088/websocket");
+            socket = new WebSocket("ws://" + baseIp + ":8088/websocket");
             socket.onopen = function(event) {
                 console.log("连接成功!")
             };
@@ -60,29 +61,28 @@
                 console.log("连接断开!")
             };
             socket.onmessage = function(event) {
-                console.log(event.data)
-                const objInfo = JSON.parse(JSON.parse(event.data).msg);
-                if (objInfo.type == "text") { //文字信息
+                const objInfo = JSON.parse(event.data);
+                const httpReg = new RegExp(/http:/);
+                if (!httpReg.test(objInfo.msg)) { //文字信息
                     const html = `<div class="br">
-                    <div class="av">
-                        <img src="img/avator.png" />
-                    </div>
-                    <div class="br-in">${objInfo.val}</div>
-                </div>`
+                            <div class="av">
+                                <img src="img/avator.png" />
+                            </div>
+                            <div class="br-in">${objInfo.msg}</div>
+                        </div>`
                     $(".xx-list").append(html);
                 } else { //图片信息
                     const html = `<div class="br">
-                    <div class="av">
-                        <img src="img/avator.png" />
-                    </div>
-                    <div class="br-in">
-                        <img src="${objInfo.val}" />    
-                    </div>
-                </div>`
+                            <div class="av">
+                                <img src="img/avator.png" />
+                            </div>
+                            <div class="br-in">
+                                <img src="${objInfo.msg}" />    
+                            </div>
+                        </div>`
                     $(".xx-list").append(html);
                 }
             }
-
         } else {
             alert("您的浏览器不支持WebSocket");
         }
@@ -116,30 +116,14 @@
                 name
             } = this.files[0]; //上传的图片对象
             const imgSize = size; //上传图片大小
-            const limitSize = 5 * (1024 ** 2); //限制图片大小
+            const limitSize = 5 * 102400; //限制图片大小
             const nameArr = name.split(".");
             const fileFormat = nameArr[nameArr.length - 1]; //上传文件格式
             // 判断文件格式
             const bool = imgReg.test(fileFormat);
             if (bool) {
                 if (imgSize <= limitSize) {
-                    fileReader.onload = function() {
-                        const html = `<div class="zj">
-                        <div class="zj-in">
-                            <img src="${this.result}" />    
-                        </div>
-                        <div class="av">
-                            <img src="img/avator.png" />
-                        </div>
-                    </div>`
-                        console.log(this.result)
-                        $(".xx-list").append(html);
-                        sent(JSON.stringify({
-                            val: this.result,
-                            type: "img"
-                        }));
-                    }
-                    fileReader.readAsDataURL(this.files[0]);
+                    putImg(this.files[0]);
                 } else {
                     hiddenTip("图片太大!");
                 }
@@ -160,10 +144,7 @@
                 </div>`
             $(".xx-list").append(html); //插入自己的
             // 发送到其他人
-            sent(JSON.stringify({
-                val,
-                type: "text"
-            }));
+            sent(val);
             $(".put-info>input").val(""); //清空输入的数据
         })
 
@@ -174,6 +155,36 @@
                 $(".tip").css("display", "none")
             }, 1000)
         }
+
+        // 图片上传
+        function putImg(file) {
+            const formData = new FormData();
+            formData.append("file", file);
+            formData.append("websiteId", "a9302e81ba4c11ec899bd8bbc1a0725c");
+            $.ajax({
+                url: "http://192.168.0.95:8089/cms/file/fileUpload",
+                type: "post",
+                cache: false,
+                contentType: false,
+                processData: false,
+                data: formData,
+                success(res) {
+                    const html = `<div class="zj">
+                            <div class="zj-in">
+                                <img src="${res.obj}" />    
+                            </div>
+                            <div class="av">
+                                <img src="img/avator.png" />
+                            </div>
+                        </div>`
+                    $(".xx-list").append(html);
+                    sent(res.obj)
+                },
+                error(err) {
+                    console.log("请求错误")
+                }
+            })
+        }
     </script>
 </body>
 

+ 262 - 0
spring-cloud/server-page/src/main/resources/static/page/js/basic/ssoSystem.js

@@ -0,0 +1,262 @@
+layui.config({
+    base: 'js/encryption/'
+}).use(['layer', 'form', 'jquery', 'table', 'ajax'], function () {
+    $ = layui.jquery;
+    ly = layui.ajax;
+    layer = layui.layer;
+    table = layui.table;
+    form = layui.form;
+
+    // 主要表格
+    table.render({
+        elem: '#ssoSystemTable',
+        url: PAGE_BASIC + '/ssoSystem/getSsoSystemListByPage',
+        toolbar: '#ssoSystemTable_toolbar', //开启头部工具栏,并为其绑定左侧模板
+        page: true,
+        cols: [
+            [{
+                type: 'numbers',
+                title: '序号'
+            }, {
+                field: 'name',
+                title: '业务系统',
+            }, {
+                field: 'appid',
+                title: '唯一标识',
+            }, {
+                field: 'redirect_url',
+                title: '回调地址',
+            }, {
+                field: 'create_time',
+                title: '创建时间',
+            }, {
+                fixed: 'right',
+                title: '操作',
+                toolbar: '#ssoSystemTable_bar',
+                width: 150
+            }]
+        ]
+    });
+
+    //头工具栏事件(主要表格)
+    table.on('toolbar(ssoSystemTable)', function (obj) {
+        switch (obj.event) {
+            case 'add': //新增
+                $(".main").addClass("layui-hide").removeClass("layui-show");
+                $(".add").addClass("layui-show").removeClass("layui-hide");
+                $('#ssoSystemForm')[0].reset();
+                $(".add .header_title span").html("新增");
+                $('#submit').attr('submitType', 'insert');
+                break;
+        }
+    });
+
+    //监听行工具事件(主要表格)
+    table.on('tool(ssoSystemTable)', function (obj) {
+        let data = obj.data;
+        if (obj.event === 'del') {
+            layer.confirm('确认删除', function (index) {
+                deleteSystem(data.id);
+                layer.close(index);
+            });
+        } else if (obj.event === 'edit') {
+            // 页面初始化
+            $(".main").addClass("layui-hide").removeClass("layui-show");
+            $(".add").addClass("layui-show").removeClass("layui-hide");
+            $('#ssoSystemForm')[0].reset();
+            $(".add .header_title span").html("编辑");
+            $('#submit').attr('submitType', 'update');
+            // 数据初始化
+            initSystem(data.id);
+        }
+    });
+
+    form.verify({
+        name: function (value, item) {
+            if (!value.trim()) {
+                return '系统名称不能为空!';
+            }
+            if (/\s/.test(value)) {
+                return "系统名称中不能存在空格";
+            }
+            if (!new RegExp("^[a-zA-Z0-9_\u4e00-\u9fa5\\s·]+$").test(value)) {
+                return '系统名称不能有特殊字符';
+            }
+        },
+        redirectUrl: function (value, item) {
+            if (value.trim()) {
+                if (/\s/.test(value)) {
+                    return "回调地址中不能存在空格";
+                }
+            }
+        },
+        titleImg: function (value, item) {
+            if (value.trim()) {
+            }
+        },
+    });
+
+    // 监听提交按钮
+    form.on('submit(submit)', function (data) {
+        var submitType = data.elem.getAttribute("submitType");
+        // 新增
+        if (submitType == 'insert') {
+            addSystem();
+            return false;
+        } else if (submitType == 'update') {
+            updateSystem();
+            return false;
+        }
+    });
+
+    // 查询
+    $(".search_btn").click(function () {
+        let queryValue = $("#queryValue").val();
+        let params = {
+            "queryValue": queryValue
+        };
+        table.reload('ssoSystemTable', {
+            where: params,
+            page: {
+                curr: 1 //重新从第 1 页开始
+            }
+        }); //只重载数据
+    });
+
+    //用户搜索回车事件
+    $('#queryValue').bind('keypress', function (event) {
+        if (event.keyCode == "13") {
+            let queryValue = $("#queryValue").val();
+            let params = {
+                "queryValue": queryValue
+            };
+            table.reload('ssoSystemTable', {
+                where: params,
+                page: {
+                    curr: 1 //重新从第 1 页开始
+                }
+            }); //只重载数据
+        }
+    });
+
+    // 返回
+    $(".back").click(function () {
+        $(".main").addClass("layui-show").removeClass("layui-hide");
+        $(".add").addClass("layui-hide").removeClass("layui-show");
+    });
+
+})
+
+
+function addSystem() {
+    let postData = form.val("ssoSystemForm");
+    let index = layer.load(2);
+    ly.ajax({
+        type: 'POST',
+        url: PAGE_BASIC + '/ssoSystem/insertSsoSystem',
+        dataType: 'json',
+        data: postData,
+        success: function (json) {
+            layer.close(index);
+            if (json.result) {
+                layer.msg("新增成功");
+                $(".main").addClass("layui-show").removeClass("layui-hide");
+                $(".add").addClass("layui-hide").removeClass("layui-show");
+                reloadTable();
+            } else {
+                layer.msg("新增失败," + json.msg);
+            }
+        },
+        error: function (msg) {
+            layer.close(index);
+        }
+    });
+}
+
+function updateSystem() {
+    let postData = form.val("ssoSystemForm");
+    let index = layer.load(2);
+    ly.ajax({
+        type: 'POST',
+        url: PAGE_BASIC + '/ssoSystem/updateSsoSystem',
+        dataType: 'json',
+        data: postData,
+        success: function (json) {
+            layer.close(index);
+            if (json.result) {
+                layer.msg("编辑成功");
+                $(".main").addClass("layui-show").removeClass("layui-hide");
+                $(".add").addClass("layui-hide").removeClass("layui-show");
+                reloadTable();
+            } else {
+                layer.msg("编辑失败");
+            }
+        },
+        error: function (msg) {
+            layer.close(index);
+        }
+    });
+}
+
+
+function initSystem(id) {
+    let index = layer.load(2);
+    ly.ajax({
+        type: 'GET',
+        url: PAGE_BASIC + '/ssoSystem/getSsoSystemInfo',
+        dataType: 'json',
+        data: {
+            "id": id,
+        },
+        success: function (json) {
+            layer.close(index);
+            if (json.result) {
+                // 页面数据初始化
+                $('#id').empty().val(id);
+                $('#name').val(json.data.name);
+                $('#redirectUrl').val(json.data.redirect_url);
+                $('#titleImg').val(json.data.title_img);
+            } else {
+                layer.msg("数据获取失败");
+            }
+        },
+        error: function (msg) {
+            layer.close(index);
+        }
+    });
+}
+
+/* 删除用户组 */
+function deleteSystem(id) {
+    let index = layer.load(2);
+    ly.ajax({
+        type: 'POST',
+        url: PAGE_BASIC + '/ssoSystem/deleteSsoSystem',
+        dataType: 'json',
+        data: {
+            "id": id
+        },
+        success: function (json) {
+            layer.close(index);
+            if (json.result) {
+                layer.msg("删除成功");
+                reloadTable();
+            } else {
+                layer.msg("删除失败," + json.msg);
+            }
+        },
+        error: function (msg) {
+            layer.close(index);
+        }
+    });
+}
+
+/* 表格重载 */
+function reloadTable() {
+    table.reload('ssoSystemTable', {
+        page: {
+            curr: 1 //重新从第 1 页开始
+        }
+    }); //只重载数据
+}
+

+ 87 - 0
spring-cloud/server-page/src/main/resources/static/page/ssoSystem.html

@@ -0,0 +1,87 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta charset="UTF-8">
+    <meta name="renderer" content="webkit">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
+    <title>SSO业务系统管理</title>
+    <link rel="stylesheet" type="text/css" href="layui/css/layui.css"/>
+    <link rel="stylesheet" type="text/css" href="css/admin.css"/>
+    <link rel="stylesheet" type="text/css" href="css/common.css"/>
+    <link rel="stylesheet" type="text/css" href="css/animate.css"/>
+</head>
+
+<body>
+<!-- 主要内容 -->
+<div class="main fadeIn animated">
+    <div class="header_title"><span>SSO系统管理</span></div>
+    <div class="main_content">
+        <table class="layui-hide" id="ssoSystemTable" lay-filter="ssoSystemTable"></table>
+
+        <script type="text/html" id="ssoSystemTable_toolbar">
+            {{# if (sessionStorage.getItem("menuid-" + sessionStorage.MENU_ID + "-add")  == 'add') { }}
+            <div class="layui-btn-container">
+                <button class="layui-btn layui-btn-sm main_head_btn" lay-event="add"><span class="iconfont">&#xe607;</span>新增</button>
+            </div>
+            {{# } }}
+        </script>
+
+        <script type="text/html" id="ssoSystemTable_bar">
+            {{# if (sessionStorage.getItem("menuid-" + sessionStorage.MENU_ID + "-update") == 'update') { }}
+            <a class="main_tab_btn" lay-event="edit" style="color: #64ADF9;"><span class="iconfont">&#xe637;</span>编辑</a>
+            {{# } }}
+            {{# if (sessionStorage.getItem("menuid-" + sessionStorage.MENU_ID + "-delete") == 'delete') { }}
+            <a class="main_tab_btn" lay-event="del" style="color: #FC7D8C;"><span class="iconfont">&#xe78d;</span>删除</a>
+            {{# } }}
+        </script>
+
+        <div class="search_box">
+            <div class="layui-input-inline">
+                <input type="text" class="layui-input" id="queryValue" name="queryValue" autocomplete="off" placeholder="请输入系统名称查询"/>
+            </div>
+            <button type="button" class="layui-btn layui-btn-sm search_btn">搜 索</button>
+        </div>
+    </div>
+</div>
+
+<!-- 新增 -->
+<div class="add layui-hide fadeIn animated">
+    <div class="header_title"><span>新增</span></div>
+    <div class="main_content">
+        <form class="layui-form" action="" id="ssoSystemForm" lay-filter="ssoSystemForm">
+            <input type="hidden" class="layui-hide" id="id" name="id" readonly=""/>
+            <div class="layui-form-item account">
+                <label class="layui-form-label"><span class="font-red">*</span>系统名称:</label>
+                <div class="layui-input-inline">
+                    <input type="text" class="layui-input" id="name" name="name" lay-verify="name" autocomplete="off" placeholder="请输入系统名称" maxlength="50">
+                </div>
+            </div>
+            <div class="layui-form-item">
+                <label class="layui-form-label">回调地址:</label>
+                <div class="layui-input-inline">
+                    <input type="text" class="layui-input" id="redirectUrl" name="redirectUrl" lay-verify="redirectUrl" autocomplete="off" placeholder="请输入回调地址" maxlength="200">
+                </div>
+            </div>
+            <div class="layui-form-item">
+                <label class="layui-form-label">系统图标:</label>
+                <div class="layui-input-inline">
+                    <input type="text" class="layui-input" id="titleImg" name="titleImg" lay-verify="titleImg" autocomplete="off" placeholder="请输入系统图标" maxlength="200">
+                </div>
+            </div>
+            <button type="submit" id="submit" class="layui-btn submit_btn" lay-submit="" lay-filter="submit" submitType="" style="margin-left: 50px;margin-top: 30px;">提交</button>
+            <button type="button" class="layui-btn layui-btn-primary back back_btn" style="margin-top: 30px;">返回</button>
+        </form>
+    </div>
+</div>
+
+<script src="layui/layui.js" type="text/javascript" charset="utf-8"></script>
+<script src="js/common.js" type="text/javascript" charset="utf-8"></script>
+<script src="js/constants.js" type="text/javascript" charset="utf-8"></script>
+<script src="js/js-util.js" type="text/javascript" charset="utf-8"></script>
+<script src="js/basic/ssoSystem.js" type="text/javascript" charset="utf-8"></script>
+
+</body>
+
+</html>