Kaynağa Gözat

Merge remote-tracking branch 'origin/master'

dongjh 2 ay önce
ebeveyn
işleme
18946d38e0

+ 4 - 1
jeecg-module-interlock/src/main/java/org/jeecg/modules/binlog/PostgreSQLClient.java

@@ -359,7 +359,10 @@ public class PostgreSQLClient implements ApplicationRunner {
                             if (baseYbAbnormalStatus.equals(detail.getInstrumentStatus())){
                                 ybcount++;   // 如果仪表状态有一个是异常 则+1;
                             }
-                            if (baseKzxtAbnormalStatus.equals(inputStatusTag) || baseKzxtAbnormalStatus.equals(outputStatusTag) || baseKzxtAbnormalStatus.equals(mpStatusTag)) {
+//                            if (baseKzxtAbnormalStatus.equals(inputStatusTag) || baseKzxtAbnormalStatus.equals(outputStatusTag) || baseKzxtAbnormalStatus.equals(mpStatusTag)) {
+//                                kzxtcount++; // 如果控制系统状态有一个是异常 则+1;
+//                            }
+                            if (baseKzxtAbnormalStatus.equals(detail.getInputStatus()) || baseKzxtAbnormalStatus.equals(detail.getOutputStatus()) || baseKzxtAbnormalStatus.equals(detail.getMpStatus())) {
                                 kzxtcount++; // 如果控制系统状态有一个是异常 则+1;
                             }
 //                            if (basePlNormalStatus.equals(detail.getBypass())){

+ 1 - 1
jeecg-module-interlock/src/main/java/org/jeecg/modules/interlockUser/entity/InterlockUserAdd.java

@@ -36,7 +36,7 @@ public class InterlockUserAdd {
     /**密码*/
     private java.lang.String password;
 
-    /** 联锁用户类型:0email账户 1普通账户 */
+    /** 联锁用户类型:email-email账户 normal-普通账户 */
     @Dict(dicCode = "interlock_user_type")
     private String interlockUserType;
 

+ 2 - 2
jeecg-module-interlock/src/main/java/org/jeecg/modules/interlockUser/service/impl/InterlockUserServiceImpl.java

@@ -147,7 +147,7 @@ public class InterlockUserServiceImpl extends ServiceImpl<InterlockUserMapper, I
         int count = 0;
         try {
             String password = "";
-            if ("1".equals(interlockUserAdd.getInterlockUserType()) && ObjectUtil.isNotNull(interlockUserAdd.getPassword())){
+            if ("normal".equals(interlockUserAdd.getInterlockUserType()) && ObjectUtil.isNotNull(interlockUserAdd.getPassword())){
                 password = interlockUserAdd.getPassword();
             }
             restClientService.addSSOUser(interlockUserAdd.getUsername(),password);
@@ -210,7 +210,7 @@ public class InterlockUserServiceImpl extends ServiceImpl<InterlockUserMapper, I
         //普通用户
         if(interlockUserAdd.getInterlockUserType().equals("normal")){
             //sso账户不存在
-            if(!(interlockUserAdd.getIsExistSSO())){
+            if(((interlockUserAdd.getIsExistSSO()) != null) && (!(interlockUserAdd.getIsExistSSO()))){
                 JSONObject addJSONObject = toAddJSONObject(interlockUserAdd.getUsername(), interlockUserAdd.getPassword());
                 return addUser(addJSONObject);
             }

+ 178 - 0
jeecg-module-interlock/src/main/java/org/jeecg/modules/iotedgeCollectData/controller/IoredgeInterfaceTestController.java

@@ -0,0 +1,178 @@
+package org.jeecg.modules.iotedgeCollectData.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.jeecg.modules.iotedgeCollectData.entity.IotedgeCollectData;
+import org.jeecg.modules.iotedgeCollectData.service.IIotedgeCollectDataService;
+import org.jeecg.modules.iotedgeCollectData.service.RestClientService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author dzc
+ * @date 2024/9/2 8:54
+ * @package org.jeecg.modules.iotedgeCollectData.controller
+ * @project interlock_server
+ * @des IoTEdge/SSO接口测试类
+ */
+@Api(tags="IoTEdge、SSO接口测试")
+@RestController
+@RequestMapping("/iotedgeInterfaceTest/iotedgeInterfaceTest")
+@Slf4j
+public class IoredgeInterfaceTestController extends JeecgController<IotedgeCollectData, IIotedgeCollectDataService> {
+
+    @Autowired
+    private RestClientService restClientService;
+
+    @AutoLog(value = "IoTEdge-标准登录(admin)获取Token")
+    @ApiOperation(value="IoTEdge-标准登录(admin)获取Token", notes="IoTEdge-标准登录(admin)获取Token")
+    @PostMapping(value = "/testGetAccessToken")
+    public String testGetAccessToken(){
+        return restClientService.getAccessToken();
+    }
+
+
+    @AutoLog(value = "IoTEdge-根据组织ID获取设备信息")
+    @ApiOperation(value="IoTEdge-根据组织ID获取设备信息", notes="IoTEdge-根据组织ID获取设备信息")
+    @PostMapping(value = "/testGetGroupDevicesInfo")
+    public JSONObject testGetGroupDevicesInfo(@RequestParam(name = "groupId") String groupId, @RequestParam(name = "elToken",required = false) String elToken){
+        return restClientService.getGroupDevicesInfo(groupId,elToken);
+    }
+
+    @AutoLog(value = "IoTEdge-获取所有设备信息")
+    @ApiOperation(value="IoTEdge-获取所有设备信息", notes="IoTEdge-获取所有设备信息")
+    @PostMapping(value = "/testGetAllDevicesInfo")
+    public JSONObject testGetAllDevicesInfo(@RequestParam(name = "elToken",required = false) String elToken){
+        return restClientService.getAllDevicesInfo(elToken);
+    }
+
+
+    @AutoLog(value = "IoTEdge-根据设备ID获取点位信息")
+    @ApiOperation(value="IoTEdge-根据设备ID获取点位信息", notes="IoTEdge-根据设备ID获取点位信息")
+    @PostMapping(value = "/testGetAllDevicesInfoById")
+    public JSONObject testGetAllDevicesInfoById(@RequestParam(name = "deviceId") String deviceId, @RequestParam(name = "elToken",required = false) String elToken){
+        return restClientService.getAllDevicesInfoById(deviceId,elToken);
+    }
+
+    @AutoLog(value = "Notification-获取所有群组信息")
+    @ApiOperation(value="Notification-获取所有群组信息", notes="Notification-获取所有群组信息")
+    @PostMapping(value = "/testGetAllEmailGroupInfo")
+    public JSONObject testGetAllEmailGroupInfo(@RequestParam(name = "elToken",required = false) String elToken){
+        return restClientService.getAllEmailGroupInfo();
+    }
+
+    @AutoLog(value = "Notification-发送邮件")
+    @ApiOperation(value="Notification-发送邮件", notes="Notification-发送邮件")
+    @PostMapping(value = "/testSendEmali")
+    public ResponseEntity<String> testSendEmali(@RequestParam(name = "fileName",required = false) String fileName, @RequestParam(name = "filePath",required = false) String filePath) throws Exception {
+        return restClientService.sendEmali(fileName,filePath);
+    }
+
+    @AutoLog(value = "IoTEdge-新增组织")
+    @ApiOperation(value="IoTEdge-新增组织", notes="IoTEdge-新增组织")
+    @PostMapping(value = "/testAddGroup")
+    public JSONObject testAddGroup(@RequestParam(name = "groupName") String groupName, @RequestParam(name = "elToken",required = false) String elToken){
+        return restClientService.addGroup(groupName,elToken);
+    }
+
+    @AutoLog(value = "IoTEdge-删除组织")
+    @ApiOperation(value="IoTEdge-删除组织", notes="IoTEdge-删除组织")
+    @PostMapping(value = "/testDeleteGroup")
+    public JSONObject testDeleteGroup(@RequestParam(name = "groupId") String groupId, @RequestParam(name = "elToken",required = false) String elToken){
+        return restClientService.deleteGroup(groupId,elToken);
+    }
+
+    @AutoLog(value = "SSO-登录")
+    @ApiOperation(value="SSO-登录", notes="SSO-登录")
+    @PostMapping(value = "/testGetSSOToken")
+    public String testGetSSOToken(){
+        return restClientService.getSSOToken();
+    }
+
+
+    @AutoLog(value = "SSO-修改组织名称时获取clientId/clientSecret")
+    @ApiOperation(value="SSO-修改组织名称时获取clientId/clientSecret", notes="SSO-修改组织名称时获取clientId/clientSecret")
+    @PostMapping(value = "/testGetClientInfo")
+    public JSONObject testGetClientInfo(){
+        return restClientService.getClientInfo();
+    }
+
+    @AutoLog(value = "SSO-修改组织名称时获取accessToken")
+    @ApiOperation(value="SSO-修改组织名称时获取accessToken", notes="SSO-修改组织名称时获取accessToken")
+    @PostMapping(value = "/testGetClientToken")
+    public String testGetClientToken(){
+        return restClientService.getClientToken();
+    }
+
+    @AutoLog(value = "IoTEdge-修改组织")
+    @ApiOperation(value="IoTEdge-修改组织", notes="IoTEdge-修改组织")
+    @PostMapping(value = "/testUpdateGroup")
+    public JSONObject testUpdateGroup(@RequestParam(name = "groupName") String groupName, @RequestParam(name = "groupId",required = false) String groupId){
+        return restClientService.updateGroup(groupName,groupId);
+    }
+
+    @AutoLog(value = "IoTEdge-获取所有的组织")
+    @ApiOperation(value="IoTEdge-获取所有的组织", notes="IoTEdge-获取所有的组织")
+    @PostMapping(value = "/testGetAllGroup")
+    public JSONObject testGetAllGroup(){
+        return restClientService.getAllGroup();
+    }
+
+    @AutoLog(value = "SSO-新增SSO用户时获取clientId/clientSecret")
+    @ApiOperation(value="SSO-新增SSO用户时获取clientId/clientSecret", notes="SSO-新增SSO用户时获取clientId/clientSecret")
+    @PostMapping(value = "/testPostClinetInfo")
+    public JSONObject testPostClinetInfo(){
+        return restClientService.postClinetInfo();
+    }
+
+    @AutoLog(value = "SSO-新增SSO用户时获取clientToken")
+    @ApiOperation(value="SSO-新增SSO用户时获取clientToken", notes="SSO-新增SSO用户时获取clientToken")
+    @PostMapping(value = "/testGetClientToken2")
+    public String testGetClientToken2(){
+        return restClientService.getClientToken2();
+    }
+
+    @AutoLog(value = "SSO-新增SSO用户")
+    @ApiOperation(value="SSO-新增SSO用户", notes="SSO-新增SSO用户")
+    @PostMapping(value = "/testAddSSOUser")
+    public JSONObject testAddSSOUser(@RequestParam(name = "userName",required = false) String userName, @RequestParam(name = "password",required = false) String password){
+        return restClientService.addSSOUser(userName,password);
+    }
+
+    @AutoLog(value = "IoTEdge-邀请SSO用户")
+    @ApiOperation(value="IoTEdge-邀请SSO用户", notes="IoTEdge-邀请SSO用户")
+    @PostMapping(value = "/testInvitationSSOUserInIoTEdge")
+    public JSONObject testInvitationSSOUserInIoTEdge(@RequestParam(name = "userName",required = false) String userName, @RequestParam(name = "elToken",required = false) String elToken){
+        return restClientService.invitationSSOUserInIoTEdge(userName,elToken);
+    }
+
+    @AutoLog(value = "IoTEdge-给用户分配角色")
+    @ApiOperation(value="IoTEdge-给用户分配角色", notes="IoTEdge-给用户分配角色")
+    @PostMapping(value = "/testSetUserRole")
+    public JSONObject testSetUserRole(@RequestParam(name = "userId",required = false) String userId,@RequestParam(name = "groupId",required = false) String groupId,@RequestParam(name = "rloe",required = false) String rloe, @RequestParam(name = "elToken",required = false) String elToken){
+        return restClientService.setUserRole(userId,groupId,rloe,elToken);
+    }
+
+    @AutoLog(value = "IoTEdge-删除用户权限")
+    @ApiOperation(value="IoTEdge-删除用户权限", notes="IoTEdge-删除用户权限")
+    @PostMapping(value = "/testDeleteUserRole")
+    public JSONObject testDeleteUserRole(@RequestParam(name = "userId",required = false) String userId,@RequestParam(name = "groupId",required = false) String groupId,@RequestParam(name = "rloe",required = false) String rloe, @RequestParam(name = "elToken",required = false) String elToken){
+        return restClientService.deleteUserRole(userId,groupId,rloe,elToken);
+    }
+
+    @AutoLog(value = "SSO-判断用户是否已经存在")
+    @ApiOperation(value="SSO-判断用户是否已经存在", notes="SSO-判断用户是否已经存在")
+    @PostMapping(value = "/testIfUserInSSO")
+    public JSONObject testIfUserInSSO(@RequestParam(name = "userName",required = false) String userName){
+        return restClientService.ifUserInSSO(userName);
+    }
+
+}

+ 1 - 1
jeecg-module-interlock/src/main/java/org/jeecg/modules/iotedgeCollectData/controller/IotedgeCollectDataController.java

@@ -253,7 +253,7 @@ public class IotedgeCollectDataController extends JeecgController<IotedgeCollect
 	 @AutoLog(value = "IoTEdge-SSO-判断用户是否存在")
 	 @ApiOperation(value="IoTEdge-SSO-判断用户是否存在", notes="IoTEdge-SSO-判断用户是否存在")
 	 @PostMapping(value = "/ifUserInSoo")
-	 public Result<Boolean> ifUserNameInSSO(@RequestParam(name = "userName") String userName){
+	 public Result<Boolean> ifUserNameInSSO(@RequestBody String userName){
 		 JSONObject jsonObject = restClientService.ifUserInSSO(userName);
 		 Boolean existing = (Boolean) jsonObject.get("existing");
 		 return Result.OK(existing);

+ 1 - 1
jeecg-module-interlock/src/main/java/org/jeecg/modules/iotedgeCollectData/service/RestClientService.java

@@ -248,7 +248,7 @@ public class RestClientService {
     *   des: sso登录
     *   date: 2024/8/1
     */
-    private String getSSOToken(){
+    public String getSSOToken(){
         //String url = "http://127.0.0.1:8188/v4.0/auth/native";
         String url = configService.getConfigValue(ConfigInfo.SSO_LOGIN_URL);
         String username = configService.getConfigValue(ConfigInfo.SSO_SYS_USERNAME);

+ 18 - 1
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/quartz/controller/QuartzJobController.java

@@ -66,7 +66,7 @@ public class QuartzJobController {
 	public Result<?> queryPageList(QuartzJob quartzJob, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
 			@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
 		QueryWrapper<QuartzJob> queryWrapper = QueryGenerator.initQueryWrapper(quartzJob, req.getParameterMap());
-		queryWrapper.eq("parameter","day").or().eq("parameter","month").or().eq("parameter","year");
+		//queryWrapper.eq("parameter","day").or().eq("parameter","month").or().eq("parameter","year");
 		Page<QuartzJob> page = new Page<QuartzJob>(pageNo, pageSize);
 		IPage<QuartzJob> pageList = quartzJobService.page(page, queryWrapper);
         return Result.ok(pageList);
@@ -74,6 +74,23 @@ public class QuartzJobController {
 	}
 
 	/**
+	*   author: dzc
+	*   version: 1.0
+	*   des: 用于定时任务菜单的查询
+	*   date: 2024/9/2
+	*/
+	@RequestMapping(value = "/list1", method = RequestMethod.GET)
+	public Result<?> queryPageList1(QuartzJob quartzJob, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+								   @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
+		QueryWrapper<QuartzJob> queryWrapper = QueryGenerator.initQueryWrapper(quartzJob, req.getParameterMap());
+		queryWrapper.eq("parameter","day").or().eq("parameter","month").or().eq("parameter","year");
+		Page<QuartzJob> page = new Page<QuartzJob>(pageNo, pageSize);
+		IPage<QuartzJob> pageList = quartzJobService.page(page, queryWrapper);
+		return Result.ok(pageList);
+
+	}
+
+	/**
 	 * 添加定时任务
 	 *
 	 * @param quartzJob