mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-18 09:35:29 +08:00
支持表单提交
This commit is contained in:
parent
3f774d4d16
commit
e043d39aec
@ -162,7 +162,7 @@ public class FormController {
|
||||
private String formId;
|
||||
|
||||
/**
|
||||
* 表单数据
|
||||
* 表单数据 ,key为字段id,value为字段值
|
||||
*/
|
||||
private Map<String, Object> formData;
|
||||
|
||||
|
||||
@ -90,7 +90,7 @@ public class H5GroupController {
|
||||
@Operation(summary = "创建H5分组")
|
||||
@PostMapping
|
||||
public boolean createH5Group(@RequestBody H5Group h5Group) {
|
||||
long currentTime = System.currentTimeMillis() / 1000;
|
||||
long currentTime = System.currentTimeMillis();
|
||||
h5Group.setCreateTime(currentTime);
|
||||
h5Group.setUpdateTime(currentTime);
|
||||
return h5GroupService.save(h5Group);
|
||||
@ -107,7 +107,7 @@ public class H5GroupController {
|
||||
@PutMapping("/{id}")
|
||||
public boolean updateH5Group(@PathVariable Long id, @RequestBody H5Group h5Group) {
|
||||
h5Group.setId(id);
|
||||
h5Group.setUpdateTime(System.currentTimeMillis() / 1000);
|
||||
h5Group.setUpdateTime(System.currentTimeMillis());
|
||||
return h5GroupService.updateById(h5Group);
|
||||
}
|
||||
|
||||
@ -122,4 +122,4 @@ public class H5GroupController {
|
||||
public boolean deleteH5Group(@PathVariable Long id) {
|
||||
return h5GroupService.removeById(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -40,7 +40,7 @@ public class FontServiceImpl extends ServiceImpl<FontDao, Font> implements FontS
|
||||
}
|
||||
|
||||
// 获取当前时间戳(秒)
|
||||
long currentTime = System.currentTimeMillis() / 1000;
|
||||
long currentTime = System.currentTimeMillis();
|
||||
for (FontContent fontContent : fontContents) {
|
||||
// 保存到MongoDB
|
||||
fontContent.setCreateTime(currentTime);
|
||||
@ -71,19 +71,19 @@ public class FontServiceImpl extends ServiceImpl<FontDao, Font> implements FontS
|
||||
@Override
|
||||
public IPage<Font> pageFonts(String type, String name, Integer pageNum, Integer pageSize) {
|
||||
LambdaQueryWrapper<Font> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
|
||||
// 根据语言类型查询
|
||||
if (StringUtils.hasText(type)) {
|
||||
queryWrapper.eq(Font::getLang, type);
|
||||
}
|
||||
|
||||
|
||||
// 根据名称模糊查询
|
||||
if (StringUtils.hasText(name)) {
|
||||
queryWrapper.like(Font::getName, name);
|
||||
}
|
||||
|
||||
|
||||
queryWrapper.orderByDesc(Font::getCreateTime);
|
||||
|
||||
|
||||
IPage<Font> page = new Page<>(pageNum, pageSize);
|
||||
return this.page(page, queryWrapper);
|
||||
}
|
||||
@ -97,11 +97,11 @@ public class FontServiceImpl extends ServiceImpl<FontDao, Font> implements FontS
|
||||
// 先从MySQL查询ID列表
|
||||
List<Font> fonts = this.list(new LambdaQueryWrapper<Font>()
|
||||
.in(Font::getFontFamily, fontFamilyList));
|
||||
|
||||
|
||||
if (CollectionUtils.isEmpty(fonts)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
// 根据ID列表从MongoDB查询详细信息
|
||||
List<FontContent> fontContents = new ArrayList<>();
|
||||
for (Font font : fonts) {
|
||||
@ -110,7 +110,7 @@ public class FontServiceImpl extends ServiceImpl<FontDao, Font> implements FontS
|
||||
fontContents.add(fontContent);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return fontContents;
|
||||
}
|
||||
|
||||
@ -118,4 +118,4 @@ public class FontServiceImpl extends ServiceImpl<FontDao, Font> implements FontS
|
||||
public FontContent getFontDetail(Long id) {
|
||||
return fontContentRepository.findById(id).orElse(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -36,7 +36,7 @@ public class FormServiceImpl extends ServiceImpl<FormSubmissionDao, FormSubmissi
|
||||
FormSubmission formSubmission = new FormSubmission();
|
||||
formSubmission.setTemplateFormId(templateFormId);
|
||||
formSubmission.setFormId(formId);
|
||||
long currentTime = System.currentTimeMillis() / 1000;
|
||||
long currentTime = System.currentTimeMillis();
|
||||
formSubmission.setSubmitTime(currentTime);
|
||||
formSubmission.setIpAddress(ipAddress);
|
||||
formSubmission.setUserAgent(userAgent);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user