Browse Source

修改代码

zh 3 years ago
parent
commit
b0eccdffb5

+ 1 - 1
boman-modules/boman-system/src/main/java/com/boman/system/service/impl/BomanGroupServiceImpl.java

@@ -183,9 +183,9 @@ public class BomanGroupServiceImpl implements IBomanGroupService {
                 if (user != null) {
                     bomanGroupUser.setUserName(user.getUserName());
                     bomanGroupUserList.add(bomanGroupUser);
-                    groupUserMapper.insertUserGroup(bomanGroupUserList);
                 }
             }
+            groupUserMapper.insertUserGroup(bomanGroupUserList);
         }
         return AjaxResult.success();
     }

+ 2 - 2
boman-modules/boman-system/src/main/resources/mapper/system/BomanGroupMapper.xml

@@ -14,7 +14,7 @@
         <result property="updateBy" column="update_by"/>
         <result property="updateTime" column="update_time"/>
         <result property="isDel" column="is_del"/>
-        <collection  property="bomanGroupUserList"   javaType="java.util.List"        resultMap="BomanGroupUserResult" />
+        <collection  property="bomanGroupUserList"   javaType="java.util.List" resultMap="BomanGroupUserResult" />
     </resultMap>
 
     <resultMap type="com.boman.domain.BomanGroupUser" id="BomanGroupUserResult">
@@ -42,7 +42,7 @@
         left join boman_group_user gu on gu.group_id = g.id
         where g.is_del = 'N'
         <if test="groupName != null and groupName != ''">
-            AND g.groupName like concat('%', #{groupName}, '%')
+            AND g.group_name like concat('%', #{groupName}, '%')
         </if>
         <!-- 数据范围过滤 -->
         ${params.dataScope}

+ 1 - 1
boman-web-core/src/main/java/com/boman/web/core/mapper/MessageMapper.java

@@ -96,7 +96,7 @@ public interface MessageMapper {
 
         public String selectByCondition(Map<String, Object> para) {
             String result = "SELECT t.message_title, t.message_code, t.send_user_id, t.send_user_name, t.create_dept_name, r.receive_time, t.id, "
-                    + " t.finish_time FROM boman_message t JOIN urge_read_message u ON u.message_id = t.id  AND u.receive_user_name = '" + para.get("username") + "' "
+                    + " t.finish_time, r.id as receive_id FROM boman_message t JOIN urge_read_message u ON u.message_id = t.id  AND u.receive_user_name = '" + para.get("username") + "' "
                     + " JOIN boman_message_receive r on r.receive_user_name = u.receive_user_name and r.message_id = t.id "
                     + " WHERE t.is_del = 'N'  and r.`status` = 'N' ORDER BY t.create_time DESC  LIMIT " + para.get("limit") + "," + para.get("offset");
 

+ 7 - 10
boman-web-core/src/main/java/com/boman/web/core/service/TableServiceCmdService.java

@@ -1210,6 +1210,12 @@ public class TableServiceCmdService {
 
             // 主表是修改操作
             JSONObject fixedData = dto.getFixedData();
+            List<FormDataDto> children = dto.getChildren();
+            if (isEmpty(children)) {
+                return;
+            }
+
+            FormDataDto childDto = children.get(0);
             for (Map.Entry<String, Object> entry : fixedData.entrySet()) {
                 Object value = entry.getValue();
                 if (value instanceof String) {
@@ -1217,17 +1223,8 @@ public class TableServiceCmdService {
                     if (!strValue.contains(FK_POINT)) {
                         continue;
                     }
-                    String[] split = strValue.split(POINT);
-                    // 默认关联的都是主表的id,fk.primaryTableName
-                    String lastTableName = split[split.length - 1];
-                    Long maxId = tableNameIdMap.get(lastTableName);
-                    if (maxId == null) {
-                        throw new RuntimeException(String.format("保存失败, 主表id: null, 表名为: %s ", lastTableName));
-                    }
-                    fixedData.put(entry.getKey(), maxId);
 
-                    deleteService.delete(dto.getTable(), JSONObjectUtils.putValue(entry.getKey(), maxId));
-                    dto.setFixedData(fixedData);
+                    deleteService.delete(childDto.getTable(), JSONObjectUtils.putValue(entry.getKey(), dto.getObjId()));
                     break;
                 }
             }