diff --git a/.vscode/settings.json b/.vscode/settings.json index 7b016a8..e012065 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,4 @@ { - "java.compile.nullAnalysis.mode": "automatic" + "java.compile.nullAnalysis.mode": "automatic", + "java.configuration.updateBuildConfiguration": "interactive" } \ No newline at end of file diff --git a/common-ruoyi/pom.xml b/common-ruoyi/pom.xml index bc88f95..d4b57a1 100644 --- a/common-ruoyi/pom.xml +++ b/common-ruoyi/pom.xml @@ -16,7 +16,6 @@ ruoyi-common ruoyi-generator ruoyi-quartz - ruoyi-system ruoyi-framework diff --git a/common-ruoyi/ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java b/common-ruoyi/ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java index 82d994b..b257a77 100644 --- a/common-ruoyi/ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java +++ b/common-ruoyi/ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java @@ -61,4 +61,8 @@ public class CacheConstants * 资源分类名称列表 */ public static final String ATTACH_CLASSIFY_NAME_LIST = "attach_classify_name_list"; + /** + * websocket用户session + */ + public static final String WS_USER_SESSION = "ws_user_session:"; } diff --git a/common-ruoyi/ruoyi-common/src/main/java/com/ruoyi/common/constant/DictType.java b/common-ruoyi/ruoyi-common/src/main/java/com/ruoyi/common/constant/DictType.java index 08e1efe..7c1ee42 100644 --- a/common-ruoyi/ruoyi-common/src/main/java/com/ruoyi/common/constant/DictType.java +++ b/common-ruoyi/ruoyi-common/src/main/java/com/ruoyi/common/constant/DictType.java @@ -22,4 +22,6 @@ public class DictType { public static final String NOTICE_LEVEL = "notice_level"; // 客户跟进方式 public static final String CUSTOMER_FOLLOW_TYPE = "customer_follow_type"; + // 通知类型 + public static final String NOTICE_TYPE = "notice_type"; } diff --git a/common-ruoyi/ruoyi-framework/pom.xml b/common-ruoyi/ruoyi-framework/pom.xml index 63cafa5..84b1877 100644 --- a/common-ruoyi/ruoyi-framework/pom.xml +++ b/common-ruoyi/ruoyi-framework/pom.xml @@ -56,7 +56,7 @@ com.ruoyi - ruoyi-system + ruoyi-service diff --git a/common-ruoyi/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java b/common-ruoyi/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java index e708bf3..594c763 100644 --- a/common-ruoyi/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java +++ b/common-ruoyi/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java @@ -1,10 +1,5 @@ package com.ruoyi.framework.config; -import com.ruoyi.framework.config.properties.PermitAllUrlProperties; -import com.ruoyi.framework.security.filter.CustomLoginAuthenticationProvider; -import com.ruoyi.framework.security.filter.JwtAuthenticationTokenFilter; -import com.ruoyi.framework.security.handle.AuthenticationEntryPointImpl; -import com.ruoyi.framework.security.handle.LogoutSuccessHandlerImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -21,6 +16,12 @@ import org.springframework.security.web.authentication.UsernamePasswordAuthentic import org.springframework.security.web.authentication.logout.LogoutFilter; import org.springframework.web.filter.CorsFilter; +import com.ruoyi.framework.config.properties.PermitAllUrlProperties; +import com.ruoyi.framework.security.filter.CustomLoginAuthenticationProvider; +import com.ruoyi.framework.security.filter.JwtAuthenticationTokenFilter; +import com.ruoyi.framework.security.handle.AuthenticationEntryPointImpl; +import com.ruoyi.framework.security.handle.LogoutSuccessHandlerImpl; + /** * spring security配置 * @@ -115,6 +116,8 @@ public class SecurityConfig // 静态资源,可匿名访问 .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll() .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() + // 允许WebSocket连接 + .antMatchers("/ws/**").permitAll() // 除上面外的所有请求全部需要鉴权认证 .anyRequest().authenticated(); }) diff --git a/common-ruoyi/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java b/common-ruoyi/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java index aa112da..bfcc93c 100644 --- a/common-ruoyi/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java +++ b/common-ruoyi/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java @@ -3,12 +3,15 @@ package com.ruoyi.framework.web.service; import java.util.HashMap; import java.util.Map; import java.util.concurrent.TimeUnit; + import javax.servlet.http.HttpServletRequest; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; + import com.ruoyi.common.constant.CacheConstants; import com.ruoyi.common.constant.Constants; import com.ruoyi.common.core.domain.model.LoginUser; @@ -18,6 +21,7 @@ import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.ip.AddressUtils; import com.ruoyi.common.utils.ip.IpUtils; import com.ruoyi.common.utils.uuid.IdUtils; + import eu.bitwalker.useragentutils.UserAgent; import io.jsonwebtoken.Claims; import io.jsonwebtoken.Jwts; @@ -63,6 +67,17 @@ public class TokenService { // 获取请求携带的令牌 String token = getToken(request); + return this.getLoginUser(token); + } + + /** + * 获取用户身份信息 + * + * @param token 令牌 + * @return 用户信息 + */ + public LoginUser getLoginUser(String token) + { if (StringUtils.isNotEmpty(token)) { try diff --git a/pom.xml b/pom.xml index 631b8e2..87114f5 100644 --- a/pom.xml +++ b/pom.xml @@ -171,7 +171,7 @@ com.ruoyi - ruoyi-system + ruoyi-service ${ruoyi.version} @@ -187,6 +187,7 @@ ruoyi-web + ruoyi-service common-ruoyi pom diff --git a/common-ruoyi/ruoyi-system/pom.xml b/ruoyi-service/pom.xml similarity index 79% rename from common-ruoyi/ruoyi-system/pom.xml rename to ruoyi-service/pom.xml index bc9e184..6c5190b 100644 --- a/common-ruoyi/ruoyi-system/pom.xml +++ b/ruoyi-service/pom.xml @@ -3,26 +3,30 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - common-ruoyi + project-manager-java com.ruoyi 3.8.8 4.0.0 - ruoyi-system + ruoyi-service system系统模块 - com.ruoyi ruoyi-common + + + org.springframework.boot + spring-boot-starter-websocket + diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/attach/domain/Attach.java b/ruoyi-service/src/main/java/com/ruoyi/bst/attach/domain/Attach.java similarity index 92% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/attach/domain/Attach.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/attach/domain/Attach.java index 7528081..0b31892 100644 --- a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/attach/domain/Attach.java +++ b/ruoyi-service/src/main/java/com/ruoyi/bst/attach/domain/Attach.java @@ -43,4 +43,8 @@ public class Attach extends BaseEntity @ApiModelProperty("创建人") private Long createId; + @Excel(name = "所属部门") + @ApiModelProperty("所属部门") + private Long deptId; + } diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/attach/domain/AttachQuery.java b/ruoyi-service/src/main/java/com/ruoyi/bst/attach/domain/AttachQuery.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/attach/domain/AttachQuery.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/attach/domain/AttachQuery.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/attach/domain/AttachVO.java b/ruoyi-service/src/main/java/com/ruoyi/bst/attach/domain/AttachVO.java similarity index 81% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/attach/domain/AttachVO.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/attach/domain/AttachVO.java index c0310f0..bd5fb02 100644 --- a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/attach/domain/AttachVO.java +++ b/ruoyi-service/src/main/java/com/ruoyi/bst/attach/domain/AttachVO.java @@ -11,5 +11,8 @@ public class AttachVO extends Attach { @ApiModelProperty("创建人") private String createName; + + @ApiModelProperty("所属部门") + private String deptName; } diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/attach/mapper/AttachMapper.java b/ruoyi-service/src/main/java/com/ruoyi/bst/attach/mapper/AttachMapper.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/attach/mapper/AttachMapper.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/attach/mapper/AttachMapper.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/attach/mapper/AttachMapper.xml b/ruoyi-service/src/main/java/com/ruoyi/bst/attach/mapper/AttachMapper.xml similarity index 88% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/attach/mapper/AttachMapper.xml rename to ruoyi-service/src/main/java/com/ruoyi/bst/attach/mapper/AttachMapper.xml index 0f7abdf..06d00ba 100644 --- a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/attach/mapper/AttachMapper.xml +++ b/ruoyi-service/src/main/java/com/ruoyi/bst/attach/mapper/AttachMapper.xml @@ -15,11 +15,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ba.create_id, ba.create_time, ba.deleted, + ba.dept_id, bac.name as classify_name, - su.nick_name as create_name + su.nick_name as create_name, + sd.dept_name as dept_name from bst_attach ba left join bst_attach_classify bac on bac.id = ba.classify_id left join sys_user su on su.user_id = ba.create_id + left join sys_dept sd on sd.dept_id = ba.dept_id @@ -33,6 +36,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and ba.deleted = #{query.deleted} and ba.deleted = false and su.nick_name like concat('%', #{query.createName}, '%') + and ba.dept_id = #{query.deptId} + and sd.dept_name like concat('%', #{query.deptName}, '%') and bac.id = #{query.classifyAncestorId} or find_in_set(#{query.classifyAncestorId}, bac.ancestors) @@ -58,6 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" name, url, create_id, + dept_id, create_time, deleted, @@ -66,6 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{name}, #{url}, #{createId}, + #{deptId}, #{createTime}, #{deleted}, @@ -78,6 +85,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" name, url, create_id, + dept_id, create_time, deleted, @@ -92,6 +100,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" default, #{i.createId}, default, + #{i.deptId}, + default, #{i.createTime}, default, #{i.deleted}, @@ -163,6 +173,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + WHEN #{item.id} THEN #{item.deptId} + + + WHEN #{item.id} THEN `dept_id` + + + where id in @@ -184,6 +204,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" url = #{data.url}, create_id = #{data.createId}, create_time = #{data.createTime}, + dept_id = #{data.deptId}, diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/attach/service/AttachConverter.java b/ruoyi-service/src/main/java/com/ruoyi/bst/attach/service/AttachConverter.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/attach/service/AttachConverter.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/attach/service/AttachConverter.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/attach/service/AttachService.java b/ruoyi-service/src/main/java/com/ruoyi/bst/attach/service/AttachService.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/attach/service/AttachService.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/attach/service/AttachService.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/attach/service/impl/AttachConverterImpl.java b/ruoyi-service/src/main/java/com/ruoyi/bst/attach/service/impl/AttachConverterImpl.java similarity index 94% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/attach/service/impl/AttachConverterImpl.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/attach/service/impl/AttachConverterImpl.java index 12a366e..03f88b5 100644 --- a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/attach/service/impl/AttachConverterImpl.java +++ b/ruoyi-service/src/main/java/com/ruoyi/bst/attach/service/impl/AttachConverterImpl.java @@ -29,6 +29,7 @@ public class AttachConverterImpl implements AttachConverter { po.setCreateId(data.getCreateId()); po.setClassifyId(data.getClassifyId()); po.setCreateId(SecurityUtils.getUserId()); + po.setDeptId(data.getDeptId()); result.add(po); } @@ -45,6 +46,7 @@ public class AttachConverterImpl implements AttachConverter { po.setId(data.getId()); po.setClassifyId(data.getClassifyId()); po.setName(data.getName()); + po.setDeptId(data.getDeptId()); return po; } diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/attach/service/impl/AttachServiceImpl.java b/ruoyi-service/src/main/java/com/ruoyi/bst/attach/service/impl/AttachServiceImpl.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/attach/service/impl/AttachServiceImpl.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/attach/service/impl/AttachServiceImpl.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/attachClassify/domain/AttachClassify.java b/ruoyi-service/src/main/java/com/ruoyi/bst/attachClassify/domain/AttachClassify.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/attachClassify/domain/AttachClassify.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/attachClassify/domain/AttachClassify.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/attachClassify/domain/AttachClassifyQuery.java b/ruoyi-service/src/main/java/com/ruoyi/bst/attachClassify/domain/AttachClassifyQuery.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/attachClassify/domain/AttachClassifyQuery.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/attachClassify/domain/AttachClassifyQuery.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/attachClassify/domain/AttachClassifyVO.java b/ruoyi-service/src/main/java/com/ruoyi/bst/attachClassify/domain/AttachClassifyVO.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/attachClassify/domain/AttachClassifyVO.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/attachClassify/domain/AttachClassifyVO.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/attachClassify/domain/vo/AttachClassifyNameVO.java b/ruoyi-service/src/main/java/com/ruoyi/bst/attachClassify/domain/vo/AttachClassifyNameVO.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/attachClassify/domain/vo/AttachClassifyNameVO.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/attachClassify/domain/vo/AttachClassifyNameVO.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/attachClassify/mapper/AttachClassifyMapper.java b/ruoyi-service/src/main/java/com/ruoyi/bst/attachClassify/mapper/AttachClassifyMapper.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/attachClassify/mapper/AttachClassifyMapper.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/attachClassify/mapper/AttachClassifyMapper.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/attachClassify/mapper/AttachClassifyMapper.xml b/ruoyi-service/src/main/java/com/ruoyi/bst/attachClassify/mapper/AttachClassifyMapper.xml similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/attachClassify/mapper/AttachClassifyMapper.xml rename to ruoyi-service/src/main/java/com/ruoyi/bst/attachClassify/mapper/AttachClassifyMapper.xml diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/attachClassify/service/AttachClassifyService.java b/ruoyi-service/src/main/java/com/ruoyi/bst/attachClassify/service/AttachClassifyService.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/attachClassify/service/AttachClassifyService.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/attachClassify/service/AttachClassifyService.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/attachClassify/service/impl/AttachClassifyServiceImpl.java b/ruoyi-service/src/main/java/com/ruoyi/bst/attachClassify/service/impl/AttachClassifyServiceImpl.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/attachClassify/service/impl/AttachClassifyServiceImpl.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/attachClassify/service/impl/AttachClassifyServiceImpl.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customer/domain/Customer.java b/ruoyi-service/src/main/java/com/ruoyi/bst/customer/domain/Customer.java similarity index 83% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customer/domain/Customer.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/customer/domain/Customer.java index 8d243bb..286e93a 100644 --- a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customer/domain/Customer.java +++ b/ruoyi-service/src/main/java/com/ruoyi/bst/customer/domain/Customer.java @@ -92,4 +92,26 @@ public class Customer extends BaseEntity @Excel(name = "创建人ID") @ApiModelProperty("创建人ID") private Long createId; + + @Excel(name = "顾虑点") + @ApiModelProperty("顾虑点") + @Size(max = 200, message = "顾虑点长度不能超过200个字符") + private String concern; + + @Excel(name = "痛点") + @ApiModelProperty("痛点") + @Size(max = 200, message = "痛点长度不能超过200个字符") + private String pain; + + @Excel(name = "关注点") + @ApiModelProperty("关注点") + @Size(max = 200, message = "关注点长度不能超过200个字符") + private String attention; + + @Excel(name = "需求") + @ApiModelProperty("需求") + @Size(max = 200, message = "需求长度不能超过200个字符") + private String demand; + + } diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customer/domain/CustomerQuery.java b/ruoyi-service/src/main/java/com/ruoyi/bst/customer/domain/CustomerQuery.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customer/domain/CustomerQuery.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/customer/domain/CustomerQuery.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customer/domain/CustomerVO.java b/ruoyi-service/src/main/java/com/ruoyi/bst/customer/domain/CustomerVO.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customer/domain/CustomerVO.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/customer/domain/CustomerVO.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customer/domain/dto/CustomerAddDTO.java b/ruoyi-service/src/main/java/com/ruoyi/bst/customer/domain/dto/CustomerAddDTO.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customer/domain/dto/CustomerAddDTO.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/customer/domain/dto/CustomerAddDTO.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customer/domain/enums/CustomerStatus.java b/ruoyi-service/src/main/java/com/ruoyi/bst/customer/domain/enums/CustomerStatus.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customer/domain/enums/CustomerStatus.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/customer/domain/enums/CustomerStatus.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customer/mapper/CustomerMapper.java b/ruoyi-service/src/main/java/com/ruoyi/bst/customer/mapper/CustomerMapper.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customer/mapper/CustomerMapper.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/customer/mapper/CustomerMapper.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customer/mapper/CustomerMapper.xml b/ruoyi-service/src/main/java/com/ruoyi/bst/customer/mapper/CustomerMapper.xml similarity index 86% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customer/mapper/CustomerMapper.xml rename to ruoyi-service/src/main/java/com/ruoyi/bst/customer/mapper/CustomerMapper.xml index d8702b1..7526dc1 100644 --- a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customer/mapper/CustomerMapper.xml +++ b/ruoyi-service/src/main/java/com/ruoyi/bst/customer/mapper/CustomerMapper.xml @@ -26,6 +26,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" bc.create_time, bc.update_time, bc.deleted, + bc.concern, + bc.pain, + bc.attention, + bc.demand, suf.nick_name as follow_name, su.nick_name as create_name from bst_customer bc @@ -53,6 +57,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and suf.nick_name like concat('%', #{query.followName}, '%') and su.nick_name like concat('%', #{query.createName}, '%') and su.user_id = #{query.createId} + and bc.concern like concat('%', #{query.concern}, '%') + and bc.pain like concat('%', #{query.pain}, '%') + and bc.attention like concat('%', #{query.attention}, '%') + and bc.demand like concat('%', #{query.demand}, '%') and date(bc.create_time) >= #{query.createDateRange[0]} and date(bc.create_time) <= #{query.createDateRange[1]} @@ -69,6 +77,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{item} + ${@com.ruoyi.framework.util.DataScopeUtil@dataScope( + null, + "bc.create_id,bc.follow_id", + null, + null, + query.scope + )} ${query.params.dataScope} @@ -103,6 +118,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" deleted, create_id, next_follow_time, + concern, + pain, + attention, + demand, #{code}, @@ -121,6 +140,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{deleted}, #{createId}, #{nextFollowTime}, + #{concern}, + #{pain}, + #{attention}, + #{demand}, @@ -149,6 +172,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" deleted = #{data.deleted}, create_id = #{data.createId}, next_follow_time = #{data.nextFollowTime}, + concern = #{data.concern}, + pain = #{data.pain}, + attention = #{data.attention}, + demand = #{data.demand}, diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customer/service/CustomerConverter.java b/ruoyi-service/src/main/java/com/ruoyi/bst/customer/service/CustomerConverter.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customer/service/CustomerConverter.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/customer/service/CustomerConverter.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customer/service/CustomerService.java b/ruoyi-service/src/main/java/com/ruoyi/bst/customer/service/CustomerService.java similarity index 87% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customer/service/CustomerService.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/customer/service/CustomerService.java index c6f7f3e..dffc156 100644 --- a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customer/service/CustomerService.java +++ b/ruoyi-service/src/main/java/com/ruoyi/bst/customer/service/CustomerService.java @@ -7,7 +7,6 @@ import com.ruoyi.bst.customer.domain.Customer; import com.ruoyi.bst.customer.domain.CustomerQuery; import com.ruoyi.bst.customer.domain.CustomerVO; import com.ruoyi.bst.customer.domain.dto.CustomerAddDTO; -import com.ruoyi.common.annotation.DataScope; import com.ruoyi.common.vo.LocalDateIntegerVO; import com.ruoyi.common.vo.StringIntegerVO; @@ -84,16 +83,6 @@ public interface CustomerService */ int updateFollowTime(Long customerId, LocalDateTime lastFollowTime, LocalDateTime nextFollowTime); - /** - * 查询客户列表,并根据数据权限过滤 - * @param query - * @return - */ - @DataScope(userAlias = "bc.create_id,bc.follow_id") - default List selectCustomerListScope(CustomerQuery query) { - return selectCustomerList(query); - } - /** * 逻辑删除 * @param ids diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customer/service/CustomerValidator.java b/ruoyi-service/src/main/java/com/ruoyi/bst/customer/service/CustomerValidator.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customer/service/CustomerValidator.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/customer/service/CustomerValidator.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customer/service/impl/CustomerConverterImpl.java b/ruoyi-service/src/main/java/com/ruoyi/bst/customer/service/impl/CustomerConverterImpl.java similarity index 84% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customer/service/impl/CustomerConverterImpl.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/customer/service/impl/CustomerConverterImpl.java index 0d7bb00..06f88c6 100644 --- a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customer/service/impl/CustomerConverterImpl.java +++ b/ruoyi-service/src/main/java/com/ruoyi/bst/customer/service/impl/CustomerConverterImpl.java @@ -10,7 +10,6 @@ import com.ruoyi.bst.customerFollow.domain.CustomerFollow; @Service public class CustomerConverterImpl implements CustomerConverter { - @Override public CustomerAddDTO toDTOByCreate(CustomerAddDTO customer) { if (customer == null) { @@ -24,9 +23,13 @@ public class CustomerConverterImpl implements CustomerConverter { po.setWechat(customer.getWechat()); po.setSource(customer.getSource()); po.setIntents(customer.getIntents()); - po.setFollowId(customer.getFollowId()); po.setRemark(customer.getRemark()); po.setFollow(customer.getFollow()); + po.setFollowId(customer.getFollowId()); + po.setConcern(customer.getConcern()); + po.setPain(customer.getPain()); + po.setAttention(customer.getAttention()); + po.setDemand(customer.getDemand()); return po; } @@ -46,6 +49,10 @@ public class CustomerConverterImpl implements CustomerConverter { po.setIntents(customer.getIntents()); po.setFollowId(customer.getFollowId()); po.setRemark(customer.getRemark()); + po.setConcern(customer.getConcern()); + po.setPain(customer.getPain()); + po.setAttention(customer.getAttention()); + po.setDemand(customer.getDemand()); return po; } diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customer/service/impl/CustomerServiceImpl.java b/ruoyi-service/src/main/java/com/ruoyi/bst/customer/service/impl/CustomerServiceImpl.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customer/service/impl/CustomerServiceImpl.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/customer/service/impl/CustomerServiceImpl.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customer/service/impl/CustomerValidatorImpl.java b/ruoyi-service/src/main/java/com/ruoyi/bst/customer/service/impl/CustomerValidatorImpl.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customer/service/impl/CustomerValidatorImpl.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/customer/service/impl/CustomerValidatorImpl.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customerFollow/domain/CustomerFollow.java b/ruoyi-service/src/main/java/com/ruoyi/bst/customerFollow/domain/CustomerFollow.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customerFollow/domain/CustomerFollow.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/customerFollow/domain/CustomerFollow.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customerFollow/domain/CustomerFollowQuery.java b/ruoyi-service/src/main/java/com/ruoyi/bst/customerFollow/domain/CustomerFollowQuery.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customerFollow/domain/CustomerFollowQuery.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/customerFollow/domain/CustomerFollowQuery.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customerFollow/domain/CustomerFollowVO.java b/ruoyi-service/src/main/java/com/ruoyi/bst/customerFollow/domain/CustomerFollowVO.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customerFollow/domain/CustomerFollowVO.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/customerFollow/domain/CustomerFollowVO.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customerFollow/mapper/CustomerFollowMapper.java b/ruoyi-service/src/main/java/com/ruoyi/bst/customerFollow/mapper/CustomerFollowMapper.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customerFollow/mapper/CustomerFollowMapper.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/customerFollow/mapper/CustomerFollowMapper.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customerFollow/mapper/CustomerFollowMapper.xml b/ruoyi-service/src/main/java/com/ruoyi/bst/customerFollow/mapper/CustomerFollowMapper.xml similarity index 96% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customerFollow/mapper/CustomerFollowMapper.xml rename to ruoyi-service/src/main/java/com/ruoyi/bst/customerFollow/mapper/CustomerFollowMapper.xml index 9f6457e..bf5906e 100644 --- a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customerFollow/mapper/CustomerFollowMapper.xml +++ b/ruoyi-service/src/main/java/com/ruoyi/bst/customerFollow/mapper/CustomerFollowMapper.xml @@ -34,6 +34,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and bc.name like concat('%', #{query.customerName}, '%') and bc.code like concat('%', #{query.customerCode}, '%') and su.nick_name like concat('%', #{query.userName}, '%') + ${@com.ruoyi.framework.util.DataScopeUtil@dataScope( + null, + "bcf.user_id", + null, + null, + query.scope + )} ${query.params.dataScope} diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customerFollow/service/CustomerFollowConverter.java b/ruoyi-service/src/main/java/com/ruoyi/bst/customerFollow/service/CustomerFollowConverter.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customerFollow/service/CustomerFollowConverter.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/customerFollow/service/CustomerFollowConverter.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customerFollow/service/CustomerFollowService.java b/ruoyi-service/src/main/java/com/ruoyi/bst/customerFollow/service/CustomerFollowService.java similarity index 82% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customerFollow/service/CustomerFollowService.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/customerFollow/service/CustomerFollowService.java index 819d307..d6dbb75 100644 --- a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customerFollow/service/CustomerFollowService.java +++ b/ruoyi-service/src/main/java/com/ruoyi/bst/customerFollow/service/CustomerFollowService.java @@ -5,7 +5,6 @@ import java.util.List; import com.ruoyi.bst.customerFollow.domain.CustomerFollow; import com.ruoyi.bst.customerFollow.domain.CustomerFollowQuery; import com.ruoyi.bst.customerFollow.domain.CustomerFollowVO; -import com.ruoyi.common.annotation.DataScope; /** * 客户跟进记录Service接口 @@ -62,14 +61,4 @@ public interface CustomerFollowService * @return 结果 */ public int deleteCustomerFollowByFollowId(Long followId); - - /** - * 查询客户跟进记录列表,并根据数据权限过滤 - * @param query - * @return - */ - @DataScope(userAlias = "bcf.user_id") - default List selectCustomerFollowListScope(CustomerFollowQuery query) { - return selectCustomerFollowList(query); - } } diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customerFollow/service/impl/CustomerFollowConverterImpl.java b/ruoyi-service/src/main/java/com/ruoyi/bst/customerFollow/service/impl/CustomerFollowConverterImpl.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customerFollow/service/impl/CustomerFollowConverterImpl.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/customerFollow/service/impl/CustomerFollowConverterImpl.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customerFollow/service/impl/CustomerFollowServiceImpl.java b/ruoyi-service/src/main/java/com/ruoyi/bst/customerFollow/service/impl/CustomerFollowServiceImpl.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/customerFollow/service/impl/CustomerFollowServiceImpl.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/customerFollow/service/impl/CustomerFollowServiceImpl.java diff --git a/ruoyi-service/src/main/java/com/ruoyi/bst/message/domain/Message.java b/ruoyi-service/src/main/java/com/ruoyi/bst/message/domain/Message.java new file mode 100644 index 0000000..15f7e57 --- /dev/null +++ b/ruoyi-service/src/main/java/com/ruoyi/bst/message/domain/Message.java @@ -0,0 +1,55 @@ +package com.ruoyi.bst.message.domain; + +import java.time.LocalDateTime; + +import org.springframework.format.annotation.DateTimeFormat; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * 消息对象 bst_message + * + * @author ruoyi + * @date 2025-02-22 + */ +@Data +public class Message extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + private Long id; + + @Excel(name = "接收人") + @ApiModelProperty("接收人") + private Long userId; + + @Excel(name = "业务类型") + @ApiModelProperty("业务类型") + private String bstType; + + @Excel(name = "业务ID") + @ApiModelProperty("业务ID") + private Long bstId; + + @Excel(name = "标题") + @ApiModelProperty("标题") + private String title; + + @Excel(name = "内容") + @ApiModelProperty("内容") + private String content; + + @Excel(name = "是否已读") + @ApiModelProperty("是否已读") + private Boolean isRead; + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "已读时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty("已读时间") + private LocalDateTime readTime; + +} diff --git a/ruoyi-service/src/main/java/com/ruoyi/bst/message/domain/MessageQuery.java b/ruoyi-service/src/main/java/com/ruoyi/bst/message/domain/MessageQuery.java new file mode 100644 index 0000000..036380d --- /dev/null +++ b/ruoyi-service/src/main/java/com/ruoyi/bst/message/domain/MessageQuery.java @@ -0,0 +1,8 @@ +package com.ruoyi.bst.message.domain; + +import lombok.Data; + +@Data +public class MessageQuery extends MessageVO { + +} diff --git a/ruoyi-service/src/main/java/com/ruoyi/bst/message/domain/MessageVO.java b/ruoyi-service/src/main/java/com/ruoyi/bst/message/domain/MessageVO.java new file mode 100644 index 0000000..a0af767 --- /dev/null +++ b/ruoyi-service/src/main/java/com/ruoyi/bst/message/domain/MessageVO.java @@ -0,0 +1,8 @@ +package com.ruoyi.bst.message.domain; + +import lombok.Data; + +@Data +public class MessageVO extends Message{ + +} diff --git a/ruoyi-service/src/main/java/com/ruoyi/bst/message/domain/enums/MessageBstType.java b/ruoyi-service/src/main/java/com/ruoyi/bst/message/domain/enums/MessageBstType.java new file mode 100644 index 0000000..58c8942 --- /dev/null +++ b/ruoyi-service/src/main/java/com/ruoyi/bst/message/domain/enums/MessageBstType.java @@ -0,0 +1,17 @@ +package com.ruoyi.bst.message.domain.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public enum MessageBstType { + + TASK("task", "任务"), + TASK_SUBMIT("task_submit", "任务提交"), + CUSTOMER("customer", "客户"); + + private String value; + private String name; + +} diff --git a/ruoyi-service/src/main/java/com/ruoyi/bst/message/mapper/MessageMapper.java b/ruoyi-service/src/main/java/com/ruoyi/bst/message/mapper/MessageMapper.java new file mode 100644 index 0000000..262007c --- /dev/null +++ b/ruoyi-service/src/main/java/com/ruoyi/bst/message/mapper/MessageMapper.java @@ -0,0 +1,88 @@ +package com.ruoyi.bst.message.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.ruoyi.bst.message.domain.Message; +import com.ruoyi.bst.message.domain.MessageQuery; +import com.ruoyi.bst.message.domain.MessageVO; + +/** + * 消息Mapper接口 + * + * @author ruoyi + * @date 2025-02-22 + */ +public interface MessageMapper +{ + /** + * 查询消息 + * + * @param id 消息主键 + * @return 消息 + */ + MessageVO selectMessageById(Long id); + + /** + * 查询消息列表 + * + * @param query 消息 + * @return 消息集合 + */ + List selectMessageList(@Param("query")MessageQuery query); + + /** + * 新增消息 + * + * @param message 消息 + * @return 结果 + */ + int insertMessage(Message message); + + /** + * 修改消息 + * + * @param message 消息 + * @return 结果 + */ + public int updateMessage(@Param("data") Message message); + + /** + * 删除消息 + * + * @param id 消息主键 + * @return 结果 + */ + int deleteMessageById(Long id); + + /** + * 批量删除消息 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteMessageByIds(Long[] ids); + + /** + * 根据条件更新 + * @param data + * @param query + * @return + */ + int updateByQuery(@Param("data") Message data, @Param("query") MessageQuery query); + + /** + * 查询数量 + * @param query + * @return + */ + int selectCount(@Param("query") MessageQuery query); + + /** + * 批量插入消息 + * @param list + * @return + */ + int batchInsert(@Param("list") List list); +} diff --git a/ruoyi-service/src/main/java/com/ruoyi/bst/message/mapper/MessageMapper.xml b/ruoyi-service/src/main/java/com/ruoyi/bst/message/mapper/MessageMapper.xml new file mode 100644 index 0000000..58bf0aa --- /dev/null +++ b/ruoyi-service/src/main/java/com/ruoyi/bst/message/mapper/MessageMapper.xml @@ -0,0 +1,165 @@ + + + + + + + + select + bm.id, + bm.user_id, + bm.bst_type, + bm.bst_id, + bm.title, + bm.content, + bm.is_read, + bm.create_time, + bm.read_time + from bst_message bm + + + + and bm.id = #{query.id} + and bm.user_id = #{query.userId} + and bm.bst_type = #{query.bstType} + and bm.bst_id = #{query.bstId} + and bm.title like concat('%', #{query.title}, '%') + and bm.content like concat('%', #{query.content}, '%') + and bm.is_read = #{query.isRead} + and bm.read_time = #{query.readTime} + ${@com.ruoyi.framework.util.DataScopeUtil@dataScope( + null, + "bm.user_id", + null, + null, + query.scope + )} + ${query.params.dataScope} + + + + + + + + insert into bst_message + + user_id, + bst_type, + bst_id, + title, + content, + is_read, + create_time, + read_time, + + + #{userId}, + #{bstType}, + #{bstId}, + #{title}, + #{content}, + #{isRead}, + #{createTime}, + #{readTime}, + + + + + + insert into bst_message + + user_id, + bst_type, + bst_id, + title, + content, + is_read, + create_time, + read_time, + + values + + + #{i.userId}, + default, + #{i.bstType}, + default, + #{i.bstId}, + default, + #{i.title}, + default, + #{i.content}, + default, + #{i.isRead}, + default, + #{i.createTime}, + default, + #{i.readTime}, + default, + + + + + + update bst_message + + + + where id = #{data.id} + + + + user_id = #{data.userId}, + bst_type = #{data.bstType}, + bst_id = #{data.bstId}, + title = #{data.title}, + content = #{data.content}, + is_read = #{data.isRead}, + create_time = #{data.createTime}, + read_time = #{data.readTime}, + + + + delete from bst_message where id = #{id} + + + + delete from bst_message where id in + + #{id} + + + + + + + update bst_message bm + + + + + + + + + + + + diff --git a/ruoyi-service/src/main/java/com/ruoyi/bst/message/service/MessageConverter.java b/ruoyi-service/src/main/java/com/ruoyi/bst/message/service/MessageConverter.java new file mode 100644 index 0000000..e71ec06 --- /dev/null +++ b/ruoyi-service/src/main/java/com/ruoyi/bst/message/service/MessageConverter.java @@ -0,0 +1,46 @@ +package com.ruoyi.bst.message.service; + +import java.util.List; + +import com.ruoyi.bst.message.domain.Message; +import com.ruoyi.bst.task.domain.TaskVO; +import com.ruoyi.bst.taskSubmit.domain.TaskSubmitVO; + +public interface MessageConverter { + + /** + * 将任务创建消息转换为消息实体 + * @param vo + * @return + */ + List toPoByTaskCreate(TaskVO vo); + + /** + * 将任务更新消息转换为消息实体 + * @param vo + * @return + */ + List toPoByTaskUpdate(TaskVO vo); + + /** + * 将任务提交消息转换为消息实体 + * @param vo + * @return + */ + List toPoByTaskSubmit(TaskSubmitVO vo); + + /** + * 将任务完成消息转换为消息实体 + * @param vo + * @return + */ + List toPoByTaskPass(TaskVO vo); + + /** + * 将任务取消消息转换为消息实体 + * @param vo + * @return + */ + List toPoByTaskCancel(TaskVO vo); + +} diff --git a/ruoyi-service/src/main/java/com/ruoyi/bst/message/service/MessageService.java b/ruoyi-service/src/main/java/com/ruoyi/bst/message/service/MessageService.java new file mode 100644 index 0000000..689f077 --- /dev/null +++ b/ruoyi-service/src/main/java/com/ruoyi/bst/message/service/MessageService.java @@ -0,0 +1,86 @@ +package com.ruoyi.bst.message.service; + +import java.util.List; + +import com.ruoyi.bst.message.domain.Message; +import com.ruoyi.bst.message.domain.MessageQuery; +import com.ruoyi.bst.message.domain.MessageVO; + +/** + * 消息Service接口 + * + * @author ruoyi + * @date 2025-02-22 + */ +public interface MessageService +{ + /** + * 查询消息 + * + * @param id 消息主键 + * @return 消息 + */ + public MessageVO selectMessageById(Long id); + + /** + * 查询消息列表 + * + * @param message 消息 + * @return 消息集合 + */ + public List selectMessageList(MessageQuery message); + + /** + * 新增消息 + * + * @param message 消息 + * @return 结果 + */ + public int insertMessage(Message message); + + /** + * 修改消息 + * + * @param message 消息 + * @return 结果 + */ + public int updateMessage(Message message); + + /** + * 批量删除消息 + * + * @param ids 需要删除的消息主键集合 + * @return 结果 + */ + public int deleteMessageByIds(Long[] ids); + + /** + * 删除消息信息 + * + * @param id 消息主键 + * @return 结果 + */ + public int deleteMessageById(Long id); + + /** + * 消息已读 + * @param userId + * @param id + * @return + */ + public int read(Long userId, Long id); + + /** + * 查询未读消息数量 + * @param query + * @return + */ + public int selectCount(MessageQuery query); + + /** + * 批量插入消息 + * @param list + * @return + */ + public int batchInsert(List list); +} diff --git a/ruoyi-service/src/main/java/com/ruoyi/bst/message/service/impl/MessageConverterImpl.java b/ruoyi-service/src/main/java/com/ruoyi/bst/message/service/impl/MessageConverterImpl.java new file mode 100644 index 0000000..f3d9a3f --- /dev/null +++ b/ruoyi-service/src/main/java/com/ruoyi/bst/message/service/impl/MessageConverterImpl.java @@ -0,0 +1,148 @@ +package com.ruoyi.bst.message.service.impl; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +import org.springframework.stereotype.Service; + +import com.google.common.base.Objects; +import com.ruoyi.bst.message.domain.Message; +import com.ruoyi.bst.message.domain.enums.MessageBstType; +import com.ruoyi.bst.message.service.MessageConverter; +import com.ruoyi.bst.task.domain.TaskVO; +import com.ruoyi.bst.taskSubmit.domain.TaskSubmitVO; +import com.ruoyi.common.utils.collection.CollectionUtils; + +@Service +public class MessageConverterImpl implements MessageConverter { + + + @Override + public List toPoByTaskCreate(TaskVO vo) { + if (vo == null || CollectionUtils.isEmptyElement(vo.getOwnerIds())) { + return Collections.emptyList(); + } + + List result = new ArrayList<>(); + String bstType = MessageBstType.TASK.getValue(); + String title = "新任务"; + String content = String.format("%s创建了一个新任务:%s\n截止时间:%s", vo.getCreateName(), vo.getDescription(), vo.getExpireTime()); + + for (Long ownerId : vo.getOwnerIds()) { + Message message = new Message(); + message.setBstType(bstType); + message.setBstId(vo.getId()); + message.setUserId(ownerId); + message.setTitle(title); + message.setContent(content); + result.add(message); + } + + return result; + } + + @Override + public List toPoByTaskUpdate(TaskVO vo) { + if (vo == null || CollectionUtils.isEmptyElement(vo.getOwnerIds())) { + return Collections.emptyList(); + } + + List result = new ArrayList<>(); + String bstType = MessageBstType.TASK.getValue(); + String title = "任务更新"; + String content = String.format("新内容:%s", vo.getDescription()); + + for (Long ownerId : vo.getOwnerIds()) { + Message message = new Message(); + message.setBstType(bstType); + message.setBstId(vo.getId()); + message.setUserId(ownerId); + message.setTitle(title); + message.setContent(content); + result.add(message); + } + + return result; + } + + @Override + public List toPoByTaskSubmit(TaskSubmitVO vo) { + if (vo == null) { + return Collections.emptyList(); + } + + List result = new ArrayList<>(); + String bstType = MessageBstType.TASK.getValue(); + String title = "任务提交"; + String remark = vo.getRemark() == null ? "--" : vo.getRemark(); + String content = String.format("%s提交了任务:%s\n备注:%s", vo.getUserName(), vo.getTaskDescription(), remark); + + // 获取通知人:任务创建人、除了提交人以外的任务负责人 + List userIds = vo.getTaskOwnerIds() == null ? new ArrayList<>() : vo.getTaskOwnerIds(); + userIds.add(vo.getTaskCreateId()); + userIds = userIds.stream().filter(item -> { + return item != null && !Objects.equal(item, vo.getUserId()); + }).collect(Collectors.toList()); + + for (Long ownerId : userIds) { + Message message = new Message(); + message.setBstType(bstType); + message.setBstId(vo.getTaskId()); + message.setUserId(ownerId); + message.setTitle(title); + message.setContent(content); + result.add(message); + } + + return result; + } + + @Override + public List toPoByTaskPass(TaskVO vo) { + if (vo == null) { + return Collections.emptyList(); + } + + List result = new ArrayList<>(); + String bstType = MessageBstType.TASK.getValue(); + String title = "任务完成"; + String content = String.format("任务:%s已完成", vo.getDescription()); + + Message message = new Message(); + message.setBstType(bstType); + message.setBstId(vo.getId()); + message.setUserId(vo.getCreateId()); + message.setTitle(title); + message.setContent(content); + result.add(message); + + return result; + } + + @Override + public List toPoByTaskCancel(TaskVO vo) { + if (vo == null) { + return Collections.emptyList(); + } + + List result = new ArrayList<>(); + String bstType = MessageBstType.TASK.getValue(); + String title = "任务取消"; + String content = String.format("任务:%s已取消\n取消原因:%s", vo.getDescription(), vo.getCancelRemark()); + + for (Long ownerId : vo.getOwnerIds()) { + Message message = new Message(); + message.setBstType(bstType); + message.setBstId(vo.getId()); + message.setUserId(ownerId); + message.setTitle(title); + message.setContent(content); + result.add(message); + } + + return result; + } + +} diff --git a/ruoyi-service/src/main/java/com/ruoyi/bst/message/service/impl/MessageServiceImpl.java b/ruoyi-service/src/main/java/com/ruoyi/bst/message/service/impl/MessageServiceImpl.java new file mode 100644 index 0000000..ed92052 --- /dev/null +++ b/ruoyi-service/src/main/java/com/ruoyi/bst/message/service/impl/MessageServiceImpl.java @@ -0,0 +1,163 @@ +package com.ruoyi.bst.message.service.impl; + +import java.time.LocalDateTime; +import java.util.Date; +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.ruoyi.bst.message.domain.Message; +import com.ruoyi.bst.message.domain.MessageQuery; +import com.ruoyi.bst.message.domain.MessageVO; +import com.ruoyi.bst.message.mapper.MessageMapper; +import com.ruoyi.bst.message.service.MessageService; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.collection.CollectionUtils; +import com.ruoyi.ws.service.WebSocketService; + +import lombok.extern.slf4j.Slf4j; + +/** + * 消息Service业务层处理 + * + * @author ruoyi + * @date 2025-02-22 + */ +@Service +@Slf4j +public class MessageServiceImpl implements MessageService +{ + @Autowired + private MessageMapper messageMapper; + + @Autowired + private WebSocketService webSocketService; + + /** + * 查询消息 + * + * @param id 消息主键 + * @return 消息 + */ + @Override + public MessageVO selectMessageById(Long id) + { + return messageMapper.selectMessageById(id); + } + + /** + * 查询消息列表 + * + * @param message 消息 + * @return 消息 + */ + @Override + public List selectMessageList(MessageQuery message) + { + return messageMapper.selectMessageList(message); + } + + /** + * 新增消息 + * + * @param message 消息 + * @return 结果 + */ + @Override + public int insertMessage(Message message) + { + message.setCreateTime(DateUtils.getNowDate()); + int rows = messageMapper.insertMessage(message); + if (rows > 0) { + if (message.getUserId() != null) { + webSocketService.sendMessageToUser(message, message.getUserId()); + } + } + return rows; + } + + /** + * 修改消息 + * + * @param message 消息 + * @return 结果 + */ + @Override + public int updateMessage(Message message) + { + return messageMapper.updateMessage(message); + } + + /** + * 批量删除消息 + * + * @param ids 需要删除的消息主键 + * @return 结果 + */ + @Override + public int deleteMessageByIds(Long[] ids) + { + return messageMapper.deleteMessageByIds(ids); + } + + /** + * 删除消息信息 + * + * @param id 消息主键 + * @return 结果 + */ + @Override + public int deleteMessageById(Long id) + { + return messageMapper.deleteMessageById(id); + } + + @Override + public int read(Long userId, Long id){ + // 两个条件不允许同时为空 + if (id == null && userId == null) { + return 0; + } + Message data = new Message(); + data.setIsRead(true); + data.setReadTime(LocalDateTime.now()); + MessageQuery query = new MessageQuery(); + query.setUserId(userId); + query.setId(id); + query.setIsRead(false); + return messageMapper.updateByQuery(data, query); + } + + @Override + public int selectCount(MessageQuery query) + { + return messageMapper.selectCount(query); + } + + @Override + public int batchInsert(List list) { + if (CollectionUtils.isEmptyElement(list)) { + return 0; + } + Date now = DateUtils.getNowDate(); + list.forEach(message -> { + message.setCreateTime(now); + }); + int rows = messageMapper.batchInsert(list); + + if (rows > 0) { + for (Message message : list) { + try { + if (message.getUserId() != null) { + webSocketService.sendMessageToUser(message, message.getUserId()); + } + } catch (Exception e) { + log.error("发送消息给用户{}失败", message.getUserId(), e); + } + } + } + + return rows; + } +} diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/notice/domain/Notice.java b/ruoyi-service/src/main/java/com/ruoyi/bst/notice/domain/Notice.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/notice/domain/Notice.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/notice/domain/Notice.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/notice/domain/NoticeQuery.java b/ruoyi-service/src/main/java/com/ruoyi/bst/notice/domain/NoticeQuery.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/notice/domain/NoticeQuery.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/notice/domain/NoticeQuery.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/notice/domain/NoticeVO.java b/ruoyi-service/src/main/java/com/ruoyi/bst/notice/domain/NoticeVO.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/notice/domain/NoticeVO.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/notice/domain/NoticeVO.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/notice/mapper/NoticeMapper.java b/ruoyi-service/src/main/java/com/ruoyi/bst/notice/mapper/NoticeMapper.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/notice/mapper/NoticeMapper.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/notice/mapper/NoticeMapper.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/notice/mapper/NoticeMapper.xml b/ruoyi-service/src/main/java/com/ruoyi/bst/notice/mapper/NoticeMapper.xml similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/notice/mapper/NoticeMapper.xml rename to ruoyi-service/src/main/java/com/ruoyi/bst/notice/mapper/NoticeMapper.xml diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/notice/service/NoticeAssembler.java b/ruoyi-service/src/main/java/com/ruoyi/bst/notice/service/NoticeAssembler.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/notice/service/NoticeAssembler.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/notice/service/NoticeAssembler.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/notice/service/NoticeService.java b/ruoyi-service/src/main/java/com/ruoyi/bst/notice/service/NoticeService.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/notice/service/NoticeService.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/notice/service/NoticeService.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/notice/service/impl/NoticeAssemblerImpl.java b/ruoyi-service/src/main/java/com/ruoyi/bst/notice/service/impl/NoticeAssemblerImpl.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/notice/service/impl/NoticeAssemblerImpl.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/notice/service/impl/NoticeAssemblerImpl.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/notice/service/impl/NoticeServiceImpl.java b/ruoyi-service/src/main/java/com/ruoyi/bst/notice/service/impl/NoticeServiceImpl.java similarity index 59% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/notice/service/impl/NoticeServiceImpl.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/notice/service/impl/NoticeServiceImpl.java index c5674f2..1bbb436 100644 --- a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/notice/service/impl/NoticeServiceImpl.java +++ b/ruoyi-service/src/main/java/com/ruoyi/bst/notice/service/impl/NoticeServiceImpl.java @@ -1,16 +1,21 @@ package com.ruoyi.bst.notice.service.impl; +import java.util.HashSet; import java.util.List; +import java.util.Set; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import com.ruoyi.bst.message.domain.Message; import com.ruoyi.bst.notice.domain.Notice; import com.ruoyi.bst.notice.domain.NoticeQuery; import com.ruoyi.bst.notice.domain.NoticeVO; import com.ruoyi.bst.notice.mapper.NoticeMapper; import com.ruoyi.bst.notice.service.NoticeService; import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.system.user.service.UserService; +import com.ruoyi.ws.service.WebSocketService; /** * 公告Service业务层处理 @@ -24,6 +29,13 @@ public class NoticeServiceImpl implements NoticeService @Autowired private NoticeMapper noticeMapper; + @Autowired + private WebSocketService webSocketService; + + @Autowired + private UserService userService; + + /** * 查询公告 * @@ -58,7 +70,12 @@ public class NoticeServiceImpl implements NoticeService public int insertNotice(Notice notice) { notice.setCreateTime(DateUtils.getNowDate()); - return noticeMapper.insertNotice(notice); + int rows = noticeMapper.insertNotice(notice); + + // 发送消息给接收人 + this.sendNotice(notice.getId()); + + return rows; } /** @@ -70,7 +87,36 @@ public class NoticeServiceImpl implements NoticeService @Override public int updateNotice(Notice notice) { - return noticeMapper.updateNotice(notice); + int rows = noticeMapper.updateNotice(notice); + + // 发送消息给接收人 + this.sendNotice(notice.getId()); + + return rows; + } + + + /** + * 发送消息给接收人 + * @param id + */ + private boolean sendNotice(Long id) { + NoticeVO vo = this.selectNoticeById(id); + if (vo == null) { + return false; + } + + // 获取接收人ID列表 + Set userIds = vo.getReceiveUserIds() == null ? new HashSet<>() : new HashSet<>(vo.getReceiveUserIds()); + userIds.addAll(userService.selectUserIdsByDeptIds(vo.getReceiveDeptIds())); + + // 发送消息给接收人 + Message message = new Message(); + message.setTitle("【公告】" + vo.getTitle()); + message.setContent(vo.getContent()); + webSocketService.sendMessageToUser(message, userIds); + + return true; } /** diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/project/domain/Project.java b/ruoyi-service/src/main/java/com/ruoyi/bst/project/domain/Project.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/project/domain/Project.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/project/domain/Project.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/project/domain/ProjectQuery.java b/ruoyi-service/src/main/java/com/ruoyi/bst/project/domain/ProjectQuery.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/project/domain/ProjectQuery.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/project/domain/ProjectQuery.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/project/domain/ProjectVO.java b/ruoyi-service/src/main/java/com/ruoyi/bst/project/domain/ProjectVO.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/project/domain/ProjectVO.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/project/domain/ProjectVO.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/project/domain/dto/ProjectMaintenanceDTO.java b/ruoyi-service/src/main/java/com/ruoyi/bst/project/domain/dto/ProjectMaintenanceDTO.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/project/domain/dto/ProjectMaintenanceDTO.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/project/domain/dto/ProjectMaintenanceDTO.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/project/domain/dto/ProjectStartDTO.java b/ruoyi-service/src/main/java/com/ruoyi/bst/project/domain/dto/ProjectStartDTO.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/project/domain/dto/ProjectStartDTO.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/project/domain/dto/ProjectStartDTO.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/project/domain/enums/ProjectStatus.java b/ruoyi-service/src/main/java/com/ruoyi/bst/project/domain/enums/ProjectStatus.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/project/domain/enums/ProjectStatus.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/project/domain/enums/ProjectStatus.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/project/domain/vo/ProjectNameVO.java b/ruoyi-service/src/main/java/com/ruoyi/bst/project/domain/vo/ProjectNameVO.java similarity index 52% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/project/domain/vo/ProjectNameVO.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/project/domain/vo/ProjectNameVO.java index 1c73fa3..b6abc56 100644 --- a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/project/domain/vo/ProjectNameVO.java +++ b/ruoyi-service/src/main/java/com/ruoyi/bst/project/domain/vo/ProjectNameVO.java @@ -1,5 +1,7 @@ package com.ruoyi.bst.project.domain.vo; +import java.util.List; + import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -12,4 +14,13 @@ public class ProjectNameVO { @ApiModelProperty("项目名称") private String name; + @ApiModelProperty("项目负责人ID") + private Long ownerId; + + @ApiModelProperty("项目跟进人ID") + private Long followId; + + @ApiModelProperty("项目成员ID列表") + private List memberIds; + } diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/project/mapper/ProjectMapper.java b/ruoyi-service/src/main/java/com/ruoyi/bst/project/mapper/ProjectMapper.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/project/mapper/ProjectMapper.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/project/mapper/ProjectMapper.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/project/mapper/ProjectMapper.xml b/ruoyi-service/src/main/java/com/ruoyi/bst/project/mapper/ProjectMapper.xml similarity index 97% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/project/mapper/ProjectMapper.xml rename to ruoyi-service/src/main/java/com/ruoyi/bst/project/mapper/ProjectMapper.xml index aae23c0..1ada96a 100644 --- a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/project/mapper/ProjectMapper.xml +++ b/ruoyi-service/src/main/java/com/ruoyi/bst/project/mapper/ProjectMapper.xml @@ -199,10 +199,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and deleted = false - select bp.id, - bp.name + bp.name, + bp.owner_id, + bp.follow_id, + bp.member_ids from bst_project bp diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/project/service/ProjectAssembler.java b/ruoyi-service/src/main/java/com/ruoyi/bst/project/service/ProjectAssembler.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/project/service/ProjectAssembler.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/project/service/ProjectAssembler.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/project/service/ProjectConverter.java b/ruoyi-service/src/main/java/com/ruoyi/bst/project/service/ProjectConverter.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/project/service/ProjectConverter.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/project/service/ProjectConverter.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/project/service/ProjectService.java b/ruoyi-service/src/main/java/com/ruoyi/bst/project/service/ProjectService.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/project/service/ProjectService.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/project/service/ProjectService.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/project/service/ProjectValidator.java b/ruoyi-service/src/main/java/com/ruoyi/bst/project/service/ProjectValidator.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/project/service/ProjectValidator.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/project/service/ProjectValidator.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/project/service/impl/ProjectAssemblerImpl.java b/ruoyi-service/src/main/java/com/ruoyi/bst/project/service/impl/ProjectAssemblerImpl.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/project/service/impl/ProjectAssemblerImpl.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/project/service/impl/ProjectAssemblerImpl.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/project/service/impl/ProjectConverterImpl.java b/ruoyi-service/src/main/java/com/ruoyi/bst/project/service/impl/ProjectConverterImpl.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/project/service/impl/ProjectConverterImpl.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/project/service/impl/ProjectConverterImpl.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/project/service/impl/ProjectServiceImpl.java b/ruoyi-service/src/main/java/com/ruoyi/bst/project/service/impl/ProjectServiceImpl.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/project/service/impl/ProjectServiceImpl.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/project/service/impl/ProjectServiceImpl.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/project/service/impl/ProjectValidatorImpl.java b/ruoyi-service/src/main/java/com/ruoyi/bst/project/service/impl/ProjectValidatorImpl.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/project/service/impl/ProjectValidatorImpl.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/project/service/impl/ProjectValidatorImpl.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/domain/Task.java b/ruoyi-service/src/main/java/com/ruoyi/bst/task/domain/Task.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/domain/Task.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/task/domain/Task.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/domain/TaskQuery.java b/ruoyi-service/src/main/java/com/ruoyi/bst/task/domain/TaskQuery.java similarity index 93% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/domain/TaskQuery.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/task/domain/TaskQuery.java index a4ddf0a..6b9eee6 100644 --- a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/domain/TaskQuery.java +++ b/ruoyi-service/src/main/java/com/ruoyi/bst/task/domain/TaskQuery.java @@ -18,6 +18,6 @@ public class TaskQuery extends TaskVO{ private List statusList; @ApiModelProperty("任务id列表") - private List taskIds; + private List ids; } diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/domain/TaskVO.java b/ruoyi-service/src/main/java/com/ruoyi/bst/task/domain/TaskVO.java similarity index 79% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/domain/TaskVO.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/task/domain/TaskVO.java index 12d5ae6..a422f50 100644 --- a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/domain/TaskVO.java +++ b/ruoyi-service/src/main/java/com/ruoyi/bst/task/domain/TaskVO.java @@ -34,4 +34,13 @@ public class TaskVO extends Task{ @ApiModelProperty("是否逾期") private Boolean overdue; + + @ApiModelProperty("项目负责人ID") + private Long projectOwnerId; + + @ApiModelProperty("项目跟进人ID") + private Long projectFollowId; + + @ApiModelProperty("项目成员ID列表") + private List projectMemberIds; } diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/domain/dto/TaskCancelDTO.java b/ruoyi-service/src/main/java/com/ruoyi/bst/task/domain/dto/TaskCancelDTO.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/domain/dto/TaskCancelDTO.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/task/domain/dto/TaskCancelDTO.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/domain/dto/TaskStartDTO.java b/ruoyi-service/src/main/java/com/ruoyi/bst/task/domain/dto/TaskStartDTO.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/domain/dto/TaskStartDTO.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/task/domain/dto/TaskStartDTO.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/domain/dto/TaskSubmitDTO.java b/ruoyi-service/src/main/java/com/ruoyi/bst/task/domain/dto/TaskSubmitDTO.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/domain/dto/TaskSubmitDTO.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/task/domain/dto/TaskSubmitDTO.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/domain/enums/TaskStatus.java b/ruoyi-service/src/main/java/com/ruoyi/bst/task/domain/enums/TaskStatus.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/domain/enums/TaskStatus.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/task/domain/enums/TaskStatus.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/domain/enums/TaskType.java b/ruoyi-service/src/main/java/com/ruoyi/bst/task/domain/enums/TaskType.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/domain/enums/TaskType.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/task/domain/enums/TaskType.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/mapper/TaskMapper.java b/ruoyi-service/src/main/java/com/ruoyi/bst/task/mapper/TaskMapper.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/mapper/TaskMapper.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/task/mapper/TaskMapper.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/mapper/TaskMapper.xml b/ruoyi-service/src/main/java/com/ruoyi/bst/task/mapper/TaskMapper.xml similarity index 93% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/mapper/TaskMapper.xml rename to ruoyi-service/src/main/java/com/ruoyi/bst/task/mapper/TaskMapper.xml index 68fbbed..b9bddc4 100644 --- a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/mapper/TaskMapper.xml +++ b/ruoyi-service/src/main/java/com/ruoyi/bst/task/mapper/TaskMapper.xml @@ -6,6 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -34,6 +35,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" bt.cancel_remark, as overdue, bp.name as project_name, + bp.owner_id as project_owner_id, + bp.follow_id as project_follow_id, + bp.member_ids as project_member_ids, su.nick_name as create_name, cu.nick_name as cancel_user_name from bst_task bt @@ -63,12 +67,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and = #{query.overdue} + and bp.owner_id = #{query.projectOwnerId} + and bp.follow_id = #{query.projectFollowId} and bt.status in #{item} + + and bt.id in + + #{item} + + ${@com.ruoyi.framework.util.DataScopeUtil@dataScope( null, "bt.cancel_user_id,bt.create_id", diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/service/TaskAssembler.java b/ruoyi-service/src/main/java/com/ruoyi/bst/task/service/TaskAssembler.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/service/TaskAssembler.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/task/service/TaskAssembler.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/service/TaskConverter.java b/ruoyi-service/src/main/java/com/ruoyi/bst/task/service/TaskConverter.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/service/TaskConverter.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/task/service/TaskConverter.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/service/TaskService.java b/ruoyi-service/src/main/java/com/ruoyi/bst/task/service/TaskService.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/service/TaskService.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/task/service/TaskService.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/service/TaskValidator.java b/ruoyi-service/src/main/java/com/ruoyi/bst/task/service/TaskValidator.java similarity index 77% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/service/TaskValidator.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/task/service/TaskValidator.java index fdf94e7..7724a77 100644 --- a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/service/TaskValidator.java +++ b/ruoyi-service/src/main/java/com/ruoyi/bst/task/service/TaskValidator.java @@ -1,5 +1,7 @@ package com.ruoyi.bst.task.service; +import com.ruoyi.bst.task.domain.TaskVO; + public interface TaskValidator { /** @@ -17,5 +19,11 @@ public interface TaskValidator { * @return 是否能开始 */ boolean allowStart(Long id, Long userId); + + /** + * 校验任务 + * @param vo 任务VO + */ + void validate(TaskVO vo); } diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/service/impl/TaskAssemblerImpl.java b/ruoyi-service/src/main/java/com/ruoyi/bst/task/service/impl/TaskAssemblerImpl.java similarity index 94% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/service/impl/TaskAssemblerImpl.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/task/service/impl/TaskAssemblerImpl.java index 054e098..932aea1 100644 --- a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/service/impl/TaskAssemblerImpl.java +++ b/ruoyi-service/src/main/java/com/ruoyi/bst/task/service/impl/TaskAssemblerImpl.java @@ -9,9 +9,9 @@ import java.util.stream.Collectors; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import com.ruoyi.bst.task.domain.TaskQuery; import com.ruoyi.bst.task.domain.TaskVO; import com.ruoyi.bst.task.service.TaskAssembler; +import com.ruoyi.bst.taskSubmit.domain.TaskSubmitQuery; import com.ruoyi.bst.taskSubmit.domain.TaskSubmitVO; import com.ruoyi.bst.taskSubmit.domain.enums.TaskSubmitStatus; import com.ruoyi.bst.taskSubmit.service.TaskSubmitService; @@ -75,7 +75,7 @@ public class TaskAssemblerImpl implements TaskAssembler { } List taskIds = CollectionUtils.map(list, TaskVO::getId); - TaskQuery query = new TaskQuery(); + TaskSubmitQuery query = new TaskSubmitQuery(); query.setTaskIds(taskIds); Map map = taskSubmitService.selectCountGroupByTaskId(query) .stream().collect(Collectors.toMap(LongIntegerVO::getKey, LongIntegerVO::getValue)); @@ -97,7 +97,7 @@ public class TaskAssemblerImpl implements TaskAssembler { } List taskIds = CollectionUtils.map(list, TaskVO::getId); - TaskQuery query = new TaskQuery(); + TaskSubmitQuery query = new TaskSubmitQuery(); query.setTaskIds(taskIds); query.setStatus(TaskSubmitStatus.PASS.getCode()); Map map = taskSubmitService.selectCountGroupByTaskId(query) @@ -108,7 +108,7 @@ public class TaskAssemblerImpl implements TaskAssembler { if (count == null) { count = 0; } - vo.setSubmitCount(count); + vo.setPassCount(count); } } } diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/service/impl/TaskConverterImpl.java b/ruoyi-service/src/main/java/com/ruoyi/bst/task/service/impl/TaskConverterImpl.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/service/impl/TaskConverterImpl.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/task/service/impl/TaskConverterImpl.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/service/impl/TaskServiceImpl.java b/ruoyi-service/src/main/java/com/ruoyi/bst/task/service/impl/TaskServiceImpl.java similarity index 65% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/service/impl/TaskServiceImpl.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/task/service/impl/TaskServiceImpl.java index 4a938e4..312d9db 100644 --- a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/service/impl/TaskServiceImpl.java +++ b/ruoyi-service/src/main/java/com/ruoyi/bst/task/service/impl/TaskServiceImpl.java @@ -7,6 +7,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.support.TransactionTemplate; +import com.ruoyi.bst.message.domain.Message; +import com.ruoyi.bst.message.service.MessageConverter; +import com.ruoyi.bst.message.service.MessageService; import com.ruoyi.bst.task.domain.Task; import com.ruoyi.bst.task.domain.TaskQuery; import com.ruoyi.bst.task.domain.TaskVO; @@ -15,6 +18,7 @@ import com.ruoyi.bst.task.domain.dto.TaskSubmitDTO; import com.ruoyi.bst.task.domain.enums.TaskStatus; import com.ruoyi.bst.task.mapper.TaskMapper; import com.ruoyi.bst.task.service.TaskService; +import com.ruoyi.bst.task.service.TaskValidator; import com.ruoyi.bst.taskSubmit.domain.TaskSubmit; import com.ruoyi.bst.taskSubmit.domain.TaskSubmitQuery; import com.ruoyi.bst.taskSubmit.domain.TaskSubmitVO; @@ -64,6 +68,15 @@ public class TaskServiceImpl implements TaskService @Autowired private RedisLock redisLock; + @Autowired + private TaskValidator taskValidator; + + @Autowired + private MessageService MessageService; + + @Autowired + private MessageConverter messageConverter; + /** * 查询任务 * @@ -101,7 +114,20 @@ public class TaskServiceImpl implements TaskService public int insertTask(Task task) { task.setCreateTime(DateUtils.getNowDate()); - return taskMapper.insertTask(task); + Integer result = transactionTemplate.execute(status -> { + int rows = taskMapper.insertTask(task); + if (rows > 0) { + TaskVO vo = this.selectTaskById(task.getId()); + taskValidator.validate(vo); + + List messages = messageConverter.toPoByTaskCreate(vo); + int messageRows = MessageService.batchInsert(messages); + ServiceUtil.assertion(messageRows != messages.size(), "新增消息失败"); + } + return rows; + }); + + return result == null ? 0 : result; } /** @@ -113,7 +139,24 @@ public class TaskServiceImpl implements TaskService @Override public int updateTask(Task task) { - return taskMapper.updateTask(task); + Integer result = transactionTemplate.execute(status -> { + int rows = taskMapper.updateTask(task); + + if (rows > 0) { + TaskVO vo = this.selectTaskById(task.getId()); + taskValidator.validate(vo); + + // 保存并发送消息 + List messages = messageConverter.toPoByTaskUpdate(vo); + int messageRows = MessageService.batchInsert(messages); + ServiceUtil.assertion(messageRows != messages.size(), "保存消息失败"); + + } + + return rows; + }); + + return result == null ? 0 : result; } /** @@ -158,6 +201,12 @@ public class TaskServiceImpl implements TaskService int insertSubmit = taskSubmitService.insertTaskSubmit(submit); ServiceUtil.assertion(insertSubmit != 1, "新增提交记录失败"); + // 保存并发送消息 + TaskSubmitVO submitVo = taskSubmitService.selectTaskSubmitById(submit.getId()); + List messages = messageConverter.toPoByTaskSubmit(submitVo); + int messageRows = MessageService.batchInsert(messages); + ServiceUtil.assertion(messageRows != messages.size(), "保存消息失败"); + // 尝试更新状态为结束 try { this.passTask(dto.getId()); @@ -199,13 +248,27 @@ public class TaskServiceImpl implements TaskService } // 更新任务状态 - Task data = new Task(); - data.setStatus(TaskStatus.PASS.getStatus()); - data.setPassTime(LocalDateTime.now()); - TaskQuery query = new TaskQuery(); - query.setId(id); - query.setStatusList(TaskStatus.canPass()); - return this.updateByQuery(data, query); + Integer result = transactionTemplate.execute(status -> { + Task data = new Task(); + data.setStatus(TaskStatus.PASS.getStatus()); + data.setPassTime(LocalDateTime.now()); + TaskQuery query = new TaskQuery(); + query.setId(id); + query.setStatusList(TaskStatus.canPass()); + int rows =this.updateByQuery(data, query); + + if (rows > 0) { + // 保存并发送消息 + TaskVO vo = this.selectTaskById(id); + List messages = messageConverter.toPoByTaskPass(vo); + int messageRows = MessageService.batchInsert(messages); + ServiceUtil.assertion(messageRows != messages.size(), "保存消息失败"); + } + + return rows; + }); + + return result == null ? 0 : result; } @Override @@ -219,16 +282,30 @@ public class TaskServiceImpl implements TaskService ServiceUtil.assertion(old == null, "ID为%s的任务不存在", dto.getId()); ServiceUtil.assertion(!TaskStatus.canCancel().contains(old.getStatus()), "ID为%s的任务当前状态不允许取消", dto.getId()); - // 更新任务状态 - Task data = new Task(); - data.setStatus(TaskStatus.CANCEL.getStatus()); - data.setCancelTime(LocalDateTime.now()); - data.setCancelRemark(dto.getCancelRemark()); - data.setCancelUserId(SecurityUtils.getUserId()); - TaskQuery query = new TaskQuery(); - query.setId(dto.getId()); - query.setStatusList(TaskStatus.canCancel()); - return this.updateByQuery(data, query); + Integer result = transactionTemplate.execute(status -> { + // 更新任务状态 + Task data = new Task(); + data.setStatus(TaskStatus.CANCEL.getStatus()); + data.setCancelTime(LocalDateTime.now()); + data.setCancelRemark(dto.getCancelRemark()); + data.setCancelUserId(SecurityUtils.getUserId()); + TaskQuery query = new TaskQuery(); + query.setId(dto.getId()); + query.setStatusList(TaskStatus.canCancel()); + int rows = this.updateByQuery(data, query); + + if (rows > 0) { + // 保存并发送消息 + TaskVO vo = this.selectTaskById(dto.getId()); + List messages = messageConverter.toPoByTaskCancel(vo); + int messageRows = MessageService.batchInsert(messages); + ServiceUtil.assertion(messageRows != messages.size(), "保存消息失败"); + } + + return rows; + }); + + return result == null ? 0 : result; } @Override diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/service/impl/TaskValidatorImpl.java b/ruoyi-service/src/main/java/com/ruoyi/bst/task/service/impl/TaskValidatorImpl.java similarity index 57% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/service/impl/TaskValidatorImpl.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/task/service/impl/TaskValidatorImpl.java index bb064db..cbc16fd 100644 --- a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/task/service/impl/TaskValidatorImpl.java +++ b/ruoyi-service/src/main/java/com/ruoyi/bst/task/service/impl/TaskValidatorImpl.java @@ -1,5 +1,8 @@ package com.ruoyi.bst.task.service.impl; +import java.util.Objects; + +import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -7,7 +10,8 @@ import com.ruoyi.bst.task.domain.Task; import com.ruoyi.bst.task.domain.TaskVO; import com.ruoyi.bst.task.service.TaskService; import com.ruoyi.bst.task.service.TaskValidator; - +import com.ruoyi.common.utils.ServiceUtil; + @Service public class TaskValidatorImpl implements TaskValidator{ @@ -36,4 +40,22 @@ public class TaskValidatorImpl implements TaskValidator{ private boolean isOwner(Task task, Long userId) { return task != null && task.getOwnerIds() != null && task.getOwnerIds().contains(userId); } + + @Override + public void validate(TaskVO vo) { + ServiceUtil.assertion(vo == null, "任务不能为空"); + + if (vo.getProjectId() != null && CollectionUtils.isNotEmpty(vo.getOwnerIds())) { + // 判断负责人是否是项目的成员 + for (Long ownerId : vo.getOwnerIds()) { + boolean isMember = Objects.equals(vo.getProjectOwnerId(), ownerId) + || Objects.equals(vo.getProjectFollowId(), ownerId) + || vo.getProjectMemberIds().contains(ownerId); + if (!isMember) { + throw new RuntimeException(String.format("ID为%s的负责人不是项目的成员", ownerId)); + } + } + } + + } } diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/taskSubmit/domain/TaskSubmit.java b/ruoyi-service/src/main/java/com/ruoyi/bst/taskSubmit/domain/TaskSubmit.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/taskSubmit/domain/TaskSubmit.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/taskSubmit/domain/TaskSubmit.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/taskSubmit/domain/TaskSubmitQuery.java b/ruoyi-service/src/main/java/com/ruoyi/bst/taskSubmit/domain/TaskSubmitQuery.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/taskSubmit/domain/TaskSubmitQuery.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/taskSubmit/domain/TaskSubmitQuery.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/taskSubmit/domain/TaskSubmitVO.java b/ruoyi-service/src/main/java/com/ruoyi/bst/taskSubmit/domain/TaskSubmitVO.java similarity index 65% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/taskSubmit/domain/TaskSubmitVO.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/taskSubmit/domain/TaskSubmitVO.java index a1ae926..e945ab1 100644 --- a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/taskSubmit/domain/TaskSubmitVO.java +++ b/ruoyi-service/src/main/java/com/ruoyi/bst/taskSubmit/domain/TaskSubmitVO.java @@ -1,5 +1,7 @@ package com.ruoyi.bst.taskSubmit.domain; +import java.util.List; + import com.ruoyi.bst.verify.domain.VerifyVO; import io.swagger.annotations.ApiModelProperty; @@ -20,4 +22,12 @@ public class TaskSubmitVO extends TaskSubmit { @ApiModelProperty("任务状态") private String taskStatus; + @ApiModelProperty("任务描述") + private String taskDescription; + + @ApiModelProperty("任务创建人ID") + private Long taskCreateId; + + @ApiModelProperty("任务负责人ID列表") + private List taskOwnerIds; } diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/taskSubmit/domain/dto/TaskSubmitRejectDTO.java b/ruoyi-service/src/main/java/com/ruoyi/bst/taskSubmit/domain/dto/TaskSubmitRejectDTO.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/taskSubmit/domain/dto/TaskSubmitRejectDTO.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/taskSubmit/domain/dto/TaskSubmitRejectDTO.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/taskSubmit/domain/dto/TaskSubmitVerifyDTO.java b/ruoyi-service/src/main/java/com/ruoyi/bst/taskSubmit/domain/dto/TaskSubmitVerifyDTO.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/taskSubmit/domain/dto/TaskSubmitVerifyDTO.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/taskSubmit/domain/dto/TaskSubmitVerifyDTO.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/taskSubmit/domain/enums/TaskSubmitStatus.java b/ruoyi-service/src/main/java/com/ruoyi/bst/taskSubmit/domain/enums/TaskSubmitStatus.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/taskSubmit/domain/enums/TaskSubmitStatus.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/taskSubmit/domain/enums/TaskSubmitStatus.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/taskSubmit/mapper/TaskSubmitMapper.java b/ruoyi-service/src/main/java/com/ruoyi/bst/taskSubmit/mapper/TaskSubmitMapper.java similarity index 96% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/taskSubmit/mapper/TaskSubmitMapper.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/taskSubmit/mapper/TaskSubmitMapper.java index db7f4c3..905c9a9 100644 --- a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/taskSubmit/mapper/TaskSubmitMapper.java +++ b/ruoyi-service/src/main/java/com/ruoyi/bst/taskSubmit/mapper/TaskSubmitMapper.java @@ -4,7 +4,6 @@ import java.util.List; import org.apache.ibatis.annotations.Param; -import com.ruoyi.bst.task.domain.TaskQuery; import com.ruoyi.bst.taskSubmit.domain.TaskSubmit; import com.ruoyi.bst.taskSubmit.domain.TaskSubmitQuery; import com.ruoyi.bst.taskSubmit.domain.TaskSubmitVO; @@ -79,5 +78,5 @@ public interface TaskSubmitMapper * @param query 查询条件 * @return 任务ID和对应的提交数量 */ - List selectCountGroupByTaskId(@Param("query") TaskQuery query); + List selectCountGroupByTaskId(@Param("query") TaskSubmitQuery query); } diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/taskSubmit/mapper/TaskSubmitMapper.xml b/ruoyi-service/src/main/java/com/ruoyi/bst/taskSubmit/mapper/TaskSubmitMapper.xml similarity index 91% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/taskSubmit/mapper/TaskSubmitMapper.xml rename to ruoyi-service/src/main/java/com/ruoyi/bst/taskSubmit/mapper/TaskSubmitMapper.xml index 44fc764..7457b99 100644 --- a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/taskSubmit/mapper/TaskSubmitMapper.xml +++ b/ruoyi-service/src/main/java/com/ruoyi/bst/taskSubmit/mapper/TaskSubmitMapper.xml @@ -5,6 +5,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -21,7 +22,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" bts.verify_time, bt.status as task_status, su.nick_name as user_name, - su.avatar as user_avatar + su.avatar as user_avatar, + bt.description as task_description, + bt.create_id as task_create_id, + bt.owner_ids as task_owner_ids from bst_task_submit bts left join bst_task bt on bt.id = bts.task_id left join sys_user su on su.user_id = bts.user_id @@ -35,9 +39,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and bts.verify_id = #{query.verifyId} and bts.status = #{query.status} and bt.status = #{query.taskStatus} + and bt.description like concat('%', #{query.taskDescription}, '%') and bts.task_id in - #{item} @@ -130,10 +134,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" SELECT task_id as `key`, COUNT(*) as `value` - FROM bst_task_submit + FROM bst_task_submit bts - GROUP BY task_id + GROUP BY `key` diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/taskSubmit/service/TaskSubmitConverter.java b/ruoyi-service/src/main/java/com/ruoyi/bst/taskSubmit/service/TaskSubmitConverter.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/taskSubmit/service/TaskSubmitConverter.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/taskSubmit/service/TaskSubmitConverter.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/taskSubmit/service/TaskSubmitService.java b/ruoyi-service/src/main/java/com/ruoyi/bst/taskSubmit/service/TaskSubmitService.java similarity index 94% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/taskSubmit/service/TaskSubmitService.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/taskSubmit/service/TaskSubmitService.java index 3a70490..11de7b6 100644 --- a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/taskSubmit/service/TaskSubmitService.java +++ b/ruoyi-service/src/main/java/com/ruoyi/bst/taskSubmit/service/TaskSubmitService.java @@ -2,7 +2,6 @@ package com.ruoyi.bst.taskSubmit.service; import java.util.List; -import com.ruoyi.bst.task.domain.TaskQuery; import com.ruoyi.bst.taskSubmit.domain.TaskSubmit; import com.ruoyi.bst.taskSubmit.domain.TaskSubmitQuery; import com.ruoyi.bst.taskSubmit.domain.TaskSubmitVO; @@ -84,5 +83,5 @@ public interface TaskSubmitService * @param query * @return */ - List selectCountGroupByTaskId(TaskQuery query); + List selectCountGroupByTaskId(TaskSubmitQuery query); } diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/taskSubmit/service/impl/TaskSubmitConverterImpl.java b/ruoyi-service/src/main/java/com/ruoyi/bst/taskSubmit/service/impl/TaskSubmitConverterImpl.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/taskSubmit/service/impl/TaskSubmitConverterImpl.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/taskSubmit/service/impl/TaskSubmitConverterImpl.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/taskSubmit/service/impl/TaskSubmitServiceImpl.java b/ruoyi-service/src/main/java/com/ruoyi/bst/taskSubmit/service/impl/TaskSubmitServiceImpl.java similarity index 97% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/taskSubmit/service/impl/TaskSubmitServiceImpl.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/taskSubmit/service/impl/TaskSubmitServiceImpl.java index 8c8bb1a..9e0f921 100644 --- a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/taskSubmit/service/impl/TaskSubmitServiceImpl.java +++ b/ruoyi-service/src/main/java/com/ruoyi/bst/taskSubmit/service/impl/TaskSubmitServiceImpl.java @@ -8,7 +8,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.support.TransactionTemplate; -import com.ruoyi.bst.task.domain.TaskQuery; import com.ruoyi.bst.task.domain.enums.TaskStatus; import com.ruoyi.bst.task.service.TaskService; import com.ruoyi.bst.taskSubmit.domain.TaskSubmit; @@ -175,7 +174,7 @@ public class TaskSubmitServiceImpl implements TaskSubmitService } @Override - public List selectCountGroupByTaskId(TaskQuery query) { + public List selectCountGroupByTaskId(TaskSubmitQuery query) { return taskSubmitMapper.selectCountGroupByTaskId(query); } diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/verify/domain/Verify.java b/ruoyi-service/src/main/java/com/ruoyi/bst/verify/domain/Verify.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/verify/domain/Verify.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/verify/domain/Verify.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/verify/domain/VerifyQuery.java b/ruoyi-service/src/main/java/com/ruoyi/bst/verify/domain/VerifyQuery.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/verify/domain/VerifyQuery.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/verify/domain/VerifyQuery.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/verify/domain/VerifyVO.java b/ruoyi-service/src/main/java/com/ruoyi/bst/verify/domain/VerifyVO.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/verify/domain/VerifyVO.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/verify/domain/VerifyVO.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/verify/domain/enums/VerifyBstType.java b/ruoyi-service/src/main/java/com/ruoyi/bst/verify/domain/enums/VerifyBstType.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/verify/domain/enums/VerifyBstType.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/verify/domain/enums/VerifyBstType.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/verify/domain/enums/VerifyStatus.java b/ruoyi-service/src/main/java/com/ruoyi/bst/verify/domain/enums/VerifyStatus.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/verify/domain/enums/VerifyStatus.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/verify/domain/enums/VerifyStatus.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/verify/mapper/VerifyMapper.java b/ruoyi-service/src/main/java/com/ruoyi/bst/verify/mapper/VerifyMapper.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/verify/mapper/VerifyMapper.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/verify/mapper/VerifyMapper.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/verify/mapper/VerifyMapper.xml b/ruoyi-service/src/main/java/com/ruoyi/bst/verify/mapper/VerifyMapper.xml similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/verify/mapper/VerifyMapper.xml rename to ruoyi-service/src/main/java/com/ruoyi/bst/verify/mapper/VerifyMapper.xml diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/verify/service/VerifyConverter.java b/ruoyi-service/src/main/java/com/ruoyi/bst/verify/service/VerifyConverter.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/verify/service/VerifyConverter.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/verify/service/VerifyConverter.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/verify/service/VerifyService.java b/ruoyi-service/src/main/java/com/ruoyi/bst/verify/service/VerifyService.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/verify/service/VerifyService.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/verify/service/VerifyService.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/verify/service/impl/VerifyConverterImpl.java b/ruoyi-service/src/main/java/com/ruoyi/bst/verify/service/impl/VerifyConverterImpl.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/verify/service/impl/VerifyConverterImpl.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/verify/service/impl/VerifyConverterImpl.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/verify/service/impl/VerifyServiceImpl.java b/ruoyi-service/src/main/java/com/ruoyi/bst/verify/service/impl/VerifyServiceImpl.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/bst/verify/service/impl/VerifyServiceImpl.java rename to ruoyi-service/src/main/java/com/ruoyi/bst/verify/service/impl/VerifyServiceImpl.java diff --git a/ruoyi-service/src/main/java/com/ruoyi/common/constants/RoleConstants.java b/ruoyi-service/src/main/java/com/ruoyi/common/constants/RoleConstants.java new file mode 100644 index 0000000..57cbdfa --- /dev/null +++ b/ruoyi-service/src/main/java/com/ruoyi/common/constants/RoleConstants.java @@ -0,0 +1,14 @@ +package com.ruoyi.common.constants; + +/** + * @author wjh + * 2025/2/21 + */ +public class RoleConstants { + + // 管理员 + public static final String ADMIN = "admin"; + // 系统管理员 + public static final String SYS_ADMIN = "sys_admin"; + +} diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/common/constants/ScopeConstants.java b/ruoyi-service/src/main/java/com/ruoyi/common/constants/ScopeConstants.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/common/constants/ScopeConstants.java rename to ruoyi-service/src/main/java/com/ruoyi/common/constants/ScopeConstants.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/common/mapper/CommonMapper.java b/ruoyi-service/src/main/java/com/ruoyi/common/mapper/CommonMapper.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/common/mapper/CommonMapper.java rename to ruoyi-service/src/main/java/com/ruoyi/common/mapper/CommonMapper.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/common/mapper/CommonMapper.xml b/ruoyi-service/src/main/java/com/ruoyi/common/mapper/CommonMapper.xml similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/common/mapper/CommonMapper.xml rename to ruoyi-service/src/main/java/com/ruoyi/common/mapper/CommonMapper.xml diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/common/mapper/typehandler/FileNameJsonTypeHandler.java b/ruoyi-service/src/main/java/com/ruoyi/common/mapper/typehandler/FileNameJsonTypeHandler.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/common/mapper/typehandler/FileNameJsonTypeHandler.java rename to ruoyi-service/src/main/java/com/ruoyi/common/mapper/typehandler/FileNameJsonTypeHandler.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/common/vo/FileNameVO.java b/ruoyi-service/src/main/java/com/ruoyi/common/vo/FileNameVO.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/common/vo/FileNameVO.java rename to ruoyi-service/src/main/java/com/ruoyi/common/vo/FileNameVO.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/common/vo/IntegerIntegerVO.java b/ruoyi-service/src/main/java/com/ruoyi/common/vo/IntegerIntegerVO.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/common/vo/IntegerIntegerVO.java rename to ruoyi-service/src/main/java/com/ruoyi/common/vo/IntegerIntegerVO.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/common/vo/LocalDateIntegerVO.java b/ruoyi-service/src/main/java/com/ruoyi/common/vo/LocalDateIntegerVO.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/common/vo/LocalDateIntegerVO.java rename to ruoyi-service/src/main/java/com/ruoyi/common/vo/LocalDateIntegerVO.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/common/vo/LongDecimalVO.java b/ruoyi-service/src/main/java/com/ruoyi/common/vo/LongDecimalVO.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/common/vo/LongDecimalVO.java rename to ruoyi-service/src/main/java/com/ruoyi/common/vo/LongDecimalVO.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/common/vo/LongIntegerVO.java b/ruoyi-service/src/main/java/com/ruoyi/common/vo/LongIntegerVO.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/common/vo/LongIntegerVO.java rename to ruoyi-service/src/main/java/com/ruoyi/common/vo/LongIntegerVO.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/common/vo/StringIntegerVO.java b/ruoyi-service/src/main/java/com/ruoyi/common/vo/StringIntegerVO.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/common/vo/StringIntegerVO.java rename to ruoyi-service/src/main/java/com/ruoyi/common/vo/StringIntegerVO.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/dashboard/customer/mapper/DashboardCustomerMapper.java b/ruoyi-service/src/main/java/com/ruoyi/dashboard/customer/mapper/DashboardCustomerMapper.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/dashboard/customer/mapper/DashboardCustomerMapper.java rename to ruoyi-service/src/main/java/com/ruoyi/dashboard/customer/mapper/DashboardCustomerMapper.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/dashboard/customer/mapper/DashboardCustomerMapper.xml b/ruoyi-service/src/main/java/com/ruoyi/dashboard/customer/mapper/DashboardCustomerMapper.xml similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/dashboard/customer/mapper/DashboardCustomerMapper.xml rename to ruoyi-service/src/main/java/com/ruoyi/dashboard/customer/mapper/DashboardCustomerMapper.xml diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/dashboard/customer/service/DashboardCustomerService.java b/ruoyi-service/src/main/java/com/ruoyi/dashboard/customer/service/DashboardCustomerService.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/dashboard/customer/service/DashboardCustomerService.java rename to ruoyi-service/src/main/java/com/ruoyi/dashboard/customer/service/DashboardCustomerService.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/dashboard/index/domain/brief/BriefQuery.java b/ruoyi-service/src/main/java/com/ruoyi/dashboard/index/domain/brief/BriefQuery.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/dashboard/index/domain/brief/BriefQuery.java rename to ruoyi-service/src/main/java/com/ruoyi/dashboard/index/domain/brief/BriefQuery.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/dashboard/index/domain/brief/BriefVO.java b/ruoyi-service/src/main/java/com/ruoyi/dashboard/index/domain/brief/BriefVO.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/dashboard/index/domain/brief/BriefVO.java rename to ruoyi-service/src/main/java/com/ruoyi/dashboard/index/domain/brief/BriefVO.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/dashboard/index/domain/brief/CustomerBriefVO.java b/ruoyi-service/src/main/java/com/ruoyi/dashboard/index/domain/brief/CustomerBriefVO.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/dashboard/index/domain/brief/CustomerBriefVO.java rename to ruoyi-service/src/main/java/com/ruoyi/dashboard/index/domain/brief/CustomerBriefVO.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/dashboard/index/domain/brief/ProjectBriefVO.java b/ruoyi-service/src/main/java/com/ruoyi/dashboard/index/domain/brief/ProjectBriefVO.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/dashboard/index/domain/brief/ProjectBriefVO.java rename to ruoyi-service/src/main/java/com/ruoyi/dashboard/index/domain/brief/ProjectBriefVO.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/dashboard/index/domain/brief/TaskBriefVO.java b/ruoyi-service/src/main/java/com/ruoyi/dashboard/index/domain/brief/TaskBriefVO.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/dashboard/index/domain/brief/TaskBriefVO.java rename to ruoyi-service/src/main/java/com/ruoyi/dashboard/index/domain/brief/TaskBriefVO.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/dashboard/index/mapper/DashboardMapper.java b/ruoyi-service/src/main/java/com/ruoyi/dashboard/index/mapper/DashboardMapper.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/dashboard/index/mapper/DashboardMapper.java rename to ruoyi-service/src/main/java/com/ruoyi/dashboard/index/mapper/DashboardMapper.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/dashboard/index/mapper/DashboardMapper.xml b/ruoyi-service/src/main/java/com/ruoyi/dashboard/index/mapper/DashboardMapper.xml similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/dashboard/index/mapper/DashboardMapper.xml rename to ruoyi-service/src/main/java/com/ruoyi/dashboard/index/mapper/DashboardMapper.xml diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/dashboard/index/service/DashboardService.java b/ruoyi-service/src/main/java/com/ruoyi/dashboard/index/service/DashboardService.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/dashboard/index/service/DashboardService.java rename to ruoyi-service/src/main/java/com/ruoyi/dashboard/index/service/DashboardService.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/dashboard/project/domain/brief/ProjectBriefKeys.java b/ruoyi-service/src/main/java/com/ruoyi/dashboard/project/domain/brief/ProjectBriefKeys.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/dashboard/project/domain/brief/ProjectBriefKeys.java rename to ruoyi-service/src/main/java/com/ruoyi/dashboard/project/domain/brief/ProjectBriefKeys.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/dashboard/project/domain/monthProject/MonthProjectQuery.java b/ruoyi-service/src/main/java/com/ruoyi/dashboard/project/domain/monthProject/MonthProjectQuery.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/dashboard/project/domain/monthProject/MonthProjectQuery.java rename to ruoyi-service/src/main/java/com/ruoyi/dashboard/project/domain/monthProject/MonthProjectQuery.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/dashboard/project/domain/monthProject/MonthProjectVO.java b/ruoyi-service/src/main/java/com/ruoyi/dashboard/project/domain/monthProject/MonthProjectVO.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/dashboard/project/domain/monthProject/MonthProjectVO.java rename to ruoyi-service/src/main/java/com/ruoyi/dashboard/project/domain/monthProject/MonthProjectVO.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/dashboard/project/domain/projectRate/ProjectRateVO.java b/ruoyi-service/src/main/java/com/ruoyi/dashboard/project/domain/projectRate/ProjectRateVO.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/dashboard/project/domain/projectRate/ProjectRateVO.java rename to ruoyi-service/src/main/java/com/ruoyi/dashboard/project/domain/projectRate/ProjectRateVO.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/dashboard/project/mapper/DashboardProjectMapper.java b/ruoyi-service/src/main/java/com/ruoyi/dashboard/project/mapper/DashboardProjectMapper.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/dashboard/project/mapper/DashboardProjectMapper.java rename to ruoyi-service/src/main/java/com/ruoyi/dashboard/project/mapper/DashboardProjectMapper.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/dashboard/project/mapper/DashboardProjectMapper.xml b/ruoyi-service/src/main/java/com/ruoyi/dashboard/project/mapper/DashboardProjectMapper.xml similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/dashboard/project/mapper/DashboardProjectMapper.xml rename to ruoyi-service/src/main/java/com/ruoyi/dashboard/project/mapper/DashboardProjectMapper.xml diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/dashboard/project/service/DashboardProjectService.java b/ruoyi-service/src/main/java/com/ruoyi/dashboard/project/service/DashboardProjectService.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/dashboard/project/service/DashboardProjectService.java rename to ruoyi-service/src/main/java/com/ruoyi/dashboard/project/service/DashboardProjectService.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/dashboard/task/domain/brief/TaskBriefKeys.java b/ruoyi-service/src/main/java/com/ruoyi/dashboard/task/domain/brief/TaskBriefKeys.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/dashboard/task/domain/brief/TaskBriefKeys.java rename to ruoyi-service/src/main/java/com/ruoyi/dashboard/task/domain/brief/TaskBriefKeys.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/dashboard/task/service/DashboardTaskService.java b/ruoyi-service/src/main/java/com/ruoyi/dashboard/task/service/DashboardTaskService.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/dashboard/task/service/DashboardTaskService.java rename to ruoyi-service/src/main/java/com/ruoyi/dashboard/task/service/DashboardTaskService.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/dept/domain/SysDeptQuery.java b/ruoyi-service/src/main/java/com/ruoyi/system/dept/domain/SysDeptQuery.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/dept/domain/SysDeptQuery.java rename to ruoyi-service/src/main/java/com/ruoyi/system/dept/domain/SysDeptQuery.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/dept/domain/SysDeptVO.java b/ruoyi-service/src/main/java/com/ruoyi/system/dept/domain/SysDeptVO.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/dept/domain/SysDeptVO.java rename to ruoyi-service/src/main/java/com/ruoyi/system/dept/domain/SysDeptVO.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/dept/domain/vo/SysDeptNameVO.java b/ruoyi-service/src/main/java/com/ruoyi/system/dept/domain/vo/SysDeptNameVO.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/dept/domain/vo/SysDeptNameVO.java rename to ruoyi-service/src/main/java/com/ruoyi/system/dept/domain/vo/SysDeptNameVO.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/dept/mapper/SysDeptMapper.java b/ruoyi-service/src/main/java/com/ruoyi/system/dept/mapper/SysDeptMapper.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/dept/mapper/SysDeptMapper.java rename to ruoyi-service/src/main/java/com/ruoyi/system/dept/mapper/SysDeptMapper.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/dept/mapper/SysDeptMapper.xml b/ruoyi-service/src/main/java/com/ruoyi/system/dept/mapper/SysDeptMapper.xml similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/dept/mapper/SysDeptMapper.xml rename to ruoyi-service/src/main/java/com/ruoyi/system/dept/mapper/SysDeptMapper.xml diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/dept/service/ISysDeptService.java b/ruoyi-service/src/main/java/com/ruoyi/system/dept/service/ISysDeptService.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/dept/service/ISysDeptService.java rename to ruoyi-service/src/main/java/com/ruoyi/system/dept/service/ISysDeptService.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/dept/service/impl/SysDeptServiceImpl.java b/ruoyi-service/src/main/java/com/ruoyi/system/dept/service/impl/SysDeptServiceImpl.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/dept/service/impl/SysDeptServiceImpl.java rename to ruoyi-service/src/main/java/com/ruoyi/system/dept/service/impl/SysDeptServiceImpl.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysCache.java b/ruoyi-service/src/main/java/com/ruoyi/system/domain/SysCache.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysCache.java rename to ruoyi-service/src/main/java/com/ruoyi/system/domain/SysCache.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysConfig.java b/ruoyi-service/src/main/java/com/ruoyi/system/domain/SysConfig.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysConfig.java rename to ruoyi-service/src/main/java/com/ruoyi/system/domain/SysConfig.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysLogininfor.java b/ruoyi-service/src/main/java/com/ruoyi/system/domain/SysLogininfor.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysLogininfor.java rename to ruoyi-service/src/main/java/com/ruoyi/system/domain/SysLogininfor.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysNotice.java b/ruoyi-service/src/main/java/com/ruoyi/system/domain/SysNotice.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysNotice.java rename to ruoyi-service/src/main/java/com/ruoyi/system/domain/SysNotice.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysPost.java b/ruoyi-service/src/main/java/com/ruoyi/system/domain/SysPost.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysPost.java rename to ruoyi-service/src/main/java/com/ruoyi/system/domain/SysPost.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysRoleDept.java b/ruoyi-service/src/main/java/com/ruoyi/system/domain/SysRoleDept.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysRoleDept.java rename to ruoyi-service/src/main/java/com/ruoyi/system/domain/SysRoleDept.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysRoleMenu.java b/ruoyi-service/src/main/java/com/ruoyi/system/domain/SysRoleMenu.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysRoleMenu.java rename to ruoyi-service/src/main/java/com/ruoyi/system/domain/SysRoleMenu.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserOnline.java b/ruoyi-service/src/main/java/com/ruoyi/system/domain/SysUserOnline.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserOnline.java rename to ruoyi-service/src/main/java/com/ruoyi/system/domain/SysUserOnline.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserPost.java b/ruoyi-service/src/main/java/com/ruoyi/system/domain/SysUserPost.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserPost.java rename to ruoyi-service/src/main/java/com/ruoyi/system/domain/SysUserPost.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserRole.java b/ruoyi-service/src/main/java/com/ruoyi/system/domain/SysUserRole.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserRole.java rename to ruoyi-service/src/main/java/com/ruoyi/system/domain/SysUserRole.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/MetaVo.java b/ruoyi-service/src/main/java/com/ruoyi/system/domain/vo/MetaVo.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/MetaVo.java rename to ruoyi-service/src/main/java/com/ruoyi/system/domain/vo/MetaVo.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/RouterVo.java b/ruoyi-service/src/main/java/com/ruoyi/system/domain/vo/RouterVo.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/RouterVo.java rename to ruoyi-service/src/main/java/com/ruoyi/system/domain/vo/RouterVo.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java b/ruoyi-service/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java rename to ruoyi-service/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictDataMapper.java b/ruoyi-service/src/main/java/com/ruoyi/system/mapper/SysDictDataMapper.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictDataMapper.java rename to ruoyi-service/src/main/java/com/ruoyi/system/mapper/SysDictDataMapper.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java b/ruoyi-service/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java rename to ruoyi-service/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysLogininforMapper.java b/ruoyi-service/src/main/java/com/ruoyi/system/mapper/SysLogininforMapper.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysLogininforMapper.java rename to ruoyi-service/src/main/java/com/ruoyi/system/mapper/SysLogininforMapper.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysMenuMapper.java b/ruoyi-service/src/main/java/com/ruoyi/system/mapper/SysMenuMapper.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysMenuMapper.java rename to ruoyi-service/src/main/java/com/ruoyi/system/mapper/SysMenuMapper.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java b/ruoyi-service/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java rename to ruoyi-service/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java b/ruoyi-service/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java rename to ruoyi-service/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleDeptMapper.java b/ruoyi-service/src/main/java/com/ruoyi/system/mapper/SysRoleDeptMapper.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleDeptMapper.java rename to ruoyi-service/src/main/java/com/ruoyi/system/mapper/SysRoleDeptMapper.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java b/ruoyi-service/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java rename to ruoyi-service/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMenuMapper.java b/ruoyi-service/src/main/java/com/ruoyi/system/mapper/SysRoleMenuMapper.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMenuMapper.java rename to ruoyi-service/src/main/java/com/ruoyi/system/mapper/SysRoleMenuMapper.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserPostMapper.java b/ruoyi-service/src/main/java/com/ruoyi/system/mapper/SysUserPostMapper.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserPostMapper.java rename to ruoyi-service/src/main/java/com/ruoyi/system/mapper/SysUserPostMapper.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java b/ruoyi-service/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java rename to ruoyi-service/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/operLog/domain/SysOperLog.java b/ruoyi-service/src/main/java/com/ruoyi/system/operLog/domain/SysOperLog.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/operLog/domain/SysOperLog.java rename to ruoyi-service/src/main/java/com/ruoyi/system/operLog/domain/SysOperLog.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/operLog/domain/SysOperLogQuery.java b/ruoyi-service/src/main/java/com/ruoyi/system/operLog/domain/SysOperLogQuery.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/operLog/domain/SysOperLogQuery.java rename to ruoyi-service/src/main/java/com/ruoyi/system/operLog/domain/SysOperLogQuery.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/operLog/domain/SysOperLogVO.java b/ruoyi-service/src/main/java/com/ruoyi/system/operLog/domain/SysOperLogVO.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/operLog/domain/SysOperLogVO.java rename to ruoyi-service/src/main/java/com/ruoyi/system/operLog/domain/SysOperLogVO.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/operLog/mapper/SysOperLogMapper.java b/ruoyi-service/src/main/java/com/ruoyi/system/operLog/mapper/SysOperLogMapper.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/operLog/mapper/SysOperLogMapper.java rename to ruoyi-service/src/main/java/com/ruoyi/system/operLog/mapper/SysOperLogMapper.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/operLog/mapper/SysOperLogMapper.xml b/ruoyi-service/src/main/java/com/ruoyi/system/operLog/mapper/SysOperLogMapper.xml similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/operLog/mapper/SysOperLogMapper.xml rename to ruoyi-service/src/main/java/com/ruoyi/system/operLog/mapper/SysOperLogMapper.xml diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/operLog/service/ISysOperLogService.java b/ruoyi-service/src/main/java/com/ruoyi/system/operLog/service/ISysOperLogService.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/operLog/service/ISysOperLogService.java rename to ruoyi-service/src/main/java/com/ruoyi/system/operLog/service/ISysOperLogService.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/operLog/service/impl/SysOperLogServiceImpl.java b/ruoyi-service/src/main/java/com/ruoyi/system/operLog/service/impl/SysOperLogServiceImpl.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/operLog/service/impl/SysOperLogServiceImpl.java rename to ruoyi-service/src/main/java/com/ruoyi/system/operLog/service/impl/SysOperLogServiceImpl.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java b/ruoyi-service/src/main/java/com/ruoyi/system/service/ISysConfigService.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java rename to ruoyi-service/src/main/java/com/ruoyi/system/service/ISysConfigService.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictDataService.java b/ruoyi-service/src/main/java/com/ruoyi/system/service/ISysDictDataService.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictDataService.java rename to ruoyi-service/src/main/java/com/ruoyi/system/service/ISysDictDataService.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java b/ruoyi-service/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java rename to ruoyi-service/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysLogininforService.java b/ruoyi-service/src/main/java/com/ruoyi/system/service/ISysLogininforService.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysLogininforService.java rename to ruoyi-service/src/main/java/com/ruoyi/system/service/ISysLogininforService.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java b/ruoyi-service/src/main/java/com/ruoyi/system/service/ISysMenuService.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java rename to ruoyi-service/src/main/java/com/ruoyi/system/service/ISysMenuService.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysNoticeService.java b/ruoyi-service/src/main/java/com/ruoyi/system/service/ISysNoticeService.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysNoticeService.java rename to ruoyi-service/src/main/java/com/ruoyi/system/service/ISysNoticeService.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java b/ruoyi-service/src/main/java/com/ruoyi/system/service/ISysPostService.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java rename to ruoyi-service/src/main/java/com/ruoyi/system/service/ISysPostService.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java b/ruoyi-service/src/main/java/com/ruoyi/system/service/ISysRoleService.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java rename to ruoyi-service/src/main/java/com/ruoyi/system/service/ISysRoleService.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserOnlineService.java b/ruoyi-service/src/main/java/com/ruoyi/system/service/ISysUserOnlineService.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserOnlineService.java rename to ruoyi-service/src/main/java/com/ruoyi/system/service/ISysUserOnlineService.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java b/ruoyi-service/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java rename to ruoyi-service/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java b/ruoyi-service/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java rename to ruoyi-service/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java b/ruoyi-service/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java rename to ruoyi-service/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysLogininforServiceImpl.java b/ruoyi-service/src/main/java/com/ruoyi/system/service/impl/SysLogininforServiceImpl.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysLogininforServiceImpl.java rename to ruoyi-service/src/main/java/com/ruoyi/system/service/impl/SysLogininforServiceImpl.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java b/ruoyi-service/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java rename to ruoyi-service/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java b/ruoyi-service/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java rename to ruoyi-service/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java b/ruoyi-service/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java rename to ruoyi-service/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java b/ruoyi-service/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java rename to ruoyi-service/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserOnlineServiceImpl.java b/ruoyi-service/src/main/java/com/ruoyi/system/service/impl/SysUserOnlineServiceImpl.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserOnlineServiceImpl.java rename to ruoyi-service/src/main/java/com/ruoyi/system/service/impl/SysUserOnlineServiceImpl.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/user/domain/SysUserQuery.java b/ruoyi-service/src/main/java/com/ruoyi/system/user/domain/SysUserQuery.java similarity index 92% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/user/domain/SysUserQuery.java rename to ruoyi-service/src/main/java/com/ruoyi/system/user/domain/SysUserQuery.java index 7b8f367..6a0f6f6 100644 --- a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/user/domain/SysUserQuery.java +++ b/ruoyi-service/src/main/java/com/ruoyi/system/user/domain/SysUserQuery.java @@ -37,4 +37,7 @@ public class SysUserQuery extends SysUserVO { @ApiModelProperty("排除用户ID列表") private List excludeUserIds; + + @ApiModelProperty("部门ID列表") + private List deptIds; } diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/user/domain/SysUserShiftQuery.java b/ruoyi-service/src/main/java/com/ruoyi/system/user/domain/SysUserShiftQuery.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/user/domain/SysUserShiftQuery.java rename to ruoyi-service/src/main/java/com/ruoyi/system/user/domain/SysUserShiftQuery.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/user/domain/SysUserVO.java b/ruoyi-service/src/main/java/com/ruoyi/system/user/domain/SysUserVO.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/user/domain/SysUserVO.java rename to ruoyi-service/src/main/java/com/ruoyi/system/user/domain/SysUserVO.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/user/domain/vo/SysUserNameVO.java b/ruoyi-service/src/main/java/com/ruoyi/system/user/domain/vo/SysUserNameVO.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/user/domain/vo/SysUserNameVO.java rename to ruoyi-service/src/main/java/com/ruoyi/system/user/domain/vo/SysUserNameVO.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/user/mapper/SysUserMapper.java b/ruoyi-service/src/main/java/com/ruoyi/system/user/mapper/SysUserMapper.java similarity index 97% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/user/mapper/SysUserMapper.java rename to ruoyi-service/src/main/java/com/ruoyi/system/user/mapper/SysUserMapper.java index 2c42ab1..4796dc2 100644 --- a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/user/mapper/SysUserMapper.java +++ b/ruoyi-service/src/main/java/com/ruoyi/system/user/mapper/SysUserMapper.java @@ -155,4 +155,9 @@ public interface SysUserMapper * 查询用户名称列表 */ List selectNameList(SysUserQuery query); + + /** + * 查询用户ID列表 + */ + List selectUserIds(SysUserQuery query); } diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/user/mapper/SysUserMapper.xml b/ruoyi-service/src/main/java/com/ruoyi/system/user/mapper/SysUserMapper.xml similarity index 97% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/user/mapper/SysUserMapper.xml rename to ruoyi-service/src/main/java/com/ruoyi/system/user/mapper/SysUserMapper.xml index d77c6da..2920c89 100644 --- a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/user/mapper/SysUserMapper.xml +++ b/ruoyi-service/src/main/java/com/ruoyi/system/user/mapper/SysUserMapper.xml @@ -133,6 +133,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{item} + + AND u.dept_id IN + + #{item} + + ${params.dataScope} @@ -352,4 +358,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/user/service/UserService.java b/ruoyi-service/src/main/java/com/ruoyi/system/user/service/UserService.java similarity index 97% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/user/service/UserService.java rename to ruoyi-service/src/main/java/com/ruoyi/system/user/service/UserService.java index 104e0d2..08ce394 100644 --- a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/user/service/UserService.java +++ b/ruoyi-service/src/main/java/com/ruoyi/system/user/service/UserService.java @@ -250,4 +250,11 @@ public interface UserService * @return */ List selectByIds(List ids); + + /** + * 根据部门ID列表查询用户ID列表 + * @param deptIds + * @return + */ + List selectUserIdsByDeptIds(List deptIds); } diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/user/service/UserValidator.java b/ruoyi-service/src/main/java/com/ruoyi/system/user/service/UserValidator.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/user/service/UserValidator.java rename to ruoyi-service/src/main/java/com/ruoyi/system/user/service/UserValidator.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/user/service/impl/UserServiceImpl.java b/ruoyi-service/src/main/java/com/ruoyi/system/user/service/impl/UserServiceImpl.java similarity index 97% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/user/service/impl/UserServiceImpl.java rename to ruoyi-service/src/main/java/com/ruoyi/system/user/service/impl/UserServiceImpl.java index d478592..93fe6e5 100644 --- a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/user/service/impl/UserServiceImpl.java +++ b/ruoyi-service/src/main/java/com/ruoyi/system/user/service/impl/UserServiceImpl.java @@ -724,7 +724,9 @@ public class UserServiceImpl implements UserService public List selectAllUserNameList() { List list = redisCache.getCacheList(CacheConstants.USER_NAME_LIST); if (CollectionUtils.isEmptyElement(list)) { - list = userMapper.selectNameList(new SysUserQuery()); + SysUserQuery query = new SysUserQuery(); + query.setExcludeUserId(1L); + list = userMapper.selectNameList(query); if (CollectionUtils.isNotEmptyElement(list)) { redisCache.setCacheList(CacheConstants.USER_NAME_LIST, list); } @@ -761,4 +763,14 @@ public class UserServiceImpl implements UserService query.setNickNames(nickNames); return userMapper.selectUserList(query); } + + @Override + public List selectUserIdsByDeptIds(List deptIds) { + if (CollectionUtils.isEmptyElement(deptIds)) { + return Collections.emptyList(); + } + SysUserQuery query = new SysUserQuery(); + query.setDeptIds(deptIds); + return userMapper.selectUserIds(query); + } } diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/user/service/impl/UserValidatorImpl.java b/ruoyi-service/src/main/java/com/ruoyi/system/user/service/impl/UserValidatorImpl.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/user/service/impl/UserValidatorImpl.java rename to ruoyi-service/src/main/java/com/ruoyi/system/user/service/impl/UserValidatorImpl.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/valid/DictValid.java b/ruoyi-service/src/main/java/com/ruoyi/system/valid/DictValid.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/valid/DictValid.java rename to ruoyi-service/src/main/java/com/ruoyi/system/valid/DictValid.java diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/valid/DictValidator.java b/ruoyi-service/src/main/java/com/ruoyi/system/valid/DictValidator.java similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/system/valid/DictValidator.java rename to ruoyi-service/src/main/java/com/ruoyi/system/valid/DictValidator.java diff --git a/ruoyi-service/src/main/java/com/ruoyi/ws/service/WebSocketService.java b/ruoyi-service/src/main/java/com/ruoyi/ws/service/WebSocketService.java new file mode 100644 index 0000000..9a9df92 --- /dev/null +++ b/ruoyi-service/src/main/java/com/ruoyi/ws/service/WebSocketService.java @@ -0,0 +1,195 @@ +package com.ruoyi.ws.service; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; + +import javax.websocket.Session; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.alibaba.fastjson2.JSON; +import com.ruoyi.system.user.service.UserService; + +import lombok.extern.slf4j.Slf4j; + +/** + * WebSocket工具类 + */ +@Service +@Slf4j +public class WebSocketService { + + @Autowired + private UserService userService; + + // 使用ConcurrentHashMap存储会话 + private static final Map SESSION_POOL = new ConcurrentHashMap<>(); + + // 创建线程池 + private static final ExecutorService MESSAGE_EXECUTOR = Executors.newFixedThreadPool(10); + + // 批处理大小 + private static final int BATCH_SIZE = 100; + + // 最大重试次数 + private static final int MAX_RETRY = 3; + + /** + * 添加用户WebSocket会话 + */ + public void addSession(Long userId, Session session) { + if (userId != null && session != null) { + SESSION_POOL.put(userId, session); + log.info("用户{}的WebSocket会话已添加", userId); + } + } + + /** + * 移除用户WebSocket会话 + */ + public void removeSession(Long userId) { + if (userId != null) { + SESSION_POOL.remove(userId); + log.info("用户{}的WebSocket会话已移除", userId); + } + } + + /** + * 获取用户WebSocket会话 + */ + public Session getSession(Long userId) { + return userId != null ? SESSION_POOL.get(userId) : null; + } + + /** + * 向指定用户发送消息 + * + * @param message 消息内容 + * @param userIds 目标用户ID数组 + */ + public void sendMessageToUser(Object message, Long... userIds) { + if (message == null) { + return; + } + this.sendMessageToUser(message, Arrays.asList(userIds)); + } + + /** + * 向指定用户发送消息 + * + * @param message 消息内容 + * @param userIds 目标用户ID数组 + */ + public void sendMessageToUser(Object message, Collection userIds) { + if (message == null) { + return; + } + + String msg = JSON.toJSONString(message); + for (Long userId : userIds) { + Session session = this.getSession(userId); + if (session != null) { + try { + if (session.isOpen()) { + session.getBasicRemote().sendText(msg); + log.info("向用户{}发送消息成功: {}", userId, msg); + } + } catch (Exception e) { + log.error("发送消息给用户{}失败", userId, e); + } + } + } + } + + /** + * 向所有在线用户发送消息 + * + * @param message 消息内容 + */ + public void sendMessageToAll(Object message) { + if (message == null) { + return; + } + + String msg = JSON.toJSONString(message); + + // 将在线用户分批处理 + List>> batches = new ArrayList<>(); + List> currentBatch = new ArrayList<>(); + + for (Map.Entry entry : SESSION_POOL.entrySet()) { + currentBatch.add(entry); + if (currentBatch.size() >= BATCH_SIZE) { + batches.add(new ArrayList<>(currentBatch)); + currentBatch.clear(); + } + } + + if (!currentBatch.isEmpty()) { + batches.add(currentBatch); + } + + // 并行处理每个批次 + List> futures = new ArrayList<>(); + + for (List> batch : batches) { + CompletableFuture future = CompletableFuture.runAsync(() -> { + processBatch(batch, msg); + }, MESSAGE_EXECUTOR); + + futures.add(future); + } + + // 等待所有批次处理完成 + CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])).join(); + + log.info("向所有在线用户发送消息完成: {}", msg); + } + + /** + * 处理一个批次的消息发送 + */ + private void processBatch(List> batch, String msg) { + for (Map.Entry entry : batch) { + Long userId = entry.getKey(); + Session session = entry.getValue(); + + if (session != null) { + sendMessageWithRetry(userId, session, msg, 0); + } + } + } + + /** + * 带重试机制的消息发送 + */ + private void sendMessageWithRetry(Long userId, Session session, String msg, int retryCount) { + try { + synchronized (session) { + if (session.isOpen()) { + session.getBasicRemote().sendText(msg); + } + } + } catch (Exception e) { + if (retryCount < MAX_RETRY) { + log.warn("向用户{}发送消息失败,准备第{}次重试", userId, retryCount + 1); + try { + Thread.sleep(100 * (retryCount + 1)); // 递增延迟重试 + sendMessageWithRetry(userId, session, msg, retryCount + 1); + } catch (InterruptedException ie) { + Thread.currentThread().interrupt(); + } + } else { + log.error("向用户{}发送全局消息失败,已重试{}次", userId, MAX_RETRY, e); + } + } + } +} diff --git a/common-ruoyi/ruoyi-system/src/main/resources/mapper/system/SysConfigMapper.xml b/ruoyi-service/src/main/resources/mapper/system/SysConfigMapper.xml similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/resources/mapper/system/SysConfigMapper.xml rename to ruoyi-service/src/main/resources/mapper/system/SysConfigMapper.xml diff --git a/common-ruoyi/ruoyi-system/src/main/resources/mapper/system/SysDictDataMapper.xml b/ruoyi-service/src/main/resources/mapper/system/SysDictDataMapper.xml similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/resources/mapper/system/SysDictDataMapper.xml rename to ruoyi-service/src/main/resources/mapper/system/SysDictDataMapper.xml diff --git a/common-ruoyi/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml b/ruoyi-service/src/main/resources/mapper/system/SysDictTypeMapper.xml similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml rename to ruoyi-service/src/main/resources/mapper/system/SysDictTypeMapper.xml diff --git a/common-ruoyi/ruoyi-system/src/main/resources/mapper/system/SysLogininforMapper.xml b/ruoyi-service/src/main/resources/mapper/system/SysLogininforMapper.xml similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/resources/mapper/system/SysLogininforMapper.xml rename to ruoyi-service/src/main/resources/mapper/system/SysLogininforMapper.xml diff --git a/common-ruoyi/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml b/ruoyi-service/src/main/resources/mapper/system/SysMenuMapper.xml similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml rename to ruoyi-service/src/main/resources/mapper/system/SysMenuMapper.xml diff --git a/common-ruoyi/ruoyi-system/src/main/resources/mapper/system/SysNoticeMapper.xml b/ruoyi-service/src/main/resources/mapper/system/SysNoticeMapper.xml similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/resources/mapper/system/SysNoticeMapper.xml rename to ruoyi-service/src/main/resources/mapper/system/SysNoticeMapper.xml diff --git a/common-ruoyi/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml b/ruoyi-service/src/main/resources/mapper/system/SysPostMapper.xml similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml rename to ruoyi-service/src/main/resources/mapper/system/SysPostMapper.xml diff --git a/common-ruoyi/ruoyi-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml b/ruoyi-service/src/main/resources/mapper/system/SysRoleDeptMapper.xml similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml rename to ruoyi-service/src/main/resources/mapper/system/SysRoleDeptMapper.xml diff --git a/common-ruoyi/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml b/ruoyi-service/src/main/resources/mapper/system/SysRoleMapper.xml similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml rename to ruoyi-service/src/main/resources/mapper/system/SysRoleMapper.xml diff --git a/common-ruoyi/ruoyi-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml b/ruoyi-service/src/main/resources/mapper/system/SysRoleMenuMapper.xml similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml rename to ruoyi-service/src/main/resources/mapper/system/SysRoleMenuMapper.xml diff --git a/common-ruoyi/ruoyi-system/src/main/resources/mapper/system/SysUserPostMapper.xml b/ruoyi-service/src/main/resources/mapper/system/SysUserPostMapper.xml similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/resources/mapper/system/SysUserPostMapper.xml rename to ruoyi-service/src/main/resources/mapper/system/SysUserPostMapper.xml diff --git a/common-ruoyi/ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml b/ruoyi-service/src/main/resources/mapper/system/SysUserRoleMapper.xml similarity index 100% rename from common-ruoyi/ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml rename to ruoyi-service/src/main/resources/mapper/system/SysUserRoleMapper.xml diff --git a/ruoyi-web/pom.xml b/ruoyi-web/pom.xml index 6691949..e847fbe 100644 --- a/ruoyi-web/pom.xml +++ b/ruoyi-web/pom.xml @@ -48,6 +48,12 @@ ruoyi-generator + + + org.springframework.boot + spring-boot-starter-websocket + + diff --git a/ruoyi-web/src/main/java/com/ruoyi/web/app/AppMessageController.java b/ruoyi-web/src/main/java/com/ruoyi/web/app/AppMessageController.java new file mode 100644 index 0000000..8b0dcd9 --- /dev/null +++ b/ruoyi-web/src/main/java/com/ruoyi/web/app/AppMessageController.java @@ -0,0 +1,53 @@ +package com.ruoyi.web.app; + +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.github.pagehelper.PageHelper; +import com.ruoyi.bst.message.domain.MessageQuery; +import com.ruoyi.bst.message.domain.MessageVO; +import com.ruoyi.bst.message.service.MessageService; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; + +import io.swagger.annotations.ApiOperation; + +@RestController +@RequestMapping("/app/message") +public class AppMessageController extends BaseController { + + @Autowired + private MessageService messageService; + + @ApiOperation("获取本人接收的消息列表") + @GetMapping("/receiveList") + public TableDataInfo receiveList(MessageQuery query) { + startPage(); + PageHelper.orderBy("is_read asc, create_time desc"); + query.setUserId(getUserId()); + List list = messageService.selectMessageList(query); + return getDataTable(list); + } + + @ApiOperation("消息已读,id为空时,则将本人所有未读消息设置为已读") + @PostMapping("/read") + public AjaxResult read(@RequestParam(required = false) Long id) { + return success(messageService.read(getUserId(), id)); + } + + @ApiOperation("查询本人未读消息数量") + @GetMapping("/unreadCount") + public AjaxResult unreadCount() { + MessageQuery query = new MessageQuery(); + query.setUserId(getUserId()); + query.setIsRead(false); + return success(messageService.selectCount(query)); + } +} diff --git a/ruoyi-web/src/main/java/com/ruoyi/web/bst/CustomerController.java b/ruoyi-web/src/main/java/com/ruoyi/web/bst/CustomerController.java index 31ba847..295483d 100644 --- a/ruoyi-web/src/main/java/com/ruoyi/web/bst/CustomerController.java +++ b/ruoyi-web/src/main/java/com/ruoyi/web/bst/CustomerController.java @@ -23,12 +23,14 @@ import com.ruoyi.bst.customer.domain.dto.CustomerAddDTO; import com.ruoyi.bst.customer.service.CustomerConverter; import com.ruoyi.bst.customer.service.CustomerService; import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.constants.RoleConstants; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.validate.ValidGroup; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.web.service.PermissionService; /** * 客户Controller @@ -46,6 +48,9 @@ public class CustomerController extends BaseController @Autowired private CustomerConverter customerConverter; + @Autowired + private PermissionService permissionService; + /** * 查询客户列表 */ @@ -55,7 +60,8 @@ public class CustomerController extends BaseController { startPage(); startOrderBy(); - List list = customerService.selectCustomerListScope(query); + query.setScope(true); + List list = customerService.selectCustomerList(query); return getDataTable(list); } @@ -101,6 +107,10 @@ public class CustomerController extends BaseController @PostMapping public AjaxResult add(@RequestBody @Validated(ValidGroup.Create.class) CustomerAddDTO customer) { + // 若用户不是管理员,则跟进人设置为自己 + if (!permissionService.hasRole(RoleConstants.ADMIN) && !permissionService.hasRole(RoleConstants.SYS_ADMIN)) { + customer.setFollowId(getUserId()); + } customer = customerConverter.toDTOByCreate(customer); return toAjax(customerService.insertCustomer(customer)); } @@ -113,6 +123,10 @@ public class CustomerController extends BaseController @PutMapping public AjaxResult edit(@RequestBody @Validated(ValidGroup.Update.class) Customer customer) { + // 若用户不是管理员,则不允许修改跟进人 + if (!permissionService.hasRole(RoleConstants.ADMIN) && !permissionService.hasRole(RoleConstants.SYS_ADMIN)) { + customer.setFollowId(null); + } customer = customerConverter.toPoByUpdate(customer); return toAjax(customerService.updateCustomer(customer)); } diff --git a/ruoyi-web/src/main/java/com/ruoyi/web/bst/CustomerFollowController.java b/ruoyi-web/src/main/java/com/ruoyi/web/bst/CustomerFollowController.java index 2cd07e6..b73ed6b 100644 --- a/ruoyi-web/src/main/java/com/ruoyi/web/bst/CustomerFollowController.java +++ b/ruoyi-web/src/main/java/com/ruoyi/web/bst/CustomerFollowController.java @@ -50,7 +50,8 @@ public class CustomerFollowController extends BaseController { startPage(); startOrderBy(); - List list = customerFollowService.selectCustomerFollowListScope(query); + query.setScope(true); + List list = customerFollowService.selectCustomerFollowList(query); return getDataTable(list); } diff --git a/ruoyi-web/src/main/java/com/ruoyi/web/bst/MessageController.java b/ruoyi-web/src/main/java/com/ruoyi/web/bst/MessageController.java new file mode 100644 index 0000000..c70e7c0 --- /dev/null +++ b/ruoyi-web/src/main/java/com/ruoyi/web/bst/MessageController.java @@ -0,0 +1,107 @@ +package com.ruoyi.web.bst; + +import java.util.List; + +import javax.servlet.http.HttpServletResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import com.ruoyi.bst.message.domain.MessageQuery; +import com.ruoyi.bst.message.domain.MessageVO; +import com.ruoyi.bst.message.service.MessageService; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.poi.ExcelUtil; + +/** + * 消息Controller + * + * @author ruoyi + * @date 2025-02-22 + */ +@RestController +@RequestMapping("/bst/message") +public class MessageController extends BaseController +{ + @Autowired + private MessageService messageService; + + /** + * 查询消息列表 + */ + @PreAuthorize("@ss.hasPermi('bst:message:list')") + @GetMapping("/list") + public TableDataInfo list(MessageQuery query) + { + startPage(); + startOrderBy(); + query.setScope(true); + List list = messageService.selectMessageList(query); + return getDataTable(list); + } + + /** + * 导出消息列表 + */ + @PreAuthorize("@ss.hasPermi('bst:message:export')") + @Log(title = "消息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, MessageQuery query) + { + List list = messageService.selectMessageList(query); + ExcelUtil util = new ExcelUtil(MessageVO.class); + util.exportExcel(response, list, "消息数据"); + } + + /** + * 获取消息详细信息 + */ + @PreAuthorize("@ss.hasPermi('bst:message:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(messageService.selectMessageById(id)); + } + + /** + * 新增消息 + */ + // @PreAuthorize("@ss.hasPermi('bst:message:add')") + // @Log(title = "消息", businessType = BusinessType.INSERT) + // @PostMapping + // public AjaxResult add(@RequestBody Message message) + // { + // return toAjax(messageService.insertMessage(message)); + // } + + // /** + // * 修改消息 + // */ + // @PreAuthorize("@ss.hasPermi('bst:message:edit')") + // @Log(title = "消息", businessType = BusinessType.UPDATE) + // @PutMapping + // public AjaxResult edit(@RequestBody Message message) + // { + // return toAjax(messageService.updateMessage(message)); + // } + + // /** + // * 删除消息 + // */ + // @PreAuthorize("@ss.hasPermi('bst:message:remove')") + // @Log(title = "消息", businessType = BusinessType.DELETE) + // @DeleteMapping("/{ids}") + // public AjaxResult remove(@PathVariable Long[] ids) + // { + // return toAjax(messageService.deleteMessageByIds(ids)); + // } +} diff --git a/ruoyi-web/src/main/java/com/ruoyi/web/bst/TaskController.java b/ruoyi-web/src/main/java/com/ruoyi/web/bst/TaskController.java index 70a8bf9..febf424 100644 --- a/ruoyi-web/src/main/java/com/ruoyi/web/bst/TaskController.java +++ b/ruoyi-web/src/main/java/com/ruoyi/web/bst/TaskController.java @@ -68,6 +68,8 @@ public class TaskController extends BaseController query.setScope(true); List list = taskService.selectTaskList(query); taskAssembler.assembleOwnerList(list); + taskAssembler.assembleSubmitCount(list); + taskAssembler.assemblePassCount(list); return getDataTable(list); } diff --git a/ruoyi-web/src/main/java/com/ruoyi/web/system/SysUserController.java b/ruoyi-web/src/main/java/com/ruoyi/web/system/SysUserController.java index 3491f48..83630ce 100644 --- a/ruoyi-web/src/main/java/com/ruoyi/web/system/SysUserController.java +++ b/ruoyi-web/src/main/java/com/ruoyi/web/system/SysUserController.java @@ -64,10 +64,11 @@ public class SysUserController extends BaseController */ @PreAuthorize("@ss.hasPermi('system:user:list')") @GetMapping("/list") - public TableDataInfo list(SysUserQuery user) + public TableDataInfo list(SysUserQuery query) { startPage(); - List list = userService.selectUserListScope(user); + query.setExcludeUserId(1L); + List list = userService.selectUserListScope(query); return getDataTable(list); } @@ -97,9 +98,10 @@ public class SysUserController extends BaseController @Log(title = "用户管理", businessType = BusinessType.EXPORT) @PreAuthorize("@ss.hasPermi('system:user:export')") @PostMapping("/export") - public void export(HttpServletResponse response, SysUserQuery user) + public void export(HttpServletResponse response, SysUserQuery query) { - List list = userService.selectUserListScope(user); + query.setExcludeUserId(1L); + List list = userService.selectUserListScope(query); ExcelUtil util = new ExcelUtil(SysUserVO.class); util.exportExcel(response, list, "用户数据"); } diff --git a/ruoyi-web/src/main/java/com/ruoyi/ws/MessageWebSocket.java b/ruoyi-web/src/main/java/com/ruoyi/ws/MessageWebSocket.java new file mode 100644 index 0000000..f654310 --- /dev/null +++ b/ruoyi-web/src/main/java/com/ruoyi/ws/MessageWebSocket.java @@ -0,0 +1,79 @@ +package com.ruoyi.ws; + +import javax.websocket.CloseReason; +import javax.websocket.EndpointConfig; +import javax.websocket.OnClose; +import javax.websocket.OnError; +import javax.websocket.OnOpen; +import javax.websocket.Session; +import javax.websocket.server.ServerEndpoint; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import com.ruoyi.common.core.domain.model.LoginUser; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.spring.SpringUtils; +import com.ruoyi.framework.web.service.TokenService; +import com.ruoyi.ws.config.WebSocketAuthConfigurator; +import com.ruoyi.ws.service.WebSocketService; + +/** + * WebSocket服务类 + */ +@ServerEndpoint(value = "/ws/message", configurator = WebSocketAuthConfigurator.class) +@Component +@Slf4j +public class MessageWebSocket { + /** + * 建立连接 + */ + @OnOpen + public void onOpen(Session session, EndpointConfig config) { + try { + String token = (String) config.getUserProperties().get("token"); + if (token != null) { + TokenService tokenService = SpringUtils.getBean(TokenService.class); + WebSocketService webSocketService = SpringUtils.getBean(WebSocketService.class); + LoginUser loginUser = tokenService.getLoginUser(token); + tokenService.verifyToken(loginUser); + if (loginUser != null) { + Long userId = loginUser.getUserId(); + webSocketService.addSession(userId, session); + log.info("用户{}连接WebSocket成功", userId); + return; + } + } + session.close(new CloseReason(CloseReason.CloseCodes.VIOLATED_POLICY, "未认证")); + } catch (Exception e) { + log.error("WebSocket连接异常", e); + } + } + + /** + * 关闭连接 + */ + @OnClose + public void onClose() { + try { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (loginUser != null) { + Long userId = loginUser.getUserId(); + WebSocketService webSocketService = SpringUtils.getBean(WebSocketService.class); + webSocketService.removeSession(userId); + log.info("用户{}断开WebSocket连接", userId); + } + } catch (Exception e) { + log.error("WebSocket关闭异常", e); + } + } + + /** + * 错误处理 + */ + @OnError + public void onError(Session session, Throwable error) { + log.error("WebSocket发生错误", error); + } +} diff --git a/ruoyi-web/src/main/java/com/ruoyi/ws/config/WebSocketAuthConfigurator.java b/ruoyi-web/src/main/java/com/ruoyi/ws/config/WebSocketAuthConfigurator.java new file mode 100644 index 0000000..c1c7f54 --- /dev/null +++ b/ruoyi-web/src/main/java/com/ruoyi/ws/config/WebSocketAuthConfigurator.java @@ -0,0 +1,19 @@ +package com.ruoyi.ws.config; + +import javax.websocket.HandshakeResponse; +import javax.websocket.server.HandshakeRequest; +import javax.websocket.server.ServerEndpointConfig; + +/** + * WebSocket认证配置器 + */ +public class WebSocketAuthConfigurator extends ServerEndpointConfig.Configurator { + @Override + public void modifyHandshake(ServerEndpointConfig sec, HandshakeRequest request, HandshakeResponse response) { + String token = null; + if (!request.getParameterMap().isEmpty()) { + token = request.getParameterMap().get("token").get(0); + } + sec.getUserProperties().put("token", token); + } +} \ No newline at end of file diff --git a/ruoyi-web/src/main/java/com/ruoyi/ws/config/WebSocketConfig.java b/ruoyi-web/src/main/java/com/ruoyi/ws/config/WebSocketConfig.java new file mode 100644 index 0000000..0e6794d --- /dev/null +++ b/ruoyi-web/src/main/java/com/ruoyi/ws/config/WebSocketConfig.java @@ -0,0 +1,26 @@ +package com.ruoyi.ws.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.socket.server.standard.ServerEndpointExporter; +import org.springframework.web.socket.server.standard.ServletServerContainerFactoryBean; + +/** + * WebSocket配置类 + */ +@Configuration +public class WebSocketConfig { + + @Bean + public ServerEndpointExporter serverEndpointExporter() { + return new ServerEndpointExporter(); + } + + @Bean + public ServletServerContainerFactoryBean createWebSocketContainer() { + ServletServerContainerFactoryBean container = new ServletServerContainerFactoryBean(); + container.setMaxTextMessageBufferSize(8192); + container.setMaxBinaryMessageBufferSize(8192); + return container; + } +} \ No newline at end of file