From acdcf5b25c387652453f6f4ae55321a47408903b Mon Sep 17 00:00:00 2001 From: dinggang <2498628697@qq.com> Date: Tue, 15 Nov 2022 16:50:24 +0800 Subject: [PATCH 01/22] =?UTF-8?q?1.=E5=A2=9E=E5=8A=A0=E5=85=81=E8=AE=B8?= =?UTF-8?q?=E8=B4=A6=E5=8F=B7=E5=A4=9A=E5=9C=B0=E5=90=8C=E6=97=B6=E5=9C=A8?= =?UTF-8?q?=E7=BA=BF=E5=8A=9F=E8=83=BD=202.=E5=8E=BB=E9=99=A4=E6=97=A0?= =?UTF-8?q?=E7=94=A8=E6=B3=A8=E5=85=A5=203.=E4=BA=91=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E5=92=8C=E4=BA=91=E8=A7=86=E9=A2=91=E8=B0=83=E7=94=A8=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86=204.=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E7=AE=A1=E7=90=86=E6=96=B0=E5=A2=9E=E6=8C=89=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E6=A8=A1=E7=B3=8A=E6=9F=A5=E8=AF=A2=205.=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E5=AD=97=E5=85=B8=E8=A1=A8=E6=96=B0=E5=A2=9E=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ResourceController.java | 27 ------------------- .../service/impl/ResourceServiceImpl.java | 17 ++++++++++-- .../modules/security/oauth2/Oauth2Realm.java | 19 +++++++++++-- .../sys/controller/SysMenuController.java | 4 +-- .../io/renren/modules/sys/dao/SysMenuDao.java | 2 +- .../modules/sys/service/SysMenuService.java | 2 +- .../sys/service/impl/SysMenuServiceImpl.java | 6 ++--- .../src/main/resources/db/R__del_token.sql | 7 +++++ .../main/resources/db/V7.3__add_sys_data.sql | 11 ++++++++ .../mapper/sys/AbilityApplicationService.xml | 26 ------------------ .../main/resources/mapper/sys/SysMenuDao.xml | 16 +++++++---- .../resources/mapper/sys/SysUserTokenDao.xml | 2 +- 12 files changed, 69 insertions(+), 70 deletions(-) create mode 100644 renren-admin/src/main/resources/db/R__del_token.sql create mode 100644 renren-admin/src/main/resources/db/V7.3__add_sys_data.sql delete mode 100644 renren-admin/src/main/resources/mapper/sys/AbilityApplicationService.xml diff --git a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java index 836306fe..fc628c0f 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java @@ -82,33 +82,6 @@ public class ResourceController { @Value("${qdyjj.ipAndPort}") private String ipAndPort; - @Value("${zsk.appid}") - private String appId; - - @Value("${zsk.appkey}") - private String appKey; - - @Value("${zsk.url.sign}") - private String sign; - - @Value("${zsk.url.gateway}") - private String gateway; - - @Value("${zsk.methodId}") - private String methodId; - - @Value("${zsk.param.charset}") - private String charset; - - @Value("${zsk.param.origin}") - private String origin; - - @Value("${zsk.param.version}") - private String version; - - @Value("${zsk.catalogIds}") - private String[] catalogIds; - @Value("${resource.path}") private String uploadPath; diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java index c472dd83..3efa2614 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java @@ -83,6 +83,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; +import org.springframework.web.client.RestClientException; import org.springframework.web.client.RestTemplate; import javax.annotation.Resource; @@ -2742,7 +2743,13 @@ public class ResourceServiceImpl extends CrudServiceImpl requestEntity = new HttpEntity(param, new HttpHeaders()); - return restTemplate.postForEntity("http://15.72.183.88:8760/yzy/main/cloudresource/getResourceBusinessList", requestEntity, String.class).getBody(); + String body; + try { + body = restTemplate.postForEntity("http://15.72.183.88:8760/yzy/main/cloudresource/getResourceBusinessList", requestEntity, String.class).getBody(); + } catch (RestClientException e) { + throw new RuntimeException("云资源数据查询失败!"); + } + return body; } @Override @@ -2752,7 +2759,13 @@ public class ResourceServiceImpl extends CrudServiceImpl requestEntity = new HttpEntity(param, new HttpHeaders()); - return restTemplate.postForEntity("http://15.72.183.88:8760/yzy/main/cloudresource/getVideoBusinessList", requestEntity, String.class).getBody(); + String body; + try { + body = restTemplate.postForEntity("http://15.72.183.88:8760/yzy/main/cloudresource/getVideoBusinessList", requestEntity, String.class).getBody(); + } catch (RestClientException e) { + throw new RuntimeException("云视频查询失败!"); + } + return body; } } \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/security/oauth2/Oauth2Realm.java b/renren-admin/src/main/java/io/renren/modules/security/oauth2/Oauth2Realm.java index 4e1a7d41..88f2405e 100644 --- a/renren-admin/src/main/java/io/renren/modules/security/oauth2/Oauth2Realm.java +++ b/renren-admin/src/main/java/io/renren/modules/security/oauth2/Oauth2Realm.java @@ -13,6 +13,7 @@ import org.apache.shiro.authz.SimpleAuthorizationInfo; import org.apache.shiro.realm.AuthorizingRealm; import org.apache.shiro.subject.PrincipalCollection; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import java.util.List; @@ -26,6 +27,9 @@ public class Oauth2Realm extends AuthorizingRealm { @Autowired private ShiroService shiroService; + @Value("${system.allowSimultaneousLogin}") + private int allowSimultaneousLogin; + @Override public boolean supports(AuthenticationToken token) { return token instanceof Oauth2Token; @@ -55,8 +59,15 @@ public class Oauth2Realm extends AuthorizingRealm { //根据accessToken,查询用户信息 SysUserTokenEntity tokenEntity = shiroService.getByToken(accessToken); + + //判断是否允许同时登录,0:不允许,1:允许 + //允许同时在线时不校验过期时间 + if (allowSimultaneousLogin != 1 && tokenEntity.getExpireDate().getTime() < System.currentTimeMillis()) { + throw new IncorrectCredentialsException(MessageUtils.getMessage(ErrorCode.TOKEN_INVALID)); + } + //token失效 - if (tokenEntity == null || tokenEntity.getExpireDate().getTime() < System.currentTimeMillis()) { + if (tokenEntity == null) { throw new IncorrectCredentialsException(MessageUtils.getMessage(ErrorCode.TOKEN_INVALID)); } @@ -66,11 +77,15 @@ public class Oauth2Realm extends AuthorizingRealm { //转换成UserDetail对象 UserDetail userDetail = ConvertUtils.sourceToTarget(userEntity, UserDetail.class); - //账号锁定 + //账号停用 if (userDetail.getStatus() == 0) { throw new LockedAccountException(MessageUtils.getMessage(ErrorCode.ACCOUNT_LOCK)); } + if (userDetail.getStatus() == 2) { + throw new LockedAccountException(MessageUtils.getMessage(500 ,"账号已锁定!")); + } + //获取用户对应的部门数据权限 List deptIdList = shiroService.getDataScopeList(userDetail.getId()); userDetail.setDeptIdList(deptIdList); diff --git a/renren-admin/src/main/java/io/renren/modules/sys/controller/SysMenuController.java b/renren-admin/src/main/java/io/renren/modules/sys/controller/SysMenuController.java index cb808686..b56a5de4 100644 --- a/renren-admin/src/main/java/io/renren/modules/sys/controller/SysMenuController.java +++ b/renren-admin/src/main/java/io/renren/modules/sys/controller/SysMenuController.java @@ -55,8 +55,8 @@ public class SysMenuController { @ApiOperation("列表") @ApiImplicitParam(name = "type", value = "菜单类型 0:菜单 1:按钮 null:全部", paramType = "query", dataType = "int") // @RequiresPermissions("sys:menu:list") - public Result> list(Integer type) { - List list = sysMenuService.getAllMenuList(type); + public Result> list(Integer type, String name) { + List list = sysMenuService.getAllMenuList(type, name); return new Result>().ok(list); } diff --git a/renren-admin/src/main/java/io/renren/modules/sys/dao/SysMenuDao.java b/renren-admin/src/main/java/io/renren/modules/sys/dao/SysMenuDao.java index e9470d12..4a1467a2 100644 --- a/renren-admin/src/main/java/io/renren/modules/sys/dao/SysMenuDao.java +++ b/renren-admin/src/main/java/io/renren/modules/sys/dao/SysMenuDao.java @@ -21,7 +21,7 @@ public interface SysMenuDao extends BaseDao { * @param type 菜单类型 * @param language 语言 */ - List getMenuList(@Param("type") Integer type, @Param("language") String language); + List getMenuList(@Param("type") Integer type, @Param("language") String language, @Param("name") String name); /** * 查询用户菜单列表 diff --git a/renren-admin/src/main/java/io/renren/modules/sys/service/SysMenuService.java b/renren-admin/src/main/java/io/renren/modules/sys/service/SysMenuService.java index 28c007f4..57a8a328 100644 --- a/renren-admin/src/main/java/io/renren/modules/sys/service/SysMenuService.java +++ b/renren-admin/src/main/java/io/renren/modules/sys/service/SysMenuService.java @@ -26,7 +26,7 @@ public interface SysMenuService extends BaseService { * * @param type 菜单类型 */ - List getAllMenuList(Integer type); + List getAllMenuList(Integer type, String name); /** * 用户菜单列表 diff --git a/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysMenuServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysMenuServiceImpl.java index a505fa67..f97029c7 100644 --- a/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysMenuServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysMenuServiceImpl.java @@ -76,8 +76,8 @@ public class SysMenuServiceImpl extends BaseServiceImpl getAllMenuList(Integer type) { - List menuList = baseDao.getMenuList(type, HttpContextUtils.getLanguage()); + public List getAllMenuList(Integer type, String name) { + List menuList = baseDao.getMenuList(type, HttpContextUtils.getLanguage(), name); List dtoList = ConvertUtils.sourceToTarget(menuList, SysMenuDTO.class); @@ -90,7 +90,7 @@ public class SysMenuServiceImpl extends BaseServiceImpl - - - - - - - - - - update sys_user_token set expire_date = #{expireDate} where user_id = #{userId} - - - - \ No newline at end of file diff --git a/renren-admin/src/main/resources/mapper/sys/SysMenuDao.xml b/renren-admin/src/main/resources/mapper/sys/SysMenuDao.xml index bae830e0..8832dd90 100644 --- a/renren-admin/src/main/resources/mapper/sys/SysMenuDao.xml +++ b/renren-admin/src/main/resources/mapper/sys/SysMenuDao.xml @@ -14,14 +14,20 @@ diff --git a/renren-admin/src/main/resources/mapper/sys/SysUserTokenDao.xml b/renren-admin/src/main/resources/mapper/sys/SysUserTokenDao.xml index a740f630..29328e61 100644 --- a/renren-admin/src/main/resources/mapper/sys/SysUserTokenDao.xml +++ b/renren-admin/src/main/resources/mapper/sys/SysUserTokenDao.xml @@ -8,7 +8,7 @@ From 7e54dcebba6a68d2408b79fe7b5e4f90d5e93c9a Mon Sep 17 00:00:00 2001 From: dinggang <2498628697@qq.com> Date: Tue, 15 Nov 2022 16:52:20 +0800 Subject: [PATCH 02/22] =?UTF-8?q?=E6=BC=8F=E6=8F=90=E4=BA=86...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SysUserTokenServiceImpl.java | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/renren-admin/src/main/java/io/renren/modules/security/service/impl/SysUserTokenServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/security/service/impl/SysUserTokenServiceImpl.java index afc3307b..5b2460e3 100644 --- a/renren-admin/src/main/java/io/renren/modules/security/service/impl/SysUserTokenServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/security/service/impl/SysUserTokenServiceImpl.java @@ -12,6 +12,7 @@ import io.renren.modules.security.entity.SysUserTokenEntity; import io.renren.modules.security.oauth2.TokenGenerator; import io.renren.modules.security.service.SysUserTokenService; import io.renren.modules.sys.entity.SysOnlineEntity; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import java.util.Date; @@ -21,11 +22,17 @@ import java.util.Map; @Service public class SysUserTokenServiceImpl extends BaseServiceImpl implements SysUserTokenService { + + /** * 12小时后过期 */ private final static int EXPIRE = 3600 * 12; + @Value("${system.allowSimultaneousLogin}") + private int allowSimultaneousLogin; + + /* @Override public Result createToken(Long userId) { //用户token @@ -81,6 +88,56 @@ public class SysUserTokenServiceImpl extends BaseServiceImpl map = new HashMap<>(2); + map.put(Constant.TOKEN_HEADER, token); + map.put("expire", EXPIRE); + return new Result().ok(map); + } + @Override public void logout(Long userId) { From 5e403b6ae6be0dd6473845c5db3a7562da47a15d Mon Sep 17 00:00:00 2001 From: dinggang <2498628697@qq.com> Date: Thu, 17 Nov 2022 14:52:55 +0800 Subject: [PATCH 03/22] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E8=83=BD=E5=8A=9B=E7=BB=9F=E8=AE=A1-=E8=83=BD=E5=8A=9B?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E7=BB=9F=E8=AE=A1=E6=9F=A5=E8=AF=A2=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E9=83=A8=E9=97=A8=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=BF=AE=E6=94=B9-=E5=8F=AA=E6=9F=A5=E8=AF=A2=E6=9C=89?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E8=AE=B0=E5=BD=95=E7=9A=84=E9=83=A8=E9=97=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TAbilityApplicationController.java | 10 ++++++++ .../dao/TAbilityApplicationDao.java | 2 ++ .../service/TAbilityApplicationService.java | 7 ++++++ .../impl/TAbilityApplicationServiceImpl.java | 6 +++++ .../processForm/TAbilityApplicationDao.xml | 23 +++++++++++++++++++ .../resources/mapper/resource/ResourceDao.xml | 1 + 6 files changed, 49 insertions(+) diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/controller/TAbilityApplicationController.java b/renren-admin/src/main/java/io/renren/modules/processForm/controller/TAbilityApplicationController.java index e73d3b5a..bdd8ccf3 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/controller/TAbilityApplicationController.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/controller/TAbilityApplicationController.java @@ -213,10 +213,13 @@ public class TAbilityApplicationController { put("apply_flag", applyFlag); // 限定 } }; + + /* 2022-11-16 去除对用户角色的判断,在后台能力统计处都可以看到申请详情 // 非超级管理员,只出本人 if (user.getSuperAdmin() == SuperAdminEnum.NO.value()) { params.put("user_id", user == null ? null : user.getId()); } + */ List applicationDTOS = tAbilityApplicationService.list(params); Map> result = applicationDTOS.stream().collect(Collectors.groupingBy(t -> { SysDeptDTO sysDeptDTO = t.getResourceOwnerDept(); @@ -443,4 +446,11 @@ public class TAbilityApplicationController { return new Result(); } + @GetMapping("getApplyDeptList") + @ApiOperation("/获取申请部门列表") + @LogOperation("/获取申请部门列表") + public Result getApplyDeptList() { + return new Result().ok(tAbilityApplicationService.getApplyDeptList()); + } + } \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/dao/TAbilityApplicationDao.java b/renren-admin/src/main/java/io/renren/modules/processForm/dao/TAbilityApplicationDao.java index 37f4e35d..b76b42fe 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/dao/TAbilityApplicationDao.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/dao/TAbilityApplicationDao.java @@ -47,4 +47,6 @@ public interface TAbilityApplicationDao extends BaseDao getInstanceIdByResId(Long id); + + List getApplyDeptList(); } \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/service/TAbilityApplicationService.java b/renren-admin/src/main/java/io/renren/modules/processForm/service/TAbilityApplicationService.java index 7eeadb89..5d379a62 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/service/TAbilityApplicationService.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/service/TAbilityApplicationService.java @@ -51,4 +51,11 @@ public interface TAbilityApplicationService extends CrudService implements TAbilityApplicationService { private static final Logger logger = LoggerFactory.getLogger(TAbilityApplicationServiceImpl.class); + private TAbilityApplicationDao abilityApplicationDao; @Override public QueryWrapper getWrapper(Map params) { @@ -131,5 +132,10 @@ public class TAbilityApplicationServiceImpl extends CrudServiceImpl SELECT instance_id FROM t_ability_application WHERE resource_id = #{id} + + \ No newline at end of file diff --git a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml index fe8b2de6..309a3f44 100644 --- a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml +++ b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml @@ -2322,6 +2322,7 @@ 1 = 1 AND tdr.del_flag = 0 AND tdr.dept_id = #{deptId} + AND tdr.type = '应用资源' AND tdr.name like CONCAT('%', #{key}, '%') From 89de07eac0255cfba953dc0fcba0521011e111e4 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Fri, 18 Nov 2022 11:12:12 +0800 Subject: [PATCH 04/22] =?UTF-8?q?=E6=94=BF=E5=8A=A1=E4=BA=91=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E8=B5=84=E6=BA=90=20=E6=9C=AC=E5=9C=B0=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resource/controller/ResourceController.java | 17 +++++++++++++++++ .../db/V7.4__create_policy_cloud_service.sql | 14 ++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 renren-admin/src/main/resources/db/V7.4__create_policy_cloud_service.sql diff --git a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java index fc628c0f..6415e8b0 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java @@ -912,4 +912,21 @@ public class ResourceController { } } + @PostMapping("/getPolicyCloudService") + @ApiOperation("/获取政务云服务资源") + @LogOperation("/获取政务云服务资源") + public Result>> getPolicyCloudService(@RequestParam Map params) { + int page = 1; + int pageSize = 10; + if (params.containsKey("limit") && org.apache.commons.lang3.StringUtils.isNotBlank(params.get("limit").toString())) { + pageSize = Integer.parseInt(params.get("limit").toString()); + } + if (params.containsKey("page") && org.apache.commons.lang3.StringUtils.isNotBlank(params.get("page").toString())) { + page = Integer.parseInt(params.get("page").toString()); + } + String sql = String.format("SELECT * FROM policy_cloud_service LIMIT %d,%d", page * pageSize, pageSize); + List> result = jdbcTemplate.queryForList(sql); + return new Result>>().ok(new PageData<>(result, jdbcTemplate.queryForObject("SELECT COUNT(*) FROM policy_cloud_service", Long.class))); + } + } \ No newline at end of file diff --git a/renren-admin/src/main/resources/db/V7.4__create_policy_cloud_service.sql b/renren-admin/src/main/resources/db/V7.4__create_policy_cloud_service.sql new file mode 100644 index 00000000..6b8148ba --- /dev/null +++ b/renren-admin/src/main/resources/db/V7.4__create_policy_cloud_service.sql @@ -0,0 +1,14 @@ +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; +DROP TABLE IF EXISTS `policy_cloud_service`; +CREATE TABLE `policy_cloud_service` ( + `service_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, + `service_item_tier1` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `service_item_tier2` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `service_description` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `specification` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `remark` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `year` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL + PRIMARY KEY (`service_type`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; +SET FOREIGN_KEY_CHECKS = 1; From 5668ae110ddb599bc02919f6f68e21a93854ce7c Mon Sep 17 00:00:00 2001 From: wangliwen Date: Fri, 18 Nov 2022 12:41:45 +0800 Subject: [PATCH 05/22] ... --- .../controller/ResourceController.java | 12 +++- .../db/V7.4__create_policy_cloud_service.sql | 70 ++++++++++++++++++- 2 files changed, 76 insertions(+), 6 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java index 6415e8b0..1d416b8f 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java @@ -915,7 +915,7 @@ public class ResourceController { @PostMapping("/getPolicyCloudService") @ApiOperation("/获取政务云服务资源") @LogOperation("/获取政务云服务资源") - public Result>> getPolicyCloudService(@RequestParam Map params) { + public Result>> getPolicyCloudService(@RequestBody Map params) { int page = 1; int pageSize = 10; if (params.containsKey("limit") && org.apache.commons.lang3.StringUtils.isNotBlank(params.get("limit").toString())) { @@ -924,9 +924,15 @@ public class ResourceController { if (params.containsKey("page") && org.apache.commons.lang3.StringUtils.isNotBlank(params.get("page").toString())) { page = Integer.parseInt(params.get("page").toString()); } - String sql = String.format("SELECT * FROM policy_cloud_service LIMIT %d,%d", page * pageSize, pageSize); + String sql = String.format("SELECT * FROM policy_cloud_service LIMIT %d,%d", (page - 1) * pageSize, pageSize); + long count = jdbcTemplate.queryForObject("SELECT COUNT(*) FROM policy_cloud_service", Long.class); + if (params.containsKey("name") && org.apache.commons.lang3.StringUtils.isNotBlank(params.get("name").toString())) { + sql = String.format("SELECT * FROM policy_cloud_service WHERE service_description LIKE '%s' LIMIT %d,%d", "%" + params.get("name").toString() + "%", (page - 1) * pageSize, pageSize); + count = jdbcTemplate.queryForObject(String.format("SELECT COUNT(*) FROM policy_cloud_service WHERE service_description LIKE '%s'", "%" + params.get("name").toString() + "%"), Long.class); + } + logger.info("sql:" + sql); List> result = jdbcTemplate.queryForList(sql); - return new Result>>().ok(new PageData<>(result, jdbcTemplate.queryForObject("SELECT COUNT(*) FROM policy_cloud_service", Long.class))); + return new Result>>().ok(new PageData<>(result, count)); } } \ No newline at end of file diff --git a/renren-admin/src/main/resources/db/V7.4__create_policy_cloud_service.sql b/renren-admin/src/main/resources/db/V7.4__create_policy_cloud_service.sql index 6b8148ba..9f40fe5a 100644 --- a/renren-admin/src/main/resources/db/V7.4__create_policy_cloud_service.sql +++ b/renren-admin/src/main/resources/db/V7.4__create_policy_cloud_service.sql @@ -1,14 +1,78 @@ SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for policy_cloud_service +-- ---------------------------- DROP TABLE IF EXISTS `policy_cloud_service`; CREATE TABLE `policy_cloud_service` ( `service_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `service_item_tier1` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, `service_item_tier2` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, - `service_description` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `service_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL, `specification` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, `remark` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, `year` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL - PRIMARY KEY (`service_type`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of policy_cloud_service +-- ---------------------------- +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置1H4G', '1H4G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置1H4G', '1H4G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置2H4G', '2H4G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置2H8G', '2H8G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置2H16G', '2H16G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置4H8G', '4H8G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置4H16G', '4H16G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置4H32G', '4H32G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置8H16G', '8H16G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置8H32G', '8H32G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置8H64G', '8H64G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置16H32G', '16H32G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置16H64G', '16H64G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置32H64G', '32H64G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置32H128G', '32H128G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机系统盘', '云主机系统盘', '40G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机数据盘', '云主机数据盘', '100G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '非结构化数据对象存储服务', '非结构化数据对象存储服务', '100G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '数据异地容灾服务', '数据异地容灾服务', '100G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '数据本地备份及快速恢复服务', '数据本地备份及快速恢复服务', '100G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('基础服务', '机柜服务', '机柜租赁服务', '机柜租赁服务', '1', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('PaaS服务', '数据库', '云数据库RDS for MySQL', '云数据库RDS for MySQL', '1200MB内存', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('PaaS服务', '数据库', '云数据库RDS for MySQL', '云数据库RDS for MySQL', '2400MB内存', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('PaaS服务', '数据库', '云数据库RDS for MySQL', '云数据库RDS for MySQL', '6000MB内存', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('PaaS服务', '数据库', '云数据库RDS for MySQL', '云数据库RDS for MySQL', '12000MB内存', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('PaaS服务', '数据库', '云数据库RDS for MSSQL Server', '云数据库RDS for MS SQL Server', '1000MB内存', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('PaaS服务', '数据库', '云数据库RDS for MSSQL Server', '云数据库RDS for MS SQL Server', '12000MB内存', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('PaaS服务', '数据库', '云数据库RDS for MSSQL Server', '云数据库RDS for MS SQL Server', '4000MB内存', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('PaaS服务', '数据库', '云数据库RDS for MSSQL Server', '云数据库RDS for MS SQL Server', '6000MB内存', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('PaaS服务', '数据库', '云数据库RDS for MSSQL Server', '云数据库RDS for MS SQL Server', '12000MB内存', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('PaaS服务', '数据库', '云数据库数据盘', '云数据库数据盘', '100MB内存', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('PaaS服务', '负载均衡', '负载均衡服务', '负载均衡服务', '实例', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('安全服务', '主机数据库应用安全服务', '等保三级标准服务', '云主机安全服务-等保三级服务', '云主机', '必选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('安全服务', '主机数据库应用安全服务', '数据安全服务', '数据安全服务', '数据库实例', '必选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('安全服务', '主机数据库应用安全服务', '应用安全服务', '应用安全服务', '云主机', '必选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('运营服务', '增值服务', '同城应用容灾服务', '同城应用容灾服务', '云主机', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('大数据服务', '数据分析服务', '数据分析服务', '数据分析服务数据离线计算', '1', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('大数据服务', '数据分析服务', '数据分析服务', '数据分析服务数据实时计算', '1', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('大数据服务', '数据分析服务', '数据分析服务', '数据分析服务数据同步服务', '1', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('大数据服务', '数据脱敏服务', '数据脱敏服务', '数据脱敏服务隐私数据发现', '套', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('大数据服务', '数据脱敏服务', '数据脱敏服务', '数据脱敏服务隐私数据漂泊', '1', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('大数据服务', '大数据存储', '非结构化数据存储', '大数据存储服务非结构化数据存储', '1', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('大数据服务', '大数据存储', '结构化数据存储', '大数据存储服务结构化数据存储', '1', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('附加增值服务', '操作系统和其他中间件', '商用操作系统套餐', 'Windows server 2008 、2012、2016数据中心版等安装、授权激活、维护', '云主机', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('附加增值服务', '操作系统和其他中间件', '商用操作系统套餐', 'Redhat 6.6以上不同版本系统安装和维护', '云主机', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('附加增值服务', '操作系统和其他中间件', '商用操作系统套餐', 'CentOS 6.5以上不同版本系统安装和维护', '云主机', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('附加增值服务', '操作系统和其他中间件', '桌面云基础套餐', '双核(1.6Ghz)/3G内存/40G系统盘/100G数据盘;6个USB口、1个VGA接口或1个HDMI接口,音频输入输出接口。支持1920*1200桌面分辨率。含瘦终端、分屏器、软件升级费用,不包含鼠标、键盘等外设费用', '个', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('附加增值服务', '操作系统和其他中间件', '桌面云基础套餐', '双核(1.6Ghz)/3G内存/40G系统盘/100G数据盘;6个USB口、1个VGA接口或1个HDMI接口,音频输入输出接口。支持1920*1200桌面分辨率。含瘦终端、分屏器、软件升级费用,不包含鼠标、键盘等外设费用', '个', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('附加增值服务', '操作系统和其他中间件', '桌面云标准套餐', '双核(2.0Ghz)/5G内存/40G系统盘/100G数据盘;6个USB口、1个VGA接口或1个HDMI接口,音频输入输出接口。支持1920*1200桌面分辨率。含瘦终端、分屏器、软件升级费用,不包含鼠标、键盘等外设费用', '个', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('附加增值服务', '操作系统和其他中间件', '桌面云高级套餐', '四核2.4GHz、8G内存/40G系统盘/100G数据盘;6个USB口、1个VGA接口和1个HDMI接口,音频输入输出接口。支持1920*1200桌面分辨率。含瘦终端、分屏器、软件升级费用,不包含鼠标、键盘等外设费用', '个', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('附加增值服务', '操作系统和其他中间件', '桌面云数据盘', '以100GB为单位', '100G', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('附加增值服务', '云安全保障增值服务', '信息系统二级等级保护测评服务', '按照国家公安部门等级保护制度要求提供物理安全、网络安全、主机安全、数据安全、应用安全等测评服务(二级)。本服务目录价格为省公安厅最低价。', '信息系统', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('附加增值服务', '云安全保障增值服务', '信息系统三级等级保护测评服务', '按照国家公安部门等级保护制度要求提供物理安全、网络安全、主机安全、数据安全、应用安全等测评服务(三级)。本服务目录价格为省公安厅最低价。', '信息系统', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('附加增值服务', '云安全保障增值服务', '网页防篡改服务', '增强版网页防篡改服务。', '云主机', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('附加增值服务', '云安全保障增值服务', '商用密码安全评估', '按照国家《密码安全法》对云平台或云主机做商用密码安全全量评估。最终出具业内标准的商密评估报告。', '系统', '可选', '2022'); +INSERT INTO `policy_cloud_service` VALUES ('附加增值服务', '云安全保障增值服务', '蜜罐服务', '融合网络欺骗和主动防御威胁检测防御系统,通过暗设陷阱,主动诱导攻击,能够动态感知内网攻击行为,及时精准的定位攻击源,并隐匿真实资产,保障业务系统的安全运行。', '套', '可选', '2022'); + SET FOREIGN_KEY_CHECKS = 1; From d3b3c4181fab868f8792537ef69ccf3325aaa35f Mon Sep 17 00:00:00 2001 From: wangliwen Date: Fri, 18 Nov 2022 13:06:05 +0800 Subject: [PATCH 06/22] =?UTF-8?q?=E6=94=BF=E5=8A=A1=E4=BA=91=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=20=E7=B1=BB=E5=9E=8B=20=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ResourceController.java | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java index 1d416b8f..a7faaf6d 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java @@ -924,13 +924,24 @@ public class ResourceController { if (params.containsKey("page") && org.apache.commons.lang3.StringUtils.isNotBlank(params.get("page").toString())) { page = Integer.parseInt(params.get("page").toString()); } - String sql = String.format("SELECT * FROM policy_cloud_service LIMIT %d,%d", (page - 1) * pageSize, pageSize); - long count = jdbcTemplate.queryForObject("SELECT COUNT(*) FROM policy_cloud_service", Long.class); + String sql; + String sqlRoot = "SELECT * FROM policy_cloud_service "; + String where = " WHERE 1=1 "; + String limit = String.format(" LIMIT %d,%d", (page - 1) * pageSize, pageSize); + + long count = 0; + if (params.containsKey("name") && org.apache.commons.lang3.StringUtils.isNotBlank(params.get("name").toString())) { - sql = String.format("SELECT * FROM policy_cloud_service WHERE service_description LIKE '%s' LIMIT %d,%d", "%" + params.get("name").toString() + "%", (page - 1) * pageSize, pageSize); - count = jdbcTemplate.queryForObject(String.format("SELECT COUNT(*) FROM policy_cloud_service WHERE service_description LIKE '%s'", "%" + params.get("name").toString() + "%"), Long.class); + where = where + String.format(" AND service_description LIKE '%s'", "%" + params.get("name").toString() + "%"); } + if (params.containsKey("type") && org.apache.commons.lang3.StringUtils.isNotBlank(params.get("type").toString())) { + where = where + String.format(" AND service_type = '%s'", params.get("type").toString()); + } + + sql = sqlRoot + where + limit; logger.info("sql:" + sql); + String sqlCount = "SELECT COUNT(*) FROM policy_cloud_service " + where; + count = jdbcTemplate.queryForObject(sqlCount, Long.class); List> result = jdbcTemplate.queryForList(sql); return new Result>>().ok(new PageData<>(result, count)); } From d0682ef97d8d9a7d1f76e86adc46618e63a38c81 Mon Sep 17 00:00:00 2001 From: dinggang <2498628697@qq.com> Date: Fri, 18 Nov 2022 18:49:49 +0800 Subject: [PATCH 07/22] =?UTF-8?q?=E9=87=91=E5=AE=8F=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E4=B8=8D=E6=94=AF=E6=8C=81=EF=BC=8C=E6=83=B3=E5=85=B6=E4=BB=96?= =?UTF-8?q?=E5=8A=9E=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- renren-admin/src/main/resources/db/R__del_token.sql | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 renren-admin/src/main/resources/db/R__del_token.sql diff --git a/renren-admin/src/main/resources/db/R__del_token.sql b/renren-admin/src/main/resources/db/R__del_token.sql deleted file mode 100644 index 9e0a31d9..00000000 --- a/renren-admin/src/main/resources/db/R__del_token.sql +++ /dev/null @@ -1,7 +0,0 @@ -DELETE -FROM sys_user_token -WHERE id NOT IN (SELECT s.id - FROM (SELECT sut.id, - ROW_NUMBER() OVER ( PARTITION BY sut.user_id ORDER BY sut.create_date DESC ) AS group_idx - FROM sys_user_token sut) s - WHERE s.group_idx = 1); \ No newline at end of file From d891593c4b7c0fe5e5d668c9527f8c23294dfdd8 Mon Sep 17 00:00:00 2001 From: dinggang <2498628697@qq.com> Date: Mon, 21 Nov 2022 09:39:24 +0800 Subject: [PATCH 08/22] =?UTF-8?q?=E8=A5=BF=E6=B5=B7=E5=B2=B8=E5=9F=BA?= =?UTF-8?q?=E7=A1=80=E8=AE=BE=E6=96=BD=E6=96=B0=E9=9C=80=E6=B1=82-?= =?UTF-8?q?=E5=BE=85=E7=94=B3=E8=AF=B7=E5=88=97=E8=A1=A8=E5=A2=9E=E5=88=A0?= =?UTF-8?q?=E6=94=B9=E6=9F=A5=E6=8E=A5=E5=8F=A3=20=E5=B7=B2=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E6=9F=A5=E8=AF=A2=EF=BC=8C=E5=88=A0=E9=99=A4=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=20=E8=B6=85=E7=BA=A7=E7=AE=A1=E7=90=86=E5=91=98?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=83=BD=E5=8A=9B=E6=95=B0=E6=8D=AE=E6=9C=AA?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=B8=8B=E6=9E=B6=E6=B5=81=E7=A8=8B=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E6=95=B0=E6=8D=AEbug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/db/V7.1__sys_dict_data_col.sql | 4 + config/db/V7.2__sys_user_add_col.sql | 1 + config/db/V7.3__add_sys_data.sql | 11 +++ config/db/V7.4__new_table.sql | 31 ++++++++ config/db/V7.5__resource_add_col.sql | 1 + .../controller/ResourceMountController.java | 5 ++ .../TAbilityApplicationController.java | 18 +++++ .../controller/WillApplyCameraController.java | 59 +++++++++++++++ .../dao/TAbilityApplicationDao.java | 5 ++ .../processForm/dao/WillApplyCameraDao.java | 15 ++++ .../processForm/dto/WillApplyCameraDTO.java | 62 ++++++++++++++++ .../entity/WillApplyCameraEntity.java | 73 +++++++++++++++++++ .../service/TAbilityApplicationService.java | 4 + .../service/WillApplyCameraService.java | 10 +++ .../service/impl/JuApiGateway.java | 2 +- .../impl/TAbilityApplicationServiceImpl.java | 16 ++++ .../impl/WillApplyCameraServiceImpl.java | 35 +++++++++ .../modules/resource/dto/ResourceDTO.java | 3 + .../resource/entity/ResourceEntity.java | 2 + .../service/impl/ResourceServiceImpl.java | 13 +++- .../src/main/resources/db/V7.4__new_table.sql | 31 ++++++++ .../resources/db/V7.5__resource_add_col.sql | 1 + .../processForm/TAbilityApplicationDao.xml | 22 ++++++ .../mapper/processForm/WillApplyCameraDao.xml | 50 +++++++++++++ 24 files changed, 471 insertions(+), 3 deletions(-) create mode 100644 config/db/V7.1__sys_dict_data_col.sql create mode 100644 config/db/V7.2__sys_user_add_col.sql create mode 100644 config/db/V7.3__add_sys_data.sql create mode 100644 config/db/V7.4__new_table.sql create mode 100644 config/db/V7.5__resource_add_col.sql create mode 100644 renren-admin/src/main/java/io/renren/modules/processForm/controller/WillApplyCameraController.java create mode 100644 renren-admin/src/main/java/io/renren/modules/processForm/dao/WillApplyCameraDao.java create mode 100644 renren-admin/src/main/java/io/renren/modules/processForm/dto/WillApplyCameraDTO.java create mode 100644 renren-admin/src/main/java/io/renren/modules/processForm/entity/WillApplyCameraEntity.java create mode 100644 renren-admin/src/main/java/io/renren/modules/processForm/service/WillApplyCameraService.java create mode 100644 renren-admin/src/main/java/io/renren/modules/processForm/service/impl/WillApplyCameraServiceImpl.java create mode 100644 renren-admin/src/main/resources/db/V7.4__new_table.sql create mode 100644 renren-admin/src/main/resources/db/V7.5__resource_add_col.sql create mode 100644 renren-admin/src/main/resources/mapper/processForm/WillApplyCameraDao.xml diff --git a/config/db/V7.1__sys_dict_data_col.sql b/config/db/V7.1__sys_dict_data_col.sql new file mode 100644 index 00000000..3f6ffc79 --- /dev/null +++ b/config/db/V7.1__sys_dict_data_col.sql @@ -0,0 +1,4 @@ +ALTER TABLE `sys_dict_data` +ADD COLUMN `status` int NULL DEFAULT 1 COMMENT '启用状态(0未启用 1启用)' AFTER `update_date`; +ALTER TABLE `sys_dict_type` +ADD COLUMN `status` int NULL DEFAULT 1 COMMENT '启用状态(0未启用 1启用)' AFTER `update_date`; \ No newline at end of file diff --git a/config/db/V7.2__sys_user_add_col.sql b/config/db/V7.2__sys_user_add_col.sql new file mode 100644 index 00000000..299510e8 --- /dev/null +++ b/config/db/V7.2__sys_user_add_col.sql @@ -0,0 +1 @@ +ALTER TABLE `sys_user` ADD COLUMN `frequency` int NULL DEFAULT 0 COMMENT '登录失败次数'; \ No newline at end of file diff --git a/config/db/V7.3__add_sys_data.sql b/config/db/V7.3__add_sys_data.sql new file mode 100644 index 00000000..bf6ffb18 --- /dev/null +++ b/config/db/V7.3__add_sys_data.sql @@ -0,0 +1,11 @@ +INSERT INTO `sys_dict_type`(`id`, `dict_type`, `dict_name`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`, `status`) VALUES (1592357067014803457, ' encryptedRoute', '加密路由', '', 0, 1067246875800000001, '2022-11-15 11:21:24', 1067246875800000001, '2022-11-15 11:21:24', 1); + +INSERT INTO `sys_dict_data`(`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`, `status`) VALUES (1592357815098281986, 1592357067014803457, '个人中心', '/personalCenter', '', 0, 1067246875800000001, '2022-11-15 11:24:22', 1067246875800000001, '2022-11-15 11:24:22', 1); +INSERT INTO `sys_dict_data`(`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`, `status`) VALUES (1592357749759414274, 1592357067014803457, '消息通知', '/mynoticeView', '', 0, 1067246875800000001, '2022-11-15 11:24:07', 1067246875800000001, '2022-11-15 11:24:07', 1); +INSERT INTO `sys_dict_data`(`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`, `status`) VALUES (1592357668599631874, 1592357067014803457, '融合服务详情', '/integrationServicesDetails', '', 0, 1067246875800000001, '2022-11-15 11:23:47', 1067246875800000001, '2022-11-15 11:23:47', 1); +INSERT INTO `sys_dict_data`(`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`, `status`) VALUES (1592357561145757698, 1592357067014803457, '融合服务', '/integrationServices', '', 0, 1067246875800000001, '2022-11-15 11:23:22', 1067246875800000001, '2022-11-15 11:23:22', 1); +INSERT INTO `sys_dict_data`(`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`, `status`) VALUES (1592357495567814658, 1592357067014803457, '能力统计', '/abilityStatistics', '', 0, 1067246875800000001, '2022-11-15 11:23:06', 1067246875800000001, '2022-11-15 11:23:06', 1); +INSERT INTO `sys_dict_data`(`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`, `status`) VALUES (1592357417113358338, 1592357067014803457, '能力详情', '/details', '', 0, 1067246875800000001, '2022-11-15 11:22:47', 1067246875800000001, '2022-11-15 11:22:47', 1); +INSERT INTO `sys_dict_data`(`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`, `status`) VALUES (1592357337807458305, 1592357067014803457, '能力集市', '/DetailsPageconetent', '', 0, 1067246875800000001, '2022-11-15 11:22:29', 1067246875800000001, '2022-11-15 11:22:29', 1); + + diff --git a/config/db/V7.4__new_table.sql b/config/db/V7.4__new_table.sql new file mode 100644 index 00000000..9d05cda2 --- /dev/null +++ b/config/db/V7.4__new_table.sql @@ -0,0 +1,31 @@ +-- ---------------------------- +-- Table structure for t_will_apply_camera +-- ---------------------------- +DROP TABLE IF EXISTS `t_will_apply_camera`; +CREATE TABLE `t_will_apply_camera` ( + `id` bigint(0) NOT NULL COMMENT '主键ID', + `user_id` bigint(0) NULL DEFAULT NULL COMMENT '用户', + `del_flag` int(0) NULL DEFAULT NULL COMMENT '删除标志:0正常,1删除,', + `camera_point_type_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `channel_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `channel_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `channel_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `check_status` int(0) NULL DEFAULT NULL, + `gpsX` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `gpsY` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `idt_camera_channel` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `management_unit_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `node_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `parent_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `status` int(0) NULL DEFAULT NULL, + `creator` bigint(0) NULL DEFAULT NULL, + `create_date` datetime(0) NULL DEFAULT NULL, + `updater` bigint(0) NULL DEFAULT NULL, + `update_date` datetime(0) NULL DEFAULT NULL, +PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; + +SET FOREIGN_KEY_CHECKS = 1; + + + diff --git a/config/db/V7.5__resource_add_col.sql b/config/db/V7.5__resource_add_col.sql new file mode 100644 index 00000000..9d044101 --- /dev/null +++ b/config/db/V7.5__resource_add_col.sql @@ -0,0 +1 @@ +ALTER TABLE tb_data_resource ADD COLUMN `undercarriage_instance_id` bigint NULL COMMENT '下架流程实例ID'; \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/common/controller/ResourceMountController.java b/renren-admin/src/main/java/io/renren/common/controller/ResourceMountController.java index b19829de..67e7542b 100644 --- a/renren-admin/src/main/java/io/renren/common/controller/ResourceMountController.java +++ b/renren-admin/src/main/java/io/renren/common/controller/ResourceMountController.java @@ -236,6 +236,11 @@ public class ResourceMountController { ProcessInstanceDTO index_ = actRunningService.startOfBusinessKey(processStartDTO); logger.info("-------------------2.启动流程成功--------------------------"); logger.info("ProcessInstanceDTO.getBusinessKey:{}", index_.getBusinessKey()); + + //11-18 新增下架流程实例id + dto.setUndercarriageInstanceId(Long.parseLong(index_.getProcessInstanceId())); + resourceService.update(dto); + dtoList.add(index_); }); return dtoList.stream().findAny().orElse(null); diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/controller/TAbilityApplicationController.java b/renren-admin/src/main/java/io/renren/modules/processForm/controller/TAbilityApplicationController.java index bdd8ccf3..3c941356 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/controller/TAbilityApplicationController.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/controller/TAbilityApplicationController.java @@ -453,4 +453,22 @@ public class TAbilityApplicationController { return new Result().ok(tAbilityApplicationService.getApplyDeptList()); } + @GetMapping("/getApplyCameraList") + @ApiOperation("/西海岸-根据用户获取已申请摄像头列表") + @LogOperation("/西海岸-根据用户获取已申请摄像头列表") + public Result getApplyCameraList() { + return new Result().ok(tAbilityApplicationService.getApplyCameraList()); + } + + @GetMapping("/delApplyCamera") + @ApiOperation("/西海岸-用户删除已申请摄像头") + @LogOperation("/西海岸-用户删除已申请摄像头") + public Result delApplyCamera(@RequestBody List ids) { + tAbilityApplicationService.delApplyCamera(ids); + return new Result().ok("删除成功。"); + } + + + + } \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/controller/WillApplyCameraController.java b/renren-admin/src/main/java/io/renren/modules/processForm/controller/WillApplyCameraController.java new file mode 100644 index 00000000..d8657ea7 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/processForm/controller/WillApplyCameraController.java @@ -0,0 +1,59 @@ +package io.renren.modules.processForm.controller; + +import io.renren.common.annotation.LogOperation; +import io.renren.common.utils.Result; +import io.renren.modules.processForm.dto.WillApplyCameraDTO; +import io.renren.modules.processForm.entity.WillApplyCameraEntity; +import io.renren.modules.processForm.service.WillApplyCameraService; +import io.renren.modules.security.user.SecurityUser; +import io.renren.modules.security.user.UserDetail; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.List; + +@RestController +@RequestMapping("/willApplyCamera") +@Api(tags = "西海岸待申请摄像头") +public class WillApplyCameraController { + + @Autowired + private WillApplyCameraService willApplyCameraService; + + @GetMapping("/select") + @LogOperation("/查询") + @ApiOperation("/查询") + public Result select() { + UserDetail user = SecurityUser.getUser(); + return new Result().ok(willApplyCameraService.selectByUserId(user.getId())); + } + + @PostMapping("/batchInsert") + @ApiOperation("/保存") + @LogOperation("/保存") + public Result batchInsert(@RequestBody List willApplyCameraDTOList) { + ArrayList list = new ArrayList<>(); + willApplyCameraDTOList.forEach(index -> { + WillApplyCameraEntity cameraEntity = new WillApplyCameraEntity(); + BeanUtils.copyProperties(index, cameraEntity); + cameraEntity.setUserId(SecurityUser.getUserId()); + cameraEntity.setDelFlag(0); + list.add(cameraEntity); + }); + willApplyCameraService.insertBatch(list); + return new Result().ok("数据保存成功。"); + } + + @PostMapping("/batchDelete") + @ApiOperation("/删除") + @LogOperation("/删除") + public Result batchDelete(@RequestBody List ids) { + willApplyCameraService.deleteBatchIds(ids); + return new Result().ok("数据删除成功。"); + } + +} diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/dao/TAbilityApplicationDao.java b/renren-admin/src/main/java/io/renren/modules/processForm/dao/TAbilityApplicationDao.java index b76b42fe..b4a160dc 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/dao/TAbilityApplicationDao.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/dao/TAbilityApplicationDao.java @@ -3,6 +3,7 @@ package io.renren.modules.processForm.dao; import io.renren.common.dao.BaseDao; import io.renren.modules.processForm.entity.TAbilityApplicationEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Map; @@ -49,4 +50,8 @@ public interface TAbilityApplicationDao extends BaseDao getInstanceIdByResId(Long id); List getApplyDeptList(); + + List getApplyCameraList(@Param("userId") Long userId, @Param("date") String date); + + Integer delApplyCamera(@Param("ids") List ids); } \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/dao/WillApplyCameraDao.java b/renren-admin/src/main/java/io/renren/modules/processForm/dao/WillApplyCameraDao.java new file mode 100644 index 00000000..087bc513 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/processForm/dao/WillApplyCameraDao.java @@ -0,0 +1,15 @@ +package io.renren.modules.processForm.dao; + +import io.renren.common.dao.BaseDao; +import io.renren.modules.processForm.entity.WillApplyCameraEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +@Mapper +public interface WillApplyCameraDao extends BaseDao { + + List select(@Param("userId") Long userId); +} diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/dto/WillApplyCameraDTO.java b/renren-admin/src/main/java/io/renren/modules/processForm/dto/WillApplyCameraDTO.java new file mode 100644 index 00000000..9eef2d63 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/processForm/dto/WillApplyCameraDTO.java @@ -0,0 +1,62 @@ +package io.renren.modules.processForm.dto; + +import io.swagger.annotations.ApiModel; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +@Data +@ApiModel(value = "西海岸待申请摄像头") +public class WillApplyCameraDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long id; + + private Long userId; + + private Integer delFlag; + + private String cameraPointTypeName; + + private String channelCode; + + private String channelId; + + private String channelName; + + private Integer checkStatus; + + private String gpsX; + + private String gpsY; + + private String idtCameraChannel; + + private String managementUnitName; + + private String nodeName; + + private String parentId; + + private Integer status; + + /** + * 创建者 + */ + private Long creator; + /** + * 创建时间 + */ + private Date createDate; + /** + * 创建者 + */ + private Long updater; + /** + * 创建时间 + */ + private Date updateDate; + +} diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/entity/WillApplyCameraEntity.java b/renren-admin/src/main/java/io/renren/modules/processForm/entity/WillApplyCameraEntity.java new file mode 100644 index 00000000..dcb25402 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/processForm/entity/WillApplyCameraEntity.java @@ -0,0 +1,73 @@ +package io.renren.modules.processForm.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.Date; + +@Data +@EqualsAndHashCode(callSuper = false) +@TableName(value = "t_will_apply_camera", autoResultMap = true) +public class WillApplyCameraEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId + private Long id; + + private Long userId; + + private Integer delFlag; + + private String cameraPointTypeName; + + private String channelCode; + + private String channelId; + + private String channelName; + + private Integer checkStatus; + + @TableField("gpsX") + private String gpsX; + + @TableField("gpsY") + private String gpsY; + + private String idtCameraChannel; + + private String managementUnitName; + + private String nodeName; + + private String parentId; + + private Integer status; + + /** + * 创建者 + */ + @TableField(fill = FieldFill.INSERT) + private Long creator; + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + private Date createDate; + /** + * 创建者 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Long updater; + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateDate; +} diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/service/TAbilityApplicationService.java b/renren-admin/src/main/java/io/renren/modules/processForm/service/TAbilityApplicationService.java index 5d379a62..b48c93a1 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/service/TAbilityApplicationService.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/service/TAbilityApplicationService.java @@ -1,6 +1,7 @@ package io.renren.modules.processForm.service; import io.renren.common.service.CrudService; +import io.renren.common.utils.Result; import io.renren.modules.processForm.dto.TAbilityApplicationDTO; import io.renren.modules.processForm.entity.TAbilityApplicationEntity; @@ -58,4 +59,7 @@ public interface TAbilityApplicationService extends CrudService ids); } \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/service/WillApplyCameraService.java b/renren-admin/src/main/java/io/renren/modules/processForm/service/WillApplyCameraService.java new file mode 100644 index 00000000..fb56fe5d --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/processForm/service/WillApplyCameraService.java @@ -0,0 +1,10 @@ +package io.renren.modules.processForm.service; + +import io.renren.common.service.CrudService; +import io.renren.modules.processForm.dto.WillApplyCameraDTO; +import io.renren.modules.processForm.entity.WillApplyCameraEntity; + +public interface WillApplyCameraService extends CrudService { + + Object selectByUserId(Long id); +} diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/service/impl/JuApiGateway.java b/renren-admin/src/main/java/io/renren/modules/processForm/service/impl/JuApiGateway.java index 411fb3b4..19264860 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/service/impl/JuApiGateway.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/service/impl/JuApiGateway.java @@ -73,7 +73,7 @@ public class JuApiGateway implements ApiGateway { HashSet supportMethod = Sets.newHashSet("POST", "GET"); if (StringUtils.isBlank(apiUrl) || deptId == null || deptId == 0 || StringUtils.isBlank(methods) || !supportMethod.contains(methods)) { - String msg = String.format("注册api参数为空,跳过 apiUrl:%s, deptId:%ld methods:%s, resourceId:%s", apiUrl, deptId, methods, resourceId); + String msg = String.format("注册api参数为空,跳过 apiUrl:%s, deptId:%d methods:%s, resourceId:%s", apiUrl, deptId, methods, resourceId); //重要参数没有当成不需要注册 log.info(msg); diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/service/impl/TAbilityApplicationServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/processForm/service/impl/TAbilityApplicationServiceImpl.java index 3b8bb582..39083f5c 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/service/impl/TAbilityApplicationServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/service/impl/TAbilityApplicationServiceImpl.java @@ -3,15 +3,19 @@ package io.renren.modules.processForm.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import io.renren.common.service.impl.CrudServiceImpl; import io.renren.common.utils.ConvertUtils; +import io.renren.common.utils.DateUtils; import io.renren.modules.processForm.dao.TAbilityApplicationDao; import io.renren.modules.processForm.dto.TAbilityApplicationDTO; import io.renren.modules.processForm.entity.TAbilityApplicationEntity; import io.renren.modules.processForm.service.TAbilityApplicationService; +import io.renren.modules.security.user.SecurityUser; +import io.renren.modules.security.user.UserDetail; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; +import java.util.Date; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -137,5 +141,17 @@ public class TAbilityApplicationServiceImpl extends CrudServiceImpl ids) { + abilityApplicationDao.delApplyCamera(ids); + } + } \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/service/impl/WillApplyCameraServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/processForm/service/impl/WillApplyCameraServiceImpl.java new file mode 100644 index 00000000..f45d9e40 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/processForm/service/impl/WillApplyCameraServiceImpl.java @@ -0,0 +1,35 @@ +package io.renren.modules.processForm.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.renren.common.service.impl.CrudServiceImpl; +import io.renren.modules.processForm.dao.WillApplyCameraDao; +import io.renren.modules.processForm.dto.WillApplyCameraDTO; +import io.renren.modules.processForm.entity.WillApplyCameraEntity; +import io.renren.modules.processForm.service.WillApplyCameraService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Map; + +@Service +public class WillApplyCameraServiceImpl extends CrudServiceImpl implements WillApplyCameraService { + + @Autowired + private WillApplyCameraDao willApplyCameraDao; + + + @Override + public QueryWrapper getWrapper(Map params) { + + return null; + } + + @Override + public Object selectByUserId(Long id) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("user_id", id) + .orderByDesc("create_date"); + return willApplyCameraDao.selectList(wrapper) == null ? new ArrayList<>() : willApplyCameraDao.selectList(wrapper); + } +} diff --git a/renren-admin/src/main/java/io/renren/modules/resource/dto/ResourceDTO.java b/renren-admin/src/main/java/io/renren/modules/resource/dto/ResourceDTO.java index d56c9f5c..bc70e01a 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/dto/ResourceDTO.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/dto/ResourceDTO.java @@ -129,6 +129,9 @@ public class ResourceDTO extends AuditingBaseDTO implements Serializable { @ApiModelProperty(value = "置顶时间") private Date pinTopTime; + @ApiModelProperty(value = "下架流程实例ID") + private Long undercarriageInstanceId; + public String getDelFlagTip() { if (this.delFlag != null) { Optional resourceEntityDelFlagOptional = Optional.ofNullable(ResourceEntityDelFlag.getByFlag(this.delFlag)); diff --git a/renren-admin/src/main/java/io/renren/modules/resource/entity/ResourceEntity.java b/renren-admin/src/main/java/io/renren/modules/resource/entity/ResourceEntity.java index 15bbaf5d..54c350e2 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/entity/ResourceEntity.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/entity/ResourceEntity.java @@ -173,4 +173,6 @@ public class ResourceEntity extends BaseEntity { * 申请单号 */ private String applyNumber; + + private Long undercarriageInstanceId; } \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java index 3efa2614..3ca7a805 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java @@ -2607,6 +2607,7 @@ public class ResourceServiceImpl extends CrudServiceImpl delRes = CompletableFuture.runAsync(() -> { + resourceDao.deleteById(id); Map map = new HashMap<>(); map.put("data_resource_id", id); @@ -2639,6 +2640,12 @@ public class ResourceServiceImpl extends CrudServiceImpl delUnderData = CompletableFuture.runAsync(() -> { + Long instanceId = resourceDao.selectById(id).getUndercarriageInstanceId(); + this.delProcinstBySuAd(instanceId, "能力下架", null); + }, executor); + //会客厅 CompletableFuture delRoom = CompletableFuture.runAsync(() -> { meetingroomMapper.deleteById(id); @@ -2658,7 +2665,7 @@ public class ResourceServiceImpl extends CrudServiceImpl all = CompletableFuture.allOf(delRes, delResOthers, delMountData, delAbilityData, delRoom, delFormData); + CompletableFuture all = CompletableFuture.allOf(delRes, delResOthers, delMountData, delUnderData, delAbilityData, delRoom, delFormData); all.join(); } @@ -2717,7 +2724,9 @@ public class ResourceServiceImpl extends CrudServiceImpl + + UPDATE t_ability_application taa + SET expire_date = now() + WHERE id IN + + #{item} + + + + + \ No newline at end of file diff --git a/renren-admin/src/main/resources/mapper/processForm/WillApplyCameraDao.xml b/renren-admin/src/main/resources/mapper/processForm/WillApplyCameraDao.xml new file mode 100644 index 00000000..6b11273c --- /dev/null +++ b/renren-admin/src/main/resources/mapper/processForm/WillApplyCameraDao.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From ffa2e6d93e7e203c020d0d63ba2939526dffd254 Mon Sep 17 00:00:00 2001 From: dinggang <2498628697@qq.com> Date: Mon, 21 Nov 2022 17:58:19 +0800 Subject: [PATCH 09/22] =?UTF-8?q?1.=E8=A5=BF=E6=B5=B7=E5=B2=B8-=E5=B7=B2?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2=202.toke?= =?UTF-8?q?n=E8=BF=87=E6=9C=9F=E6=97=B6=E9=97=B4=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E5=8F=AF=E9=85=8D=E7=BD=AE=203.=E4=BA=9A=E4=BC=9F=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E6=B6=88=E6=81=AFbug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/controller/CensusController.java | 40 ++++++++++--------- .../service/impl/SysNoticeServiceImpl.java | 9 ++++- .../TAbilityApplicationController.java | 2 +- .../impl/TAbilityApplicationServiceImpl.java | 7 +++- .../service/impl/ResourceServiceImpl.java | 11 +++-- .../service/impl/SysUserTokenServiceImpl.java | 5 ++- .../src/main/resources/application.yml | 2 + .../processForm/TAbilityApplicationDao.xml | 2 +- 8 files changed, 48 insertions(+), 30 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/common/controller/CensusController.java b/renren-admin/src/main/java/io/renren/common/controller/CensusController.java index cdec54b8..81cb72b6 100644 --- a/renren-admin/src/main/java/io/renren/common/controller/CensusController.java +++ b/renren-admin/src/main/java/io/renren/common/controller/CensusController.java @@ -19,6 +19,7 @@ import io.renren.modules.resourceBrowse.service.ResourceBrowseService; import io.renren.modules.security.user.SecurityUser; import io.renren.modules.security.user.UserDetail; import io.renren.modules.sys.dto.SysDeptDTO; +import io.renren.modules.sys.enums.SuperAdminEnum; import io.renren.modules.sys.service.SysDeptService; import io.renren.modules.sys.service.SysUserService; import io.swagger.annotations.Api; @@ -75,6 +76,8 @@ public class CensusController { @Value("${census.applyType}") private String[] censusApplyTypes; // 需要进行申请统计的资源类型 + @Value("${big_date.name}") + private String bigDataDeptName; /** * 获取各类资源数目 @@ -479,19 +482,18 @@ public class CensusController { }) public Result selectCensusResourceTable(@RequestParam Map params) { UserDetail user = SecurityUser.getUser(); - if (user.getDeptId() != null) { - SysDeptDTO sysDeptDTO = sysDeptService.get(user.getDeptId()); + SysDeptDTO sysDeptDTO = sysDeptService.get(user.getDeptId()); + //2022-11-21 修改为只有大数据局部门和admin账号能查看所有 + if (SuperAdminEnum.YES.value() != user.getSuperAdmin() && !bigDataDeptName.equals(sysDeptDTO.getName())) { + params.put("region", sysDeptDTO.getDistrict()); // 管理员只出本部门区域 } -// else if (SuperAdminEnum.YES.value() == user.getSuperAdmin()) { // 超级管理员 -// -// } return new Result().ok(resourceService.selectCensusResourceTable(params)); } @GetMapping("/exportSelectCensusResourceTable") - @ApiOperation("查询部门上架资源及审批结果详细信息") - @LogOperation("查询部门上架资源及审批结果详细信息") + @ApiOperation("导出部门上架资源及审批结果详细信息") + @LogOperation("导出部门上架资源及审批结果详细信息") @ApiImplicitParams({ @ApiImplicitParam(name = "startDate", value = "开始时间", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "endDate", value = "结束时间", paramType = "query", dataType = "String"), @@ -501,8 +503,10 @@ public class CensusController { }) public void exportSelectCensusResourceTable(@RequestParam Map params, HttpServletResponse response) throws IOException { UserDetail user = SecurityUser.getUser(); - if (user.getDeptId() != null) { - SysDeptDTO sysDeptDTO = sysDeptService.get(user.getDeptId()); + SysDeptDTO sysDeptDTO = sysDeptService.get(user.getDeptId()); + //2022-11-21 修改为只有大数据局部门和admin账号能查看所有 + if (SuperAdminEnum.YES.value() != user.getSuperAdmin() && !bigDataDeptName.equals(sysDeptDTO.getName())) { + params.put("region", sysDeptDTO.getDistrict()); // 管理员只出本部门区域 } ArrayList resultList = (ArrayList) resourceDao.selectCensusResourceTable(params); @@ -560,13 +564,12 @@ public class CensusController { }) public Result selectCensusApplyTable(@RequestParam Map params) { UserDetail user = SecurityUser.getUser(); - if (user.getDeptId() != null) { - SysDeptDTO sysDeptDTO = sysDeptService.get(user.getDeptId()); + SysDeptDTO sysDeptDTO = sysDeptService.get(user.getDeptId()); + //2022-11-21 修改为只有大数据局部门和admin账号能查看所有 + if (SuperAdminEnum.YES.value() != user.getSuperAdmin() && !bigDataDeptName.equals(sysDeptDTO.getName())) { + params.put("region", sysDeptDTO.getDistrict()); // 管理员只出本部门区域 } -// else if (user.getSuperAdmin() == SuperAdminEnum.YES.value()) { // 超级管理员 -// -// } return new Result().ok(resourceService.selectCensusApplyTable(params)); } @@ -582,13 +585,12 @@ public class CensusController { }) public void exportSelectCensusApplyTable(@RequestParam Map params, HttpServletResponse response) throws IOException { UserDetail user = SecurityUser.getUser(); - if (user.getDeptId() != null) { - SysDeptDTO sysDeptDTO = sysDeptService.get(user.getDeptId()); + SysDeptDTO sysDeptDTO = sysDeptService.get(user.getDeptId()); + //2022-11-21 修改为只有大数据局部门和admin账号能查看所有 + if (SuperAdminEnum.YES.value() != user.getSuperAdmin() && !bigDataDeptName.equals(sysDeptDTO.getName())) { params.put("region", sysDeptDTO.getDistrict()); // 管理员只出本部门区域 } -// else if (user.getSuperAdmin() == SuperAdminEnum.YES.value()) { // 超级管理员 -// -// } + ArrayList resultList = (ArrayList) resourceDao.selectCensusApplyTable(params); List> date = resultList.stream().map(index -> { List data = new ArrayList<>(); diff --git a/renren-admin/src/main/java/io/renren/modules/notice/service/impl/SysNoticeServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/notice/service/impl/SysNoticeServiceImpl.java index cc017413..4a96feda 100644 --- a/renren-admin/src/main/java/io/renren/modules/notice/service/impl/SysNoticeServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/notice/service/impl/SysNoticeServiceImpl.java @@ -271,12 +271,17 @@ public class SysNoticeServiceImpl extends CrudServiceImpl ids) { diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/service/impl/TAbilityApplicationServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/processForm/service/impl/TAbilityApplicationServiceImpl.java index 39083f5c..693d1f98 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/service/impl/TAbilityApplicationServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/service/impl/TAbilityApplicationServiceImpl.java @@ -13,8 +13,10 @@ import io.renren.modules.security.user.UserDetail; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Map; @@ -29,6 +31,8 @@ import java.util.stream.Collectors; @Service public class TAbilityApplicationServiceImpl extends CrudServiceImpl implements TAbilityApplicationService { private static final Logger logger = LoggerFactory.getLogger(TAbilityApplicationServiceImpl.class); + + @Autowired private TAbilityApplicationDao abilityApplicationDao; @Override @@ -145,7 +149,8 @@ public class TAbilityApplicationServiceImpl extends CrudServiceImpl cameraList = abilityApplicationDao.getApplyCameraList(userDetail.getId(), currentTime); + return cameraList.isEmpty() ? new ArrayList<>() : cameraList; } @Override diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java index 3ca7a805..f1631dc0 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java @@ -159,6 +159,9 @@ public class ResourceServiceImpl extends CrudServiceImpl diff --git a/renren-admin/src/main/resources/mapper/meeting/TMeetingroomMapper.xml b/renren-admin/src/main/resources/mapper/meeting/TMeetingroomMapper.xml index 4ef3dc86..da57533f 100644 --- a/renren-admin/src/main/resources/mapper/meeting/TMeetingroomMapper.xml +++ b/renren-admin/src/main/resources/mapper/meeting/TMeetingroomMapper.xml @@ -14,6 +14,7 @@ + @@ -29,6 +30,7 @@ + @@ -45,6 +47,7 @@ , t.del_flag , t.creator , t.modifier + , t.price + + + + + + + + + + \ No newline at end of file diff --git a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml index 309a3f44..c380224b 100644 --- a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml +++ b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml @@ -42,6 +42,7 @@ + @@ -91,6 +92,7 @@ + From 1ac9bdd772120a8c8d8f9cc23bb35e85ce2dd1f4 Mon Sep 17 00:00:00 2001 From: dinggang <2498628697@qq.com> Date: Tue, 22 Nov 2022 17:23:45 +0800 Subject: [PATCH 12/22] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E6=97=B6=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E4=BB=B7=E6=A0=BC=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/renren/common/controller/AbilityCenterControllerV2.java | 2 ++ .../io/renren/common/controller/AbilityCenterControllerV3.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV2.java b/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV2.java index df1a9d6f..e5f75920 100644 --- a/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV2.java +++ b/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV2.java @@ -40,6 +40,7 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.*; import java.util.concurrent.CompletableFuture; @@ -194,6 +195,7 @@ public class AbilityCenterControllerV2 { tAbilityApplicationDTO.setUserId(abilityBatchApplicationDTO.getUserId()); tAbilityApplicationDTO.setApproveStatus("审核中"); tAbilityApplicationDTO.setDelFlag(0); + tAbilityApplicationDTO.setApplyPrice(BigDecimal.valueOf(Long.valueOf(index.get("price")))); // v2 新增字段 tAbilityApplicationDTO.setCameraList(index.get("channelId") == null ? null : JSON.toJSONString(index)); tAbilityApplicationDTO.setTitle(abilityBatchApplicationDTO.getTitle()); diff --git a/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV3.java b/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV3.java index 9fac8bf8..c4891047 100644 --- a/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV3.java +++ b/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV3.java @@ -46,6 +46,7 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.*; import java.util.concurrent.CompletableFuture; @@ -256,6 +257,7 @@ public class AbilityCenterControllerV3 { tAbilityApplicationDTO.setUserId(abilityBatchApplicationDTO.getUserId()); tAbilityApplicationDTO.setApproveStatus("审核中"); tAbilityApplicationDTO.setDelFlag(0); + tAbilityApplicationDTO.setApplyPrice(BigDecimal.valueOf(Long.valueOf(index.get("price")))); // v2 新增字段 tAbilityApplicationDTO.setCameraList(index.get("channelId") == null ? null : JSON.toJSONString(index)); tAbilityApplicationDTO.setTitle(abilityBatchApplicationDTO.getTitle()); From 9a440727f905554ce402afa939ec156651afd245 Mon Sep 17 00:00:00 2001 From: dinggang <2498628697@qq.com> Date: Tue, 22 Nov 2022 17:55:23 +0800 Subject: [PATCH 13/22] npe --- .../common/controller/AbilityCenterControllerV2.java | 6 +++++- .../common/controller/AbilityCenterControllerV3.java | 8 +++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV2.java b/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV2.java index e5f75920..607b2e1d 100644 --- a/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV2.java +++ b/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV2.java @@ -195,7 +195,11 @@ public class AbilityCenterControllerV2 { tAbilityApplicationDTO.setUserId(abilityBatchApplicationDTO.getUserId()); tAbilityApplicationDTO.setApproveStatus("审核中"); tAbilityApplicationDTO.setDelFlag(0); - tAbilityApplicationDTO.setApplyPrice(BigDecimal.valueOf(Long.valueOf(index.get("price")))); + if (StringUtils.isNotBlank(index.get("price"))) { + tAbilityApplicationDTO.setApplyPrice(BigDecimal.valueOf(Long.valueOf(index.get("price")))); + } else { + tAbilityApplicationDTO.setApplyPrice(BigDecimal.ZERO); + } // v2 新增字段 tAbilityApplicationDTO.setCameraList(index.get("channelId") == null ? null : JSON.toJSONString(index)); tAbilityApplicationDTO.setTitle(abilityBatchApplicationDTO.getTitle()); diff --git a/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV3.java b/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV3.java index c4891047..89810e65 100644 --- a/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV3.java +++ b/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV3.java @@ -1,6 +1,5 @@ package io.renren.common.controller; - import cn.hutool.core.util.ObjectUtil; import com.alibaba.fastjson.JSON; import io.renren.common.annotation.LogOperation; @@ -257,8 +256,11 @@ public class AbilityCenterControllerV3 { tAbilityApplicationDTO.setUserId(abilityBatchApplicationDTO.getUserId()); tAbilityApplicationDTO.setApproveStatus("审核中"); tAbilityApplicationDTO.setDelFlag(0); - tAbilityApplicationDTO.setApplyPrice(BigDecimal.valueOf(Long.valueOf(index.get("price")))); - // v2 新增字段 + if (StringUtils.isNotBlank(index.get("price"))) { + tAbilityApplicationDTO.setApplyPrice(BigDecimal.valueOf(Long.valueOf(index.get("price")))); + } else { + tAbilityApplicationDTO.setApplyPrice(BigDecimal.ZERO); + } // v2 新增字段 tAbilityApplicationDTO.setCameraList(index.get("channelId") == null ? null : JSON.toJSONString(index)); tAbilityApplicationDTO.setTitle(abilityBatchApplicationDTO.getTitle()); tAbilityApplicationDTO.setApplicationBackground(abilityBatchApplicationDTO.getApplicationBackground()); From e8d2ea9df72da7962789d5975929253b4e3cea94 Mon Sep 17 00:00:00 2001 From: dinggang <2498628697@qq.com> Date: Wed, 23 Nov 2022 09:12:52 +0800 Subject: [PATCH 14/22] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../processForm/TAbilityApplicationDao.xml | 44 ++++++++----------- 1 file changed, 18 insertions(+), 26 deletions(-) diff --git a/renren-admin/src/main/resources/mapper/processForm/TAbilityApplicationDao.xml b/renren-admin/src/main/resources/mapper/processForm/TAbilityApplicationDao.xml index 5300f4c4..61932cac 100644 --- a/renren-admin/src/main/resources/mapper/processForm/TAbilityApplicationDao.xml +++ b/renren-admin/src/main/resources/mapper/processForm/TAbilityApplicationDao.xml @@ -350,25 +350,23 @@ @@ -433,7 +452,14 @@ LEFT JOIN ( SELECT data_resource_id, attr_type, attr_value FROM tb_data_attr tda WHERE del_flag = 0 AND attr_type = '组件类型' ) attr ON tdr.id = attr.data_resource_id WHERE 1 = 1 - AND taa.approve_status IN ( '审核中', '通过' ) + + + AND taa.approve_status IN ( '审核中', '通过' ) + + + AND taa.approve_status = #{params.applyResult} + + AND taa.del_flag = 0 AND tdr.del_flag = 0 @@ -463,6 +489,17 @@ LEFT JOIN t_meetingroom tm ON tmb.room_id = tm.id WHERE tm.del_flag = 0 + + + AND tmb.state = 0 + + + AND tmb.state = 2 + + + AND tmb.state IN (0, 2) + + AND tmb.create_date >= #{params.startDate} @@ -500,7 +537,14 @@ LEFT JOIN ( SELECT data_resource_id, attr_type, attr_value FROM tb_data_attr tda WHERE del_flag = 0 AND attr_type = '组件类型' ) attr ON tdr.id = attr.data_resource_id WHERE 1 = 1 - AND taa.approve_status IN ( '审核中', '通过' ) + + + AND taa.approve_status IN ( '审核中', '通过' ) + + + AND taa.approve_status = #{params.applyResult} + + AND taa.del_flag = 0 AND tdr.del_flag = 0 @@ -536,6 +580,17 @@ LEFT JOIN t_meetingroom tm ON tmb.room_id = tm.id WHERE tm.del_flag = 0 + + + AND tmb.state = 0 + + + AND tmb.state = 2 + + + AND tmb.state IN (0, 2) + + AND tmb.create_date >= #{params.startDate} @@ -554,7 +609,7 @@ AND '会客厅' = #{params.resourceType} - ORDER BY applyDate + ORDER BY applyDate DESC select t3.permissions from sys_role_user t1 left join sys_role_menu t2 on t1.role_id = t2.role_id left join sys_menu t3 on t2.menu_id = t3.id - where t1.user_id = #{userId} order by t3.sort asc + where t1.user_id = #{userId} AND t1.del_flag = 0 order by t3.sort select t2.dept_id from sys_role_user t1, sys_role_data_scope t2 - where t1.user_id = #{value} and t1.role_id = t2.role_id + where t1.user_id = #{value} and t1.role_id = t2.role_id AND t1.del_flag = 0 diff --git a/renren-admin/src/main/resources/mapper/sys/SysRoleUserDao.xml b/renren-admin/src/main/resources/mapper/sys/SysRoleUserDao.xml index de36800f..42bea077 100644 --- a/renren-admin/src/main/resources/mapper/sys/SysRoleUserDao.xml +++ b/renren-admin/src/main/resources/mapper/sys/SysRoleUserDao.xml @@ -9,6 +9,7 @@ #{roleId} + + + UPDATE sys_role_user SET del_flag = 0, update_date = NOW(), updater = #{updater} + where user_id in + + #{userId} + + + \ No newline at end of file diff --git a/renren-admin/src/main/resources/mapper/sys/SysUserDao.xml b/renren-admin/src/main/resources/mapper/sys/SysUserDao.xml index ebdeb622..6d85b91e 100644 --- a/renren-admin/src/main/resources/mapper/sys/SysUserDao.xml +++ b/renren-admin/src/main/resources/mapper/sys/SysUserDao.xml @@ -33,7 +33,7 @@ AND EXISTS(SELECT 1 FROM sys_role_user WHERE sys_role_user.user_id = t1.id AND sys_role_user.role_id = - #{role_id}) + #{role_id}) AND sys_role_user.del_flag = 0 @@ -71,6 +71,7 @@ AND t1.role_id = #{roleId} AND t2.dept_id = #{deptId} AND t2.status = 1 + AND t1.del_flag = 0 ORDER BY update_date DESC LIMIT 1 @@ -102,4 +103,73 @@ SELECT name FROM sys_dept LEFT JOIN sys_user ON sys_user.dept_id = sys_dept.id WHERE sys_user.id = #{id} + + + + \ No newline at end of file