调整动态表单问题

This commit is contained in:
wenc000 2020-08-26 18:28:36 +08:00
parent d31e3d93dc
commit 8276c9a377
4 changed files with 54 additions and 0 deletions

View File

@ -82,4 +82,13 @@ public interface IDynamicDataDao {
* @throws SearchException * @throws SearchException
*/ */
Map<String, Object> getDynamicJoinData(Map<String, Object> params) throws SearchException; Map<String, Object> getDynamicJoinData(Map<String, Object> params) throws SearchException;
/**
* 动态数据链接列表
*
* @param params
* @return
* @throws SearchException
*/
List<Map<String, Object>> listDynamicJoinData(Map<String, Object> params) throws SearchException;
} }

View File

@ -161,6 +161,17 @@ public interface IDynamicDataService {
*/ */
Map<String, Object> getDynamicJoinData(String tableName, String joinKey, String joinId) throws SearchException; Map<String, Object> getDynamicJoinData(String tableName, String joinKey, String joinId) throws SearchException;
/**
* 动态数据详情
*
* @param tableName
* @param joinKey
* @param joinIds
* @return
* @throws SearchException
*/
List<Map<String, Object>> listDynamicJoinData(String tableName, String joinKey, List<String> joinIds) throws SearchException;
/** /**
* 设置表字段为驼峰式 * 设置表字段为驼峰式
* *

View File

@ -206,6 +206,22 @@ public class DynamicDataServiceImpl extends AbstractService implements IDynamicD
return dynamicData; return dynamicData;
} }
@Override
public List<Map<String, Object>> listDynamicJoinData(String tableName, String joinKey, List<String> joinIds) throws SearchException {
Map<String, Object> params = getHashMap(0);
setSearchBaseGetInfo(tableName, params);
params.put("joinKey", WStringUtil.lowerUpper2UnderLine(joinKey));
params.put("joinIds", joinIds);
List<Map<String, Object>> dynamicDatas = dynamicDataDao.listDynamicJoinData(params);
if (Objects.isNull(dynamicDatas)) {
dynamicDatas = new ArrayList<>();
}
for (Map<String, Object> dynamicData : dynamicDatas) {
resetDynamicDataKey2LowerUpper(dynamicData);
}
return dynamicDatas;
}
@Override @Override
public void resetDynamicDataKey2LowerUpper(List<Map<String, Object>> listDynamicData) { public void resetDynamicDataKey2LowerUpper(List<Map<String, Object>> listDynamicData) {
for (Map<String, Object> dynamicData : listDynamicData) { for (Map<String, Object> dynamicData : listDynamicData) {

View File

@ -195,4 +195,22 @@
${joinKey} = #{joinId} ${joinKey} = #{joinId}
</select> </select>
<!-- 动态数据详情 -->
<select id="listDynamicJoinData" parameterType="map" resultType="map">
SELECT
${uuidField}
<foreach collection="formShowFieldList" item="item" open="," separator="," close="">
${item}
</foreach>
FROM
${tableName}
WHERE
is_delete = 0
AND
${joinKey} IN
<foreach collection="joinIds" index="index" open="(" separator="," close=")">
#{joinIds[${index}]}
</foreach>
</select>
</mapper> </mapper>