Przeglądaj źródła

Merge branch 'fu-dev' of uskycloud/usky-cloud into develop

fuyuchuan 3 tygodni temu
rodzic
commit
3b7dafedb6

+ 5 - 0
base-modules/service-file/pom.xml

@@ -104,6 +104,10 @@
                         <goals>
                             <goal>repackage</goal>
                         </goals>
+                        <configuration>
+                            <!-- 新增:给启动包加后缀,保留原始普通jar用于依赖,解决外部引用报错问题-->
+                            <classifier>exec</classifier>
+                        </configuration>
                     </execution>
                 </executions>
             </plugin>
@@ -122,6 +126,7 @@
                     <!--                    </excludes>-->
                 </configuration>
             </plugin>
+
         </plugins>
     </build>
 

+ 3 - 2
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/controller/web/SysConfigController.java

@@ -64,12 +64,12 @@ public class SysConfigController extends BaseController
     @PostMapping
     public ApiResult add(@Validated @RequestBody SysConfig config)
     {
+        config.setCreateBy(SecurityUtils.getUsername());
+        config.setTenantId(SecurityUtils.getTenantId());
         if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config)))
         {
             return ApiResult.error(BusinessErrorCode.BIZ_BUSINESS_ERROR.getCode(), "新增参数'" + config.getConfigName() + "'失败,参数键名已存在");
         }
-        config.setCreateBy(SecurityUtils.getUsername());
-        config.setTenantId(SecurityUtils.getTenantId());
         return toAjax(configService.insertConfig(config));
     }
 
@@ -80,6 +80,7 @@ public class SysConfigController extends BaseController
     @PutMapping
     public ApiResult edit(@Validated @RequestBody SysConfig config)
     {
+        config.setTenantId(SecurityUtils.getTenantId());
         if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config)))
         {
             return ApiResult.error(BusinessErrorCode.BIZ_BUSINESS_ERROR.getCode(), "修改参数'" + config.getConfigName() + "'失败,参数键名已存在");

+ 1 - 1
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/mapper/SysConfigMapper.java

@@ -38,7 +38,7 @@ public interface SysConfigMapper extends CrudMapper<SysConfig>
      * @param configKey 参数键名
      * @return 参数配置信息
      */
-    public SysConfig checkConfigKeyUnique(@Param("configKey") String configKey);
+    public SysConfig checkConfigKeyUnique(@Param("configKey") String configKey, @Param("tenantId") Integer tenantId);
 
     /**
      * 新增参数配置

+ 7 - 7
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/impl/MceReceiveServiceImpl.java

@@ -338,6 +338,13 @@ public class MceReceiveServiceImpl extends AbstractCrudService<MceReceiveMapper,
         JSONObject appMode = JSONObject.parseObject(setting.getAppMode());
         JSONObject wcMode = JSONObject.parseObject(setting.getWcMode());
 
+        // 保存消息内容
+        Integer contentId = saveMessageContent(mceRequestVO, userIdToUserMap);
+        if (contentId == null) {
+            log.error("消息内容保存失败,用户: {}", mceRequestVO.getUserName());
+            return;
+        }
+
         // 处理每个目标用户的消息接收和发送
         for (Long userId : validUserIds) {
             SysUser user = userIdToUserMap.get(userId);
@@ -357,13 +364,6 @@ public class MceReceiveServiceImpl extends AbstractCrudService<MceReceiveMapper,
                 return;
             }
 
-            // 保存消息内容
-            Integer contentId = saveMessageContent(mceRequestVO, userIdToUserMap);
-            if (contentId == null) {
-                log.error("消息内容保存失败,用户: {}", mceRequestVO.getUserName());
-                return;
-            }
-
             // 创建消息接收记录
             MceReceive mceReceive = createMceReceive(user, contentId, mceRequestVO, userNameToNickNameMap);
             boolean saveResult = this.save(mceReceive);

+ 1 - 1
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/impl/SysConfigServiceImpl.java

@@ -214,7 +214,7 @@ public class SysConfigServiceImpl extends AbstractCrudService<SysConfigMapper, S
     public String checkConfigKeyUnique(SysConfig config)
     {
         Long configId = Objects.isNull(config.getConfigId()) ? -1L : config.getConfigId();
-        SysConfig info = configMapper.checkConfigKeyUnique(config.getConfigKey());
+        SysConfig info = configMapper.checkConfigKeyUnique(config.getConfigKey(), config.getTenantId());
         if (Objects.nonNull(info) && info.getConfigId().longValue() != configId.longValue())
         {
             return UserConstants.NOT_UNIQUE;

+ 5 - 1
base-modules/service-system/service-system-biz/src/main/resources/mapper/system/SysConfigMapper.xml

@@ -64,7 +64,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     
     <select id="checkConfigKeyUnique" parameterType="String" resultMap="SysConfigResult">
         <include refid="selectConfigVo"/>
-        where config_key = #{configKey} limit 1
+        where config_key = #{configKey}
+        <if test="tenantId != null and tenantId != '' and tenantId != 0">
+            AND tenant_id = #{tenantId}
+        </if>
+        limit 1
     </select>
     
     <insert id="insertConfig" parameterType="com.usky.system.domain.SysConfig">

+ 1 - 1
base-modules/service-system/service-system-biz/src/main/resources/mapper/system/SysNoticeMapper.xml

@@ -68,7 +68,7 @@
             </if>
             AND FIND_IN_SET(#{deptId}, dept_id) > 0
         </where>
-        order by notice_id desc
+        order by create_time desc
     </select>
 
     <insert id="insertNotice" useGeneratedKeys="true" keyProperty="noticeId"