报价模板下线分类字段,匹配只靠业务类型与关键词;并补后台站点标题配置。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
linmianxun
2026-09-15 14:31:52 +08:00
co-authored by Cursor
parent 0a3c74e3a1
commit 235ecd8c83
10 changed files with 45 additions and 117 deletions
@@ -50,11 +50,10 @@ public class InquiryQuoteTemplateController {
@GetMapping("/list")
public Result<IPage<Map<String, Object>>> list(@RequestParam(required = false) String keyword,
@RequestParam(required = false) String bizType,
@RequestParam(required = false) String category,
@RequestParam(required = false) String status,
@RequestParam(defaultValue = "1") Integer pageNo,
@RequestParam(defaultValue = "20") Integer pageSize) {
return Result.OK(quoteTemplateService.pageWithVersion(keyword, bizType, category, status, pageNo, pageSize));
return Result.OK(quoteTemplateService.pageWithVersion(keyword, bizType, status, pageNo, pageSize));
}
@AutoLog(value = "报价模板-上传版本")
@@ -64,13 +63,12 @@ public class InquiryQuoteTemplateController {
public Result<Map<String, Object>> upload(@RequestParam(required = false) String templateId,
@RequestParam(required = false) String name,
@RequestParam(required = false) String bizType,
@RequestParam(required = false) String category,
@RequestParam(required = false) String keywordsJson,
@RequestParam(required = false, defaultValue = "auto") String mode,
@RequestParam(required = false, defaultValue = "false") Boolean isDefault,
@RequestParam("file") MultipartFile file) {
Map<String, Object> row = quoteTemplateService.uploadVersion(
templateId, name, bizType, category, keywordsJson, mode,
templateId, name, bizType, keywordsJson, mode,
Boolean.TRUE.equals(isDefault), file, currentUser());
return Result.OK(row);
}
@@ -136,7 +134,7 @@ public class InquiryQuoteTemplateController {
return Result.OK(quoteTemplateService.getById(id));
}
@ApiOperation("编辑逻辑头(名称/分类/关键词/模式,不换文件)")
@ApiOperation("编辑逻辑头(名称/业务/关键词/模式,不换文件)")
@RequiresPermissions("inquiry:template:edit")
@PutMapping("/editMeta")
public Result<String> editMeta(@RequestBody InquiryQuoteTemplate body) {
@@ -153,9 +151,6 @@ public class InquiryQuoteTemplateController {
if (StringUtils.isNotBlank(body.getBizType())) {
db.setBizType(body.getBizType());
}
if (StringUtils.isNotBlank(body.getCategory())) {
db.setCategory(body.getCategory());
}
if (StringUtils.isNotBlank(body.getKeywordsJson())) {
db.setKeywordsJson(body.getKeywordsJson());
}
@@ -17,7 +17,8 @@ import java.util.Date;
/**
* 报价模板逻辑头,对应 inq_quote_template。
* <p>
* 职责:业务身份(海陆空/分类/关键词/默认/启停/auto|manual)。
* 职责:业务身份(海陆空/关键词/默认/启停/auto|manual)。
* 分类字段已下线:匹配只靠 bizType + keywords + isDefault。
* 版式字节与映射在版本表;历史报价应绑 templateId + versionNo。
*/
@Data
@@ -38,9 +39,6 @@ public class InquiryQuoteTemplate implements Serializable {
@ApiModelProperty("海运/空运/陆运")
private String bizType;
@ApiModelProperty("分类")
private String category;
@ApiModelProperty("关键词 JSON 数组字符串")
private String keywordsJson;
@@ -15,13 +15,13 @@ import java.util.Map;
*/
public interface IInquiryQuoteTemplateService extends IService<InquiryQuoteTemplate> {
IPage<Map<String, Object>> pageWithVersion(String keyword, String bizType, String category, String status,
IPage<Map<String, Object>> pageWithVersion(String keyword, String bizType, String status,
int pageNo, int pageSize);
/**
* 新建逻辑模板并写入第一版;或对已有模板追加新版本。
*/
Map<String, Object> uploadVersion(String templateId, String name, String bizType, String category,
Map<String, Object> uploadVersion(String templateId, String name, String bizType,
String keywordsJson, String mode, boolean isDefault,
MultipartFile file, String operator);
@@ -57,20 +57,17 @@ public class InquiryQuoteTemplateServiceImpl extends ServiceImpl<InquiryQuoteTem
private String contractPath;
@Override
public IPage<Map<String, Object>> pageWithVersion(String keyword, String bizType, String category, String status,
public IPage<Map<String, Object>> pageWithVersion(String keyword, String bizType, String status,
int pageNo, int pageSize) {
QueryWrapper<InquiryQuoteTemplate> qw = new QueryWrapper<>();
if (StringUtils.isNotBlank(bizType)) {
qw.eq("biz_type", bizType);
}
if (StringUtils.isNotBlank(category)) {
qw.eq("category", category);
}
if (StringUtils.isNotBlank(status)) {
qw.eq("status", status);
}
if (StringUtils.isNotBlank(keyword)) {
qw.and(w -> w.like("name", keyword).or().like("category", keyword).or().like("keywords_json", keyword));
qw.and(w -> w.like("name", keyword).or().like("keywords_json", keyword));
}
qw.orderByDesc("update_time").orderByDesc("create_time");
IPage<InquiryQuoteTemplate> page = page(new Page<>(pageNo, pageSize), qw);
@@ -88,7 +85,6 @@ public class InquiryQuoteTemplateServiceImpl extends ServiceImpl<InquiryQuoteTem
m.put("id", t.getId());
m.put("name", t.getName());
m.put("bizType", t.getBizType());
m.put("category", t.getCategory());
m.put("keywords", parseKeywords(t.getKeywordsJson()));
m.put("mode", t.getMode());
m.put("status", t.getStatus());
@@ -122,7 +118,7 @@ public class InquiryQuoteTemplateServiceImpl extends ServiceImpl<InquiryQuoteTem
@Override
@Transactional(rollbackFor = Exception.class)
public Map<String, Object> uploadVersion(String templateId, String name, String bizType, String category,
public Map<String, Object> uploadVersion(String templateId, String name, String bizType,
String keywordsJson, String mode, boolean isDefault,
MultipartFile file, String operator) {
if (file == null || file.isEmpty()) {
@@ -138,7 +134,6 @@ public class InquiryQuoteTemplateServiceImpl extends ServiceImpl<InquiryQuoteTem
template = new InquiryQuoteTemplate();
template.setName(StringUtils.defaultIfBlank(name, stripExt(original)));
template.setBizType(StringUtils.defaultIfBlank(bizType, "海运"));
template.setCategory(StringUtils.defaultIfBlank(category, defaultCategory(template.getBizType())));
template.setKeywordsJson(StringUtils.defaultIfBlank(keywordsJson, "[]"));
template.setMode(StringUtils.defaultIfBlank(mode, "auto"));
template.setStatus("disabled");
@@ -159,9 +154,6 @@ public class InquiryQuoteTemplateServiceImpl extends ServiceImpl<InquiryQuoteTem
if (StringUtils.isNotBlank(bizType)) {
template.setBizType(bizType);
}
if (StringUtils.isNotBlank(category)) {
template.setCategory(category);
}
if (StringUtils.isNotBlank(keywordsJson)) {
template.setKeywordsJson(keywordsJson);
}
@@ -445,7 +437,6 @@ public class InquiryQuoteTemplateServiceImpl extends ServiceImpl<InquiryQuoteTem
m.put("templateId", t.getId());
m.put("name", t.getName());
m.put("bizType", t.getBizType());
m.put("category", t.getCategory());
m.put("keywords", parseKeywords(t.getKeywordsJson()));
m.put("isDefault", t.getIsDefault() != null && t.getIsDefault() == 1);
m.put("versionNo", ver.getVersionNo());
@@ -716,14 +707,4 @@ public class InquiryQuoteTemplateServiceImpl extends ServiceImpl<InquiryQuoteTem
int i = name.lastIndexOf('.');
return i > 0 ? name.substring(0, i) : name;
}
private static String defaultCategory(String bizType) {
if ("空运".equals(bizType)) {
return "空运到港报价单模板";
}
if ("陆运".equals(bizType)) {
return "国内拼车";
}
return "海运报价单模板";
}
}