调整服务指令-去除指令标签,新增体型标签、情绪标签
This commit is contained in:
parent
146da5278a
commit
b0261bc819
|
@ -26,7 +26,7 @@ public class RabbitMQConfig {
|
||||||
return converter;
|
return converter;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 交换器(以Topic为例)
|
// 服务指令交换机
|
||||||
@Bean
|
@Bean
|
||||||
public DirectExchange fwzlExchange() {
|
public DirectExchange fwzlExchange() {
|
||||||
return new DirectExchange("hldy.fwzl");
|
return new DirectExchange("hldy.fwzl");
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
package com.nu.modules.directivetag.controller;
|
package com.nu.modules.directivetag.body.controller;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.nu.modules.directivetag.entity.DirectiveTag;
|
import com.nu.modules.directivetag.body.entity.DirectiveBodyTag;
|
||||||
import com.nu.modules.directivetag.service.IDirectiveTagService;
|
import com.nu.modules.directivetag.body.service.IDirectiveBodyTagService;
|
||||||
import com.nu.utils.RabbitMQUtil;
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
@ -25,18 +24,18 @@ import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 指令标签
|
* @Description: 体型标签
|
||||||
* @Author: 张明远
|
* @Author: 张明远
|
||||||
* @Date: 2025-03-17
|
* @Date: 2025-03-17
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Api(tags="指令标签")
|
@Api(tags="体型标签")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/directiveTag/directiveTag")
|
@RequestMapping("/directiveTag/bodyTag")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class DirectiveTagController extends JeecgController<DirectiveTag, IDirectiveTagService> {
|
public class DirectiveBodyTagController extends JeecgController<DirectiveBodyTag, IDirectiveBodyTagService> {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IDirectiveTagService directiveTagService;
|
private IDirectiveBodyTagService directiveTagService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页列表查询
|
* 分页列表查询
|
||||||
|
@ -47,10 +46,10 @@ public class DirectiveTagController extends JeecgController<DirectiveTag, IDirec
|
||||||
* @param req
|
* @param req
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
//@AutoLog(value = "指令标签-分页列表查询")
|
//@AutoLog(value = "体型标签-分页列表查询")
|
||||||
@ApiOperation(value="指令标签-分页列表查询", notes="指令标签-分页列表查询")
|
@ApiOperation(value="体型标签-分页列表查询", notes="体型标签-分页列表查询")
|
||||||
@GetMapping(value = "/list")
|
@GetMapping(value = "/list")
|
||||||
public Result<IPage<DirectiveTag>> queryPageList(DirectiveTag directiveTag,
|
public Result<IPage<DirectiveBodyTag>> queryPageList(DirectiveBodyTag directiveTag,
|
||||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
HttpServletRequest req) {
|
HttpServletRequest req) {
|
||||||
|
@ -58,9 +57,9 @@ public class DirectiveTagController extends JeecgController<DirectiveTag, IDirec
|
||||||
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
||||||
// 自定义多选的查询规则为:LIKE_WITH_OR
|
// 自定义多选的查询规则为:LIKE_WITH_OR
|
||||||
customeRuleMap.put("izEnabled", QueryRuleEnum.LIKE_WITH_OR);
|
customeRuleMap.put("izEnabled", QueryRuleEnum.LIKE_WITH_OR);
|
||||||
QueryWrapper<DirectiveTag> queryWrapper = QueryGenerator.initQueryWrapper(directiveTag, req.getParameterMap(),customeRuleMap);
|
QueryWrapper<DirectiveBodyTag> queryWrapper = QueryGenerator.initQueryWrapper(directiveTag, req.getParameterMap(),customeRuleMap);
|
||||||
Page<DirectiveTag> page = new Page<DirectiveTag>(pageNo, pageSize);
|
Page<DirectiveBodyTag> page = new Page<DirectiveBodyTag>(pageNo, pageSize);
|
||||||
IPage<DirectiveTag> pageList = directiveTagService.page(page, queryWrapper);
|
IPage<DirectiveBodyTag> pageList = directiveTagService.page(page, queryWrapper);
|
||||||
return Result.OK(pageList);
|
return Result.OK(pageList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,10 +69,10 @@ public class DirectiveTagController extends JeecgController<DirectiveTag, IDirec
|
||||||
* @param directiveTag
|
* @param directiveTag
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@AutoLog(value = "指令标签-添加")
|
@AutoLog(value = "体型标签-添加")
|
||||||
@ApiOperation(value="指令标签-添加", notes="指令标签-添加")
|
@ApiOperation(value="体型标签-添加", notes="体型标签-添加")
|
||||||
@PostMapping(value = "/add")
|
@PostMapping(value = "/add")
|
||||||
public Result<String> add(@RequestBody DirectiveTag directiveTag) {
|
public Result<String> add(@RequestBody DirectiveBodyTag directiveTag) {
|
||||||
directiveTagService.save(directiveTag);
|
directiveTagService.save(directiveTag);
|
||||||
return Result.OK("添加成功!");
|
return Result.OK("添加成功!");
|
||||||
}
|
}
|
||||||
|
@ -84,10 +83,10 @@ public class DirectiveTagController extends JeecgController<DirectiveTag, IDirec
|
||||||
* @param directiveTag
|
* @param directiveTag
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@AutoLog(value = "指令标签-编辑")
|
@AutoLog(value = "体型标签-编辑")
|
||||||
@ApiOperation(value="指令标签-编辑", notes="指令标签-编辑")
|
@ApiOperation(value="体型标签-编辑", notes="体型标签-编辑")
|
||||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||||
public Result<String> edit(@RequestBody DirectiveTag directiveTag) {
|
public Result<String> edit(@RequestBody DirectiveBodyTag directiveTag) {
|
||||||
directiveTagService.updateById(directiveTag);
|
directiveTagService.updateById(directiveTag);
|
||||||
return Result.OK("编辑成功!");
|
return Result.OK("编辑成功!");
|
||||||
}
|
}
|
||||||
|
@ -98,8 +97,8 @@ public class DirectiveTagController extends JeecgController<DirectiveTag, IDirec
|
||||||
* @param id
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@AutoLog(value = "指令标签-通过id删除")
|
@AutoLog(value = "体型标签-通过id删除")
|
||||||
@ApiOperation(value="指令标签-通过id删除", notes="指令标签-通过id删除")
|
@ApiOperation(value="体型标签-通过id删除", notes="体型标签-通过id删除")
|
||||||
@DeleteMapping(value = "/delete")
|
@DeleteMapping(value = "/delete")
|
||||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||||
if(directiveTagService.isUsed(id)){
|
if(directiveTagService.isUsed(id)){
|
||||||
|
@ -115,8 +114,8 @@ public class DirectiveTagController extends JeecgController<DirectiveTag, IDirec
|
||||||
* @param ids
|
* @param ids
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@AutoLog(value = "指令标签-批量删除")
|
@AutoLog(value = "体型标签-批量删除")
|
||||||
@ApiOperation(value="指令标签-批量删除", notes="指令标签-批量删除")
|
@ApiOperation(value="体型标签-批量删除", notes="体型标签-批量删除")
|
||||||
@DeleteMapping(value = "/deleteBatch")
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||||
if(directiveTagService.isUsed(ids)){
|
if(directiveTagService.isUsed(ids)){
|
||||||
|
@ -132,11 +131,11 @@ public class DirectiveTagController extends JeecgController<DirectiveTag, IDirec
|
||||||
* @param id
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
//@AutoLog(value = "指令标签-通过id查询")
|
//@AutoLog(value = "体型标签-通过id查询")
|
||||||
@ApiOperation(value="指令标签-通过id查询", notes="指令标签-通过id查询")
|
@ApiOperation(value="体型标签-通过id查询", notes="体型标签-通过id查询")
|
||||||
@GetMapping(value = "/queryById")
|
@GetMapping(value = "/queryById")
|
||||||
public Result<DirectiveTag> queryById(@RequestParam(name="id",required=true) String id) {
|
public Result<DirectiveBodyTag> queryById(@RequestParam(name="id",required=true) String id) {
|
||||||
DirectiveTag directiveTag = directiveTagService.getById(id);
|
DirectiveBodyTag directiveTag = directiveTagService.getById(id);
|
||||||
if(directiveTag==null) {
|
if(directiveTag==null) {
|
||||||
return Result.error("未找到对应数据");
|
return Result.error("未找到对应数据");
|
||||||
}
|
}
|
||||||
|
@ -150,8 +149,8 @@ public class DirectiveTagController extends JeecgController<DirectiveTag, IDirec
|
||||||
* @param directiveTag
|
* @param directiveTag
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = "/exportXls")
|
@RequestMapping(value = "/exportXls")
|
||||||
public ModelAndView exportXls(HttpServletRequest request, DirectiveTag directiveTag) {
|
public ModelAndView exportXls(HttpServletRequest request, DirectiveBodyTag directiveTag) {
|
||||||
return super.exportXls(request, directiveTag, DirectiveTag.class, "指令标签");
|
return super.exportXls(request, directiveTag, DirectiveBodyTag.class, "体型标签");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -163,7 +162,7 @@ public class DirectiveTagController extends JeecgController<DirectiveTag, IDirec
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
return super.importExcel(request, response, DirectiveTag.class);
|
return super.importExcel(request, response, DirectiveBodyTag.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package com.nu.modules.directivetag.entity;
|
package com.nu.modules.directivetag.body.entity;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@ -17,44 +17,44 @@ import lombok.EqualsAndHashCode;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 指令标签
|
* @Description: 体型标签
|
||||||
* @Author: 张明远
|
* @Author: 张明远
|
||||||
* @Date: 2025-03-17
|
* @Date: 2025-03-17
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("nu_config_directive_tag")
|
@TableName("nu_config_body_tag")
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@ApiModel(value="nu_config_directive_tag对象", description="指令标签")
|
@ApiModel(value="nu_config_body_tag对象", description="体型标签")
|
||||||
public class DirectiveTag implements Serializable {
|
public class DirectiveBodyTag implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/**id*/
|
/**id*/
|
||||||
@TableId(type = IdType.ASSIGN_ID)
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
@ApiModelProperty(value = "id")
|
@ApiModelProperty(value = "id")
|
||||||
private java.lang.String id;
|
private String id;
|
||||||
/**标签名称*/
|
/**标签名称*/
|
||||||
@Excel(name = "标签名称", width = 15)
|
@Excel(name = "标签名称", width = 15)
|
||||||
@ApiModelProperty(value = "标签名称")
|
@ApiModelProperty(value = "标签名称")
|
||||||
private java.lang.String tagName;
|
private String tagName;
|
||||||
/**排序*/
|
/**排序*/
|
||||||
@Excel(name = "排序", width = 15)
|
@Excel(name = "排序", width = 15)
|
||||||
@ApiModelProperty(value = "排序")
|
@ApiModelProperty(value = "排序")
|
||||||
private java.lang.Integer sort;
|
private Integer sort;
|
||||||
/**是否启用 0启用 1未启用*/
|
/**是否启用 0启用 1未启用*/
|
||||||
@Excel(name = "是否启用", width = 15, dicCode = "iz_enabled")
|
@Excel(name = "是否启用", width = 15, dicCode = "iz_enabled")
|
||||||
@Dict(dicCode = "iz_enabled")
|
@Dict(dicCode = "iz_enabled")
|
||||||
@ApiModelProperty(value = "是否启用")
|
@ApiModelProperty(value = "是否启用")
|
||||||
private java.lang.String izEnabled;
|
private String izEnabled;
|
||||||
/**是否删除 0未删除 1删除*/
|
/**是否删除 0未删除 1删除*/
|
||||||
@Excel(name = "是否删除", width = 15)
|
@Excel(name = "是否删除", width = 15)
|
||||||
@ApiModelProperty(value = "是否删除")
|
@ApiModelProperty(value = "是否删除")
|
||||||
@TableLogic
|
@TableLogic
|
||||||
private java.lang.String delFlag;
|
private String delFlag;
|
||||||
/**创建人*/
|
/**创建人*/
|
||||||
@ApiModelProperty(value = "创建人")
|
@ApiModelProperty(value = "创建人")
|
||||||
private java.lang.String createBy;
|
private String createBy;
|
||||||
/**创建日期*/
|
/**创建日期*/
|
||||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ -62,7 +62,7 @@ public class DirectiveTag implements Serializable {
|
||||||
private java.util.Date createTime;
|
private java.util.Date createTime;
|
||||||
/**更新人*/
|
/**更新人*/
|
||||||
@ApiModelProperty(value = "更新人")
|
@ApiModelProperty(value = "更新人")
|
||||||
private java.lang.String updateBy;
|
private String updateBy;
|
||||||
/**更新日期*/
|
/**更新日期*/
|
||||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ -70,5 +70,5 @@ public class DirectiveTag implements Serializable {
|
||||||
private java.util.Date updateTime;
|
private java.util.Date updateTime;
|
||||||
/**所属部门*/
|
/**所属部门*/
|
||||||
@ApiModelProperty(value = "所属部门")
|
@ApiModelProperty(value = "所属部门")
|
||||||
private java.lang.String sysOrgCode;
|
private String sysOrgCode;
|
||||||
}
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
package com.nu.modules.directivetag.body.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 服务指令-体型标签中间表
|
||||||
|
* @Author: 张明远
|
||||||
|
* @Date: 2025-4-23 09:26:04
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("nu_directive_body_tag")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value="nu_directive_body_tag对象", description="服务指令-体型标签中间表")
|
||||||
|
public class DirectiveBodyTagRelation implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private String directiveId;
|
||||||
|
private String tagId;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.nu.modules.directivetag.body.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.nu.modules.directivetag.body.entity.DirectiveBodyTag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 体型标签
|
||||||
|
* @Author: 张明远
|
||||||
|
* @Date: 2025-03-17
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface DirectiveBodyTagMapper extends BaseMapper<DirectiveBodyTag> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.nu.modules.directivetag.body.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.nu.modules.directivetag.body.entity.DirectiveBodyTagRelation;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 体型标签
|
||||||
|
* @Author: 张明远
|
||||||
|
* @Date: 2025-03-17
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface DirectiveBodyTagRelationMapper extends BaseMapper<DirectiveBodyTagRelation> {
|
||||||
|
void removeAllRelation();
|
||||||
|
|
||||||
|
List<DirectiveBodyTagRelation> selectAllRelation(List<String> ids);
|
||||||
|
}
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.nu.modules.directivetag.mapper.DirectiveTagMapper">
|
<mapper namespace="com.nu.modules.directivetag.body.mapper.DirectiveBodyTagMapper">
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
|
@ -0,0 +1,16 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.nu.modules.directivetag.body.mapper.DirectiveBodyTagRelationMapper">
|
||||||
|
<delete id="removeAllRelation">
|
||||||
|
delete from nu_directive_body_tag
|
||||||
|
</delete>
|
||||||
|
<select id="selectAllRelation" resultType="com.nu.modules.directivetag.body.entity.DirectiveBodyTagRelation">
|
||||||
|
select * from nu_directive_body_tag
|
||||||
|
<where>
|
||||||
|
directive_id in
|
||||||
|
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.nu.modules.directivetag.body.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.nu.modules.directivetag.body.entity.DirectiveBodyTag;
|
||||||
|
import com.nu.modules.directivetag.body.entity.DirectiveBodyTagRelation;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 体型标签
|
||||||
|
* @Author: 张明远
|
||||||
|
* @Date: 2025-03-17
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface IDirectiveBodyTagService extends IService<DirectiveBodyTag> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询数据是否已被使用
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
boolean isUsed(String id);
|
||||||
|
|
||||||
|
public void removeAllRelation();
|
||||||
|
|
||||||
|
public List<DirectiveBodyTagRelation> selectAllRelation(String dataSourceCode, List<String> ids);
|
||||||
|
|
||||||
|
void insertAllRelation(List<DirectiveBodyTagRelation> relations);
|
||||||
|
}
|
|
@ -0,0 +1,63 @@
|
||||||
|
package com.nu.modules.directivetag.body.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.nu.modules.directivetag.body.entity.DirectiveBodyTag;
|
||||||
|
import com.nu.modules.directivetag.body.entity.DirectiveBodyTagRelation;
|
||||||
|
import com.nu.modules.directivetag.body.mapper.DirectiveBodyTagMapper;
|
||||||
|
import com.nu.modules.directivetag.body.mapper.DirectiveBodyTagRelationMapper;
|
||||||
|
import com.nu.modules.directivetag.body.service.IDirectiveBodyTagService;
|
||||||
|
import com.nu.modules.servicedirective.mapper.ConfigServiceDirectiveMapper;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 体型标签
|
||||||
|
* @Author: 张明远
|
||||||
|
* @Date: 2025-03-17
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class DirectiveBodyTagServiceImpl extends ServiceImpl<DirectiveBodyTagMapper, DirectiveBodyTag> implements IDirectiveBodyTagService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ConfigServiceDirectiveMapper serviceDirectiveMapper;
|
||||||
|
@Autowired
|
||||||
|
private DirectiveBodyTagRelationMapper tagRelationMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isUsed(String ids) {
|
||||||
|
if (StringUtils.isBlank(ids)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
boolean result = false;
|
||||||
|
//是否已被服务指令使用
|
||||||
|
int i = serviceDirectiveMapper.queryCountByBodyTagIds(Arrays.asList(ids.split(",")));
|
||||||
|
if (i > 0) {
|
||||||
|
result = true;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void removeAllRelation() {
|
||||||
|
tagRelationMapper.removeAllRelation();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@DS("#dataSourceCode")
|
||||||
|
public List<DirectiveBodyTagRelation> selectAllRelation(String dataSourceCode, List<String> ids) {
|
||||||
|
return tagRelationMapper.selectAllRelation(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void insertAllRelation(List<DirectiveBodyTagRelation> idRelations) {
|
||||||
|
idRelations.forEach(ir -> {
|
||||||
|
tagRelationMapper.insert(ir);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,168 @@
|
||||||
|
package com.nu.modules.directivetag.emotion.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.nu.modules.directivetag.emotion.entity.DirectiveEmotionTag;
|
||||||
|
import com.nu.modules.directivetag.emotion.service.IDirectiveEmotionTagService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 情绪标签
|
||||||
|
* @Author: 张明远
|
||||||
|
* @Date: 2025-03-17
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Api(tags="情绪标签")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/directiveTag/emotionTag")
|
||||||
|
@Slf4j
|
||||||
|
public class DirectiveEmotionTagController extends JeecgController<DirectiveEmotionTag, IDirectiveEmotionTagService> {
|
||||||
|
@Autowired
|
||||||
|
private IDirectiveEmotionTagService directiveTagService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param directiveTag
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "情绪标签-分页列表查询")
|
||||||
|
@ApiOperation(value="情绪标签-分页列表查询", notes="情绪标签-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<DirectiveEmotionTag>> queryPageList(DirectiveEmotionTag directiveTag,
|
||||||
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
// 自定义查询规则
|
||||||
|
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
||||||
|
// 自定义多选的查询规则为:LIKE_WITH_OR
|
||||||
|
customeRuleMap.put("izEnabled", QueryRuleEnum.LIKE_WITH_OR);
|
||||||
|
QueryWrapper<DirectiveEmotionTag> queryWrapper = QueryGenerator.initQueryWrapper(directiveTag, req.getParameterMap(),customeRuleMap);
|
||||||
|
Page<DirectiveEmotionTag> page = new Page<DirectiveEmotionTag>(pageNo, pageSize);
|
||||||
|
IPage<DirectiveEmotionTag> pageList = directiveTagService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param directiveTag
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "情绪标签-添加")
|
||||||
|
@ApiOperation(value="情绪标签-添加", notes="情绪标签-添加")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody DirectiveEmotionTag directiveTag) {
|
||||||
|
directiveTagService.save(directiveTag);
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param directiveTag
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "情绪标签-编辑")
|
||||||
|
@ApiOperation(value="情绪标签-编辑", notes="情绪标签-编辑")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody DirectiveEmotionTag directiveTag) {
|
||||||
|
directiveTagService.updateById(directiveTag);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "情绪标签-通过id删除")
|
||||||
|
@ApiOperation(value="情绪标签-通过id删除", notes="情绪标签-通过id删除")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||||
|
if(directiveTagService.isUsed(id)){
|
||||||
|
return Result.error("已被使用,无法删除!");
|
||||||
|
}
|
||||||
|
directiveTagService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "情绪标签-批量删除")
|
||||||
|
@ApiOperation(value="情绪标签-批量删除", notes="情绪标签-批量删除")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||||
|
if(directiveTagService.isUsed(ids)){
|
||||||
|
return Result.error("已被使用,无法删除!");
|
||||||
|
}
|
||||||
|
this.directiveTagService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "情绪标签-通过id查询")
|
||||||
|
@ApiOperation(value="情绪标签-通过id查询", notes="情绪标签-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<DirectiveEmotionTag> queryById(@RequestParam(name="id",required=true) String id) {
|
||||||
|
DirectiveEmotionTag directiveTag = directiveTagService.getById(id);
|
||||||
|
if(directiveTag==null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(directiveTag);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param directiveTag
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, DirectiveEmotionTag directiveTag) {
|
||||||
|
return super.exportXls(request, directiveTag, DirectiveEmotionTag.class, "情绪标签");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, DirectiveEmotionTag.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,74 @@
|
||||||
|
package com.nu.modules.directivetag.emotion.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 情绪标签
|
||||||
|
* @Author: 张明远
|
||||||
|
* @Date: 2025-03-17
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("nu_config_emotion_tag")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value="nu_config_emotion_tag对象", description="情绪标签")
|
||||||
|
public class DirectiveEmotionTag implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**id*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@ApiModelProperty(value = "id")
|
||||||
|
private String id;
|
||||||
|
/**标签名称*/
|
||||||
|
@Excel(name = "标签名称", width = 15)
|
||||||
|
@ApiModelProperty(value = "标签名称")
|
||||||
|
private String tagName;
|
||||||
|
/**排序*/
|
||||||
|
@Excel(name = "排序", width = 15)
|
||||||
|
@ApiModelProperty(value = "排序")
|
||||||
|
private Integer sort;
|
||||||
|
/**是否启用 0启用 1未启用*/
|
||||||
|
@Excel(name = "是否启用", width = 15, dicCode = "iz_enabled")
|
||||||
|
@Dict(dicCode = "iz_enabled")
|
||||||
|
@ApiModelProperty(value = "是否启用")
|
||||||
|
private String izEnabled;
|
||||||
|
/**是否删除 0未删除 1删除*/
|
||||||
|
@Excel(name = "是否删除", width = 15)
|
||||||
|
@ApiModelProperty(value = "是否删除")
|
||||||
|
@TableLogic
|
||||||
|
private String delFlag;
|
||||||
|
/**创建人*/
|
||||||
|
@ApiModelProperty(value = "创建人")
|
||||||
|
private String createBy;
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty(value = "创建日期")
|
||||||
|
private java.util.Date createTime;
|
||||||
|
/**更新人*/
|
||||||
|
@ApiModelProperty(value = "更新人")
|
||||||
|
private String updateBy;
|
||||||
|
/**更新日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty(value = "更新日期")
|
||||||
|
private java.util.Date updateTime;
|
||||||
|
/**所属部门*/
|
||||||
|
@ApiModelProperty(value = "所属部门")
|
||||||
|
private String sysOrgCode;
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
package com.nu.modules.directivetag.emotion.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 服务指令-情绪标签中间表
|
||||||
|
* @Author: 张明远
|
||||||
|
* @Date: 2025-4-23 09:26:04
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("nu_directive_emotion_tag")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value="nu_directive_emotion_tag对象", description="服务指令-情绪标签中间表")
|
||||||
|
public class DirectiveEmotionTagRelation implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private String directiveId;
|
||||||
|
private String tagId;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.nu.modules.directivetag.emotion.mapper;
|
||||||
|
|
||||||
|
import com.nu.modules.directivetag.emotion.entity.DirectiveEmotionTag;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 情绪标签
|
||||||
|
* @Author: 张明远
|
||||||
|
* @Date: 2025-03-17
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface DirectiveEmotionTagMapper extends BaseMapper<DirectiveEmotionTag> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.nu.modules.directivetag.emotion.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.nu.modules.directivetag.emotion.entity.DirectiveEmotionTagRelation;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 情绪标签
|
||||||
|
* @Author: 张明远
|
||||||
|
* @Date: 2025-03-17
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface DirectiveEmotionTagRelationMapper extends BaseMapper<DirectiveEmotionTagRelation> {
|
||||||
|
void removeAllRelation();
|
||||||
|
|
||||||
|
List<DirectiveEmotionTagRelation> selectAllRelation(List<String> ids);
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.nu.modules.directivetag.emotion.mapper.DirectiveEmotionTagMapper">
|
||||||
|
|
||||||
|
</mapper>
|
|
@ -0,0 +1,16 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.nu.modules.directivetag.emotion.mapper.DirectiveEmotionTagRelationMapper">
|
||||||
|
<delete id="removeAllRelation">
|
||||||
|
delete from nu_directive_emotion_tag
|
||||||
|
</delete>
|
||||||
|
<select id="selectAllRelation" resultType="com.nu.modules.directivetag.emotion.entity.DirectiveEmotionTagRelation">
|
||||||
|
select * from nu_directive_emotion_tag
|
||||||
|
<where>
|
||||||
|
directive_id in
|
||||||
|
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.nu.modules.directivetag.emotion.service;
|
||||||
|
|
||||||
|
import com.nu.modules.directivetag.emotion.entity.DirectiveEmotionTag;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.nu.modules.directivetag.emotion.entity.DirectiveEmotionTagRelation;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 情绪标签
|
||||||
|
* @Author: 张明远
|
||||||
|
* @Date: 2025-03-17
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface IDirectiveEmotionTagService extends IService<DirectiveEmotionTag> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询数据是否已被使用
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
boolean isUsed(String id);
|
||||||
|
|
||||||
|
public void removeAllRelation();
|
||||||
|
|
||||||
|
public List<DirectiveEmotionTagRelation> selectAllRelation(String dataSourceCode, List<String> ids);
|
||||||
|
|
||||||
|
void insertAllRelation(List<DirectiveEmotionTagRelation> relations);
|
||||||
|
}
|
|
@ -0,0 +1,63 @@
|
||||||
|
package com.nu.modules.directivetag.emotion.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.nu.modules.directivetag.emotion.entity.DirectiveEmotionTag;
|
||||||
|
import com.nu.modules.directivetag.emotion.entity.DirectiveEmotionTagRelation;
|
||||||
|
import com.nu.modules.directivetag.emotion.mapper.DirectiveEmotionTagMapper;
|
||||||
|
import com.nu.modules.directivetag.emotion.mapper.DirectiveEmotionTagRelationMapper;
|
||||||
|
import com.nu.modules.directivetag.emotion.service.IDirectiveEmotionTagService;
|
||||||
|
import com.nu.modules.servicedirective.mapper.ConfigServiceDirectiveMapper;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 情绪标签
|
||||||
|
* @Author: 张明远
|
||||||
|
* @Date: 2025-03-17
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class DirectiveEmotionTagServiceImpl extends ServiceImpl<DirectiveEmotionTagMapper, DirectiveEmotionTag> implements IDirectiveEmotionTagService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ConfigServiceDirectiveMapper serviceDirectiveMapper;
|
||||||
|
@Autowired
|
||||||
|
private DirectiveEmotionTagRelationMapper tagRelationMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isUsed(String ids) {
|
||||||
|
if (StringUtils.isBlank(ids)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
boolean result = false;
|
||||||
|
//是否已被服务指令使用
|
||||||
|
int i = serviceDirectiveMapper.queryCountByEmotionTagIds(Arrays.asList(ids.split(",")));
|
||||||
|
if (i > 0) {
|
||||||
|
result = true;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void removeAllRelation() {
|
||||||
|
tagRelationMapper.removeAllRelation();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@DS("#dataSourceCode")
|
||||||
|
public List<DirectiveEmotionTagRelation> selectAllRelation(String dataSourceCode, List<String> ids) {
|
||||||
|
return tagRelationMapper.selectAllRelation(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void insertAllRelation(List<DirectiveEmotionTagRelation> idRelations) {
|
||||||
|
idRelations.forEach(ir -> {
|
||||||
|
tagRelationMapper.insert(ir);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,14 +0,0 @@
|
||||||
package com.nu.modules.directivetag.mapper;
|
|
||||||
|
|
||||||
import com.nu.modules.directivetag.entity.DirectiveTag;
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 指令标签
|
|
||||||
* @Author: 张明远
|
|
||||||
* @Date: 2025-03-17
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
public interface DirectiveTagMapper extends BaseMapper<DirectiveTag> {
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,20 +0,0 @@
|
||||||
package com.nu.modules.directivetag.service;
|
|
||||||
|
|
||||||
import com.nu.modules.directivetag.entity.DirectiveTag;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 指令标签
|
|
||||||
* @Author: 张明远
|
|
||||||
* @Date: 2025-03-17
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
public interface IDirectiveTagService extends IService<DirectiveTag> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询数据是否已被使用
|
|
||||||
* @param ids
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
boolean isUsed(String id);
|
|
||||||
}
|
|
|
@ -1,40 +0,0 @@
|
||||||
package com.nu.modules.directivetag.service.impl;
|
|
||||||
|
|
||||||
import com.nu.modules.directivetag.entity.DirectiveTag;
|
|
||||||
import com.nu.modules.directivetag.mapper.DirectiveTagMapper;
|
|
||||||
import com.nu.modules.directivetag.service.IDirectiveTagService;
|
|
||||||
import com.nu.modules.servicedirective.mapper.ConfigServiceDirectiveMapper;
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 指令标签
|
|
||||||
* @Author: 张明远
|
|
||||||
* @Date: 2025-03-17
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class DirectiveTagServiceImpl extends ServiceImpl<DirectiveTagMapper, DirectiveTag> implements IDirectiveTagService {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ConfigServiceDirectiveMapper serviceDirectiveMapper;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isUsed(String ids) {
|
|
||||||
if (StringUtils.isBlank(ids)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
boolean result = false;
|
|
||||||
//是否已被服务指令使用
|
|
||||||
int i = serviceDirectiveMapper.queryCountByTagIds(Arrays.asList(ids.split(",")));
|
|
||||||
if (i > 0) {
|
|
||||||
result = true;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -16,12 +16,8 @@ import com.nu.utils.RabbitMQUtil;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.compress.utils.Lists;
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
||||||
import org.checkerframework.checker.units.qual.A;
|
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
|
||||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||||
import org.jeecg.common.system.base.controller.JeecgController;
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
import org.jeecg.common.system.query.QueryGenerator;
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
@ -29,11 +25,8 @@ import org.jeecg.common.system.query.QueryRuleEnum;
|
||||||
import org.jeecg.common.system.vo.DictModel;
|
import org.jeecg.common.system.vo.DictModel;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -78,11 +71,6 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
||||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||||
HttpServletRequest req) {
|
HttpServletRequest req) {
|
||||||
//切换数据源
|
|
||||||
if (StringUtils.isNotBlank(dataSourceCode)) {
|
|
||||||
pageNo = -1;
|
|
||||||
pageSize = -1;
|
|
||||||
}
|
|
||||||
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
||||||
// 自定义多选的查询规则为:LIKE_WITH_OR
|
// 自定义多选的查询规则为:LIKE_WITH_OR
|
||||||
customeRuleMap.put("categoryId", QueryRuleEnum.LIKE_WITH_OR);
|
customeRuleMap.put("categoryId", QueryRuleEnum.LIKE_WITH_OR);
|
||||||
|
@ -94,24 +82,17 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
||||||
customeRuleMap.put("cycleType", QueryRuleEnum.LIKE_WITH_OR);
|
customeRuleMap.put("cycleType", QueryRuleEnum.LIKE_WITH_OR);
|
||||||
customeRuleMap.put("izEnabled", QueryRuleEnum.LIKE_WITH_OR);
|
customeRuleMap.put("izEnabled", QueryRuleEnum.LIKE_WITH_OR);
|
||||||
QueryWrapper<ConfigServiceDirective> queryWrapper = QueryGenerator.initQueryWrapper(configServiceDirective, req.getParameterMap(), customeRuleMap);
|
QueryWrapper<ConfigServiceDirective> queryWrapper = QueryGenerator.initQueryWrapper(configServiceDirective, req.getParameterMap(), customeRuleMap);
|
||||||
//指令同步 - 筛选已选择/未选择
|
|
||||||
if ("selected".equals(configServiceDirective.getViewType())) {
|
|
||||||
if(configServiceDirective.getSelectedRowIds()!=null && !configServiceDirective.getSelectedRowIds().isEmpty()){
|
|
||||||
queryWrapper.in("id",configServiceDirective.getSelectedRowIds());
|
|
||||||
}else{
|
|
||||||
queryWrapper.eq("id","--!--!--!--");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ("unselected".equals(configServiceDirective.getViewType())) {
|
|
||||||
if(configServiceDirective.getSelectedRowIds()!=null && !configServiceDirective.getSelectedRowIds().isEmpty()){
|
|
||||||
queryWrapper.notIn("id",configServiceDirective.getSelectedRowIds());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
queryWrapper.select("id");
|
queryWrapper.select("id");
|
||||||
//如果有服务指令需要提前查询下对应的服务指令id
|
//如果有服务指令需要提前查询下对应的服务指令id
|
||||||
List<ConfigServiceDirective> directiveIds = null;
|
List<ConfigServiceDirective> directiveIds = null;
|
||||||
if (StringUtils.isNotBlank(configServiceDirective.getTags())) {
|
if (StringUtils.isNotBlank(configServiceDirective.getBodyTags())) {
|
||||||
directiveIds = configServiceDirectiveService.queryDirectiveIdByTagIds(configServiceDirective.getTags());
|
directiveIds = configServiceDirectiveService.queryDirectiveIdByBodyTagIds(configServiceDirective.getBodyTags());
|
||||||
|
if (directiveIds != null && !directiveIds.isEmpty()) {
|
||||||
|
queryWrapper.in("id", directiveIds.stream().map(ConfigServiceDirective::getId).collect(Collectors.toList()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(configServiceDirective.getEmotionTags())) {
|
||||||
|
directiveIds = configServiceDirectiveService.queryDirectiveIdByEmotionTagIds(configServiceDirective.getEmotionTags());
|
||||||
if (directiveIds != null && !directiveIds.isEmpty()) {
|
if (directiveIds != null && !directiveIds.isEmpty()) {
|
||||||
queryWrapper.in("id", directiveIds.stream().map(ConfigServiceDirective::getId).collect(Collectors.toList()));
|
queryWrapper.in("id", directiveIds.stream().map(ConfigServiceDirective::getId).collect(Collectors.toList()));
|
||||||
}
|
}
|
||||||
|
@ -132,9 +113,6 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
||||||
*/
|
*/
|
||||||
@PostMapping("/async")
|
@PostMapping("/async")
|
||||||
public Result<String> async(@RequestBody DirectiveMQDto dto) {
|
public Result<String> async(@RequestBody DirectiveMQDto dto) {
|
||||||
//TODO 源数据的服务指令更新了 不处理 到日子后只能增量
|
|
||||||
//TODO 服务指令相关的字典(服务类别、类型等)需要加个是否已被同步标识
|
|
||||||
//TODO 前台选择机构后刷新数据应该有个更新中的效果
|
|
||||||
List<DictModel> dicts = sysBaseAPI.getDictItems("mq_org_queue");
|
List<DictModel> dicts = sysBaseAPI.getDictItems("mq_org_queue");
|
||||||
String queue = dicts.stream().filter(d -> d.getValue().equals(dto.getOrgCode())).findFirst().map(DictModel::getText).orElse(null);
|
String queue = dicts.stream().filter(d -> d.getValue().equals(dto.getOrgCode())).findFirst().map(DictModel::getText).orElse(null);
|
||||||
if (StringUtils.isNotBlank(queue)) {
|
if (StringUtils.isNotBlank(queue)) {
|
||||||
|
@ -170,75 +148,6 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
||||||
return Result.ok("");
|
return Result.ok("");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加
|
|
||||||
*
|
|
||||||
* @param configServiceDirective
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "服务指令-添加")
|
|
||||||
@ApiOperation(value = "服务指令-添加", notes = "服务指令-添加")
|
|
||||||
@RequiresPermissions("serviceDirective:config_service_directive:add")
|
|
||||||
@PostMapping(value = "/add")
|
|
||||||
public Result<String> add(@RequestBody ConfigServiceDirective configServiceDirective) {
|
|
||||||
configServiceDirectiveService.save(configServiceDirective);
|
|
||||||
if (StringUtils.isNotBlank(configServiceDirective.getTags())) {
|
|
||||||
configServiceDirectiveService.saveTags(configServiceDirective);
|
|
||||||
} else {
|
|
||||||
configServiceDirectiveService.removeTags(configServiceDirective);
|
|
||||||
}
|
|
||||||
return Result.OK("添加成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 编辑
|
|
||||||
*
|
|
||||||
* @param configServiceDirective
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "服务指令-编辑")
|
|
||||||
@ApiOperation(value = "服务指令-编辑", notes = "服务指令-编辑")
|
|
||||||
@RequiresPermissions("serviceDirective:config_service_directive:edit")
|
|
||||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
|
||||||
public Result<String> edit(@RequestBody ConfigServiceDirective configServiceDirective) {
|
|
||||||
configServiceDirectiveService.updateById(configServiceDirective);
|
|
||||||
if (StringUtils.isNotBlank(configServiceDirective.getTags())) {
|
|
||||||
configServiceDirectiveService.saveTags(configServiceDirective);
|
|
||||||
} else {
|
|
||||||
configServiceDirectiveService.removeTags(configServiceDirective);
|
|
||||||
}
|
|
||||||
return Result.OK("编辑成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id删除
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "服务指令-通过id删除")
|
|
||||||
@ApiOperation(value = "服务指令-通过id删除", notes = "服务指令-通过id删除")
|
|
||||||
@RequiresPermissions("serviceDirective:config_service_directive:delete")
|
|
||||||
@DeleteMapping(value = "/delete")
|
|
||||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
|
||||||
configServiceDirectiveService.removeById(id);
|
|
||||||
return Result.OK("删除成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除
|
|
||||||
*
|
|
||||||
* @param ids
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "服务指令-批量删除")
|
|
||||||
@ApiOperation(value = "服务指令-批量删除", notes = "服务指令-批量删除")
|
|
||||||
@RequiresPermissions("serviceDirective:config_service_directive:deleteBatch")
|
|
||||||
@DeleteMapping(value = "/deleteBatch")
|
|
||||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
|
||||||
this.configServiceDirectiveService.removeByIds(Arrays.asList(ids.split(",")));
|
|
||||||
return Result.OK("批量删除成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过id查询
|
* 通过id查询
|
||||||
|
@ -257,29 +166,6 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
||||||
return Result.OK(configServiceDirective);
|
return Result.OK(configServiceDirective);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出excel
|
|
||||||
*
|
|
||||||
* @param request
|
|
||||||
* @param configServiceDirective
|
|
||||||
*/
|
|
||||||
@RequiresPermissions("serviceDirective:config_service_directive:exportXls")
|
|
||||||
@RequestMapping(value = "/exportXls")
|
|
||||||
public ModelAndView exportXls(HttpServletRequest request, ConfigServiceDirective configServiceDirective) {
|
|
||||||
return super.exportXls(request, configServiceDirective, ConfigServiceDirective.class, "服务指令");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过excel导入数据
|
|
||||||
*
|
|
||||||
* @param request
|
|
||||||
* @param response
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@RequiresPermissions("serviceDirective:config_service_directive:importExcel")
|
|
||||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
|
||||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
|
||||||
return super.importExcel(request, response, ConfigServiceDirective.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,8 @@ package com.nu.modules.servicedirective.entity;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.nu.modules.directivetag.entity.DirectiveTag;
|
import com.nu.modules.directivetag.body.entity.DirectiveBodyTag;
|
||||||
|
import com.nu.modules.directivetag.emotion.entity.DirectiveEmotionTag;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -142,12 +143,28 @@ public class ConfigServiceDirective implements Serializable {
|
||||||
private Integer typeRowSpan;
|
private Integer typeRowSpan;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private Integer instructionRowSpan;
|
private Integer instructionRowSpan;
|
||||||
@TableField(exist = false)
|
|
||||||
private String tags;
|
|
||||||
|
|
||||||
//服务指令标签
|
|
||||||
|
//体型标签id,id,id
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
List<DirectiveTag> tagList;
|
private String bodyTags;
|
||||||
|
//情绪标签id,id,id
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String emotionTags;
|
||||||
|
//体型标签
|
||||||
|
@TableField(exist = false)
|
||||||
|
List<DirectiveBodyTag> bodyTagList;
|
||||||
|
//体型标签字符串
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String bodyTagsName;
|
||||||
|
|
||||||
|
//情绪标签
|
||||||
|
@TableField(exist = false)
|
||||||
|
List<DirectiveEmotionTag> emotionTagList;
|
||||||
|
//情绪标签字符串
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String emotionTagsName;
|
||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String orgCode;
|
private String orgCode;
|
||||||
|
|
||||||
|
|
|
@ -24,14 +24,6 @@ public interface ConfigServiceDirectiveMapper extends BaseMapper<ConfigServiceDi
|
||||||
@Param("directive") ConfigServiceDirective directive,
|
@Param("directive") ConfigServiceDirective directive,
|
||||||
@Param("ids") List<ConfigServiceDirective> records
|
@Param("ids") List<ConfigServiceDirective> records
|
||||||
);
|
);
|
||||||
// IPage<ConfigServiceDirective> pageList(
|
|
||||||
// @Param("page") Page<ConfigServiceDirective> page,
|
|
||||||
// @Param("directive") ConfigServiceDirective directive
|
|
||||||
// );
|
|
||||||
|
|
||||||
int deleteTags(@Param("directive") ConfigServiceDirective configServiceDirective);
|
|
||||||
|
|
||||||
int saveTags(@Param("directive") ConfigServiceDirective configServiceDirective);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据指令标签查询对应的服务指令id
|
* 根据指令标签查询对应的服务指令id
|
||||||
|
@ -44,4 +36,28 @@ public interface ConfigServiceDirectiveMapper extends BaseMapper<ConfigServiceDi
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int queryCountByTagIds(@Param("tagIds") List<String> tagIds);
|
int queryCountByTagIds(@Param("tagIds") List<String> tagIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据体型标签查询对应的服务指令id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<ConfigServiceDirective> queryDirectiveIdByBodyTagIds(@Param("tagIds") String tagIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据情绪标签查询对应的服务指令id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<ConfigServiceDirective> queryDirectiveIdByEmotionTagIds(@Param("tagIds") String tagIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询体型标签是否被使用
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int queryCountByBodyTagIds(@Param("tagIds") List<String> tagIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询情绪标签是否被使用
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int queryCountByEmotionTagIds(@Param("tagIds") List<String> tagIds);
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,9 +31,14 @@
|
||||||
<result property="previewFile" column="preview_file"/>
|
<result property="previewFile" column="preview_file"/>
|
||||||
<result property="immediateFile" column="immediate_file"/>
|
<result property="immediateFile" column="immediate_file"/>
|
||||||
|
|
||||||
<collection property="tagList" ofType="com.nu.modules.directivetag.entity.DirectiveTag">
|
<collection property="bodyTagList" ofType="com.nu.modules.directivetag.body.entity.DirectiveBodyTag">
|
||||||
<id property="id" column="tagId"/>
|
<id property="id" column="bodyTagId"/>
|
||||||
<result property="tagName" column="tagName"/>
|
<result property="tagName" column="bodyTagName"/>
|
||||||
|
</collection>
|
||||||
|
|
||||||
|
<collection property="emotionTagList" ofType="com.nu.modules.directivetag.emotion.entity.DirectiveEmotionTag">
|
||||||
|
<id property="id" column="emotionTagId"/>
|
||||||
|
<result property="tagName" column="emotionTagName"/>
|
||||||
</collection>
|
</collection>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
@ -66,11 +71,15 @@
|
||||||
c.mp4_file,
|
c.mp4_file,
|
||||||
c.preview_file,
|
c.preview_file,
|
||||||
c.immediate_file,
|
c.immediate_file,
|
||||||
tag.id as tagId,
|
bodytag.id as bodyTagId,
|
||||||
tag.tag_name as tagName
|
bodytag.tag_name as bodyTagName,
|
||||||
|
emotag.id as emotionTagId,
|
||||||
|
emotag.tag_name as emotionTagName
|
||||||
FROM nu_config_service_directive c
|
FROM nu_config_service_directive c
|
||||||
LEFT JOIN nu_directive_tag d ON c.id = d.directive_id
|
LEFT JOIN nu_directive_body_tag dbt ON c.id = dbt.directive_id
|
||||||
LEFT JOIN nu_config_directive_tag tag ON d.tag_id = tag.id
|
LEFT JOIN nu_config_body_tag bodytag ON dbt.tag_id = bodytag.id
|
||||||
|
LEFT JOIN nu_directive_emotion_tag det ON c.id = det.directive_id
|
||||||
|
LEFT JOIN nu_config_emotion_tag emotag ON det.tag_id = emotag.id
|
||||||
<where>
|
<where>
|
||||||
c.id IN
|
c.id IN
|
||||||
<foreach collection="ids" item="item" open="(" separator="," close=")">
|
<foreach collection="ids" item="item" open="(" separator="," close=")">
|
||||||
|
@ -94,16 +103,31 @@
|
||||||
</foreach>
|
</foreach>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<delete id="deleteTags">
|
<select id="queryDirectiveIdByBodyTagIds" resultType="com.nu.modules.servicedirective.entity.ConfigServiceDirective">
|
||||||
delete
|
SELECT distinct directive_id as id FROM nu_directive_body_tag WHERE tag_id IN
|
||||||
from nu_directive_tag
|
<foreach collection="tagIds.split(',')" item="tagId" open="(" separator="," close=")">
|
||||||
where directive_id = #{directive.id}
|
#{tagId}
|
||||||
</delete>
|
|
||||||
|
|
||||||
<insert id="saveTags">
|
|
||||||
insert into nu_directive_tag (directive_id,tag_id) values
|
|
||||||
<foreach collection="directive.tags.split(',')" item="tagId" separator=",">
|
|
||||||
(#{directive.id}, #{tagId})
|
|
||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</select>
|
||||||
|
|
||||||
|
<select id="queryDirectiveIdByEmotionTagIds" resultType="com.nu.modules.servicedirective.entity.ConfigServiceDirective">
|
||||||
|
SELECT distinct directive_id as id FROM nu_directive_emotion_tag WHERE tag_id IN
|
||||||
|
<foreach collection="tagIds.split(',')" item="tagId" open="(" separator="," close=")">
|
||||||
|
#{tagId}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="queryCountByBodyTagIds" resultType="java.lang.Integer">
|
||||||
|
SELECT COUNT(*) FROM nu_directive_body_tag WHERE tag_id IN
|
||||||
|
<foreach collection="tagIds" item="item" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="queryCountByEmotionTagIds" resultType="java.lang.Integer">
|
||||||
|
SELECT COUNT(*) FROM nu_directive_emotion_tag WHERE tag_id IN
|
||||||
|
<foreach collection="tagIds" item="item" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -18,17 +18,7 @@ public interface IConfigServiceDirectiveService extends IService<ConfigServiceDi
|
||||||
|
|
||||||
List<ConfigServiceDirective> pageList(ConfigServiceDirective configServiceDirective,IPage<ConfigServiceDirective> list);
|
List<ConfigServiceDirective> pageList(ConfigServiceDirective configServiceDirective,IPage<ConfigServiceDirective> list);
|
||||||
|
|
||||||
/**
|
List<ConfigServiceDirective> queryDirectiveIdByBodyTagIds(String tags);
|
||||||
* 存储指令标签数据
|
|
||||||
* @param configServiceDirective
|
|
||||||
*/
|
|
||||||
void saveTags(ConfigServiceDirective configServiceDirective);
|
|
||||||
|
|
||||||
/**
|
List<ConfigServiceDirective> queryDirectiveIdByEmotionTagIds(String tags);
|
||||||
* 移除改服务指令下指令标签
|
|
||||||
* @param configServiceDirective
|
|
||||||
*/
|
|
||||||
void removeTags(ConfigServiceDirective configServiceDirective);
|
|
||||||
|
|
||||||
List<ConfigServiceDirective> queryDirectiveIdByTagIds(String tags);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package com.nu.modules.servicedirective.service.impl;
|
package com.nu.modules.servicedirective.service.impl;
|
||||||
|
|
||||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.nu.modules.directivetag.entity.DirectiveTag;
|
import com.nu.modules.directivetag.body.entity.DirectiveBodyTag;
|
||||||
|
import com.nu.modules.directivetag.emotion.entity.DirectiveEmotionTag;
|
||||||
import com.nu.modules.servicedirective.entity.ConfigServiceDirective;
|
import com.nu.modules.servicedirective.entity.ConfigServiceDirective;
|
||||||
import com.nu.modules.servicedirective.mapper.ConfigServiceDirectiveMapper;
|
import com.nu.modules.servicedirective.mapper.ConfigServiceDirectiveMapper;
|
||||||
import com.nu.modules.servicedirective.service.IConfigServiceDirectiveService;
|
import com.nu.modules.servicedirective.service.IConfigServiceDirectiveService;
|
||||||
|
@ -30,8 +30,11 @@ public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigService
|
||||||
//处理服务标签字段
|
//处理服务标签字段
|
||||||
if (list != null && !list.isEmpty()) {
|
if (list != null && !list.isEmpty()) {
|
||||||
list.stream().forEach(record -> {
|
list.stream().forEach(record -> {
|
||||||
List<DirectiveTag> tagList = record.getTagList();
|
List<DirectiveBodyTag> bodyTagList = record.getBodyTagList();
|
||||||
record.setTags(tagList.stream().map(DirectiveTag::getId).collect(Collectors.joining(",")));
|
record.setBodyTags(bodyTagList.stream().map(DirectiveBodyTag::getId).collect(Collectors.joining(",")));
|
||||||
|
|
||||||
|
List<DirectiveEmotionTag> emotionTagList = record.getEmotionTagList();
|
||||||
|
record.setEmotionTags(emotionTagList.stream().map(DirectiveEmotionTag::getId).collect(Collectors.joining(",")));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
//处理单元格合并所需数据
|
//处理单元格合并所需数据
|
||||||
|
@ -48,101 +51,55 @@ public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigService
|
||||||
public void merge(List<ConfigServiceDirective> records) {
|
public void merge(List<ConfigServiceDirective> records) {
|
||||||
if (records == null || records.isEmpty()) return;
|
if (records == null || records.isEmpty()) return;
|
||||||
|
|
||||||
int outerStart = 0; // 一级分组起始索引
|
int outerStart = 0; // 新一级分组(原三级)起始索引
|
||||||
String currentCategoryId = records.get(0).getCategoryId();
|
String currentInstructionId = records.get(0).getInstructionTagId();
|
||||||
|
|
||||||
// 一级循环:遍历所有记录处理categoryId分组
|
// 新一级循环:遍历所有记录处理instructionTagId分组
|
||||||
for (int i = 1; i < records.size(); i++) {
|
for (int i = 1; i < records.size(); i++) {
|
||||||
// 当遇到不同的categoryId时处理当前分组
|
if (!records.get(i).getInstructionTagId().equals(currentInstructionId)) {
|
||||||
if (!records.get(i).getCategoryId().equals(currentCategoryId)) {
|
processAllGroups(records, outerStart, i - 1); // 处理完整个新一级分组
|
||||||
processAllGroups(records, outerStart, i - 1); // 处理完整个一级分组
|
outerStart = i;
|
||||||
outerStart = i; // 重置一级起始位置
|
currentInstructionId = records.get(i).getInstructionTagId();
|
||||||
currentCategoryId = records.get(i).getCategoryId();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
processAllGroups(records, outerStart, records.size() - 1); // 处理最后一组
|
processAllGroups(records, outerStart, records.size() - 1); // 处理最后一组
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处理完整个一级分组(包含二级和三级分组)
|
|
||||||
*
|
|
||||||
* @param records 记录列表
|
|
||||||
* @param start 当前分组的起始索引
|
|
||||||
* @param end 当前分组的结束索引
|
|
||||||
*/
|
|
||||||
private void processAllGroups(List<ConfigServiceDirective> records, int start, int end) {
|
private void processAllGroups(List<ConfigServiceDirective> records, int start, int end) {
|
||||||
processOuterGroup(records, start, end); // 处理一级categoryRowSpan
|
processOuterGroup(records, start, end); // 处理新一级instructionRowSpan
|
||||||
|
|
||||||
int innerStart = start; // 二级分组起始索引
|
int middleStart = start; // 新二级分组起始索引
|
||||||
|
String currentCategoryId = records.get(middleStart).getCategoryId();
|
||||||
|
|
||||||
|
// 新二级循环:处理当前新一级分组内的categoryId分组
|
||||||
|
for (int j = middleStart + 1; j <= end; j++) {
|
||||||
|
if (!records.get(j).getCategoryId().equals(currentCategoryId)) {
|
||||||
|
processMiddleGroup(records, middleStart, j - 1); // 处理完整个新二级分组
|
||||||
|
middleStart = j;
|
||||||
|
currentCategoryId = records.get(j).getCategoryId();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
processMiddleGroup(records, middleStart, end); // 处理最后一组新二级数据
|
||||||
|
}
|
||||||
|
|
||||||
|
private void processMiddleGroup(List<ConfigServiceDirective> records, int start, int end) {
|
||||||
|
processTypeRowSpan(records, start, end); // 设置新二级categoryRowSpan
|
||||||
|
|
||||||
|
int innerStart = start; // 新三级分组起始索引
|
||||||
String currentTypeId = records.get(innerStart).getTypeId();
|
String currentTypeId = records.get(innerStart).getTypeId();
|
||||||
|
|
||||||
// 二级循环:处理当前一级分组内的typeId分组
|
// 新三级循环:处理当前新二级分组内的typeId分组
|
||||||
for (int j = innerStart + 1; j <= end; j++) {
|
for (int k = innerStart + 1; k <= end; k++) {
|
||||||
if (!records.get(j).getTypeId().equals(currentTypeId)) {
|
if (!records.get(k).getTypeId().equals(currentTypeId)) {
|
||||||
processMiddleGroup(records, innerStart, j - 1); // 处理完整个二级分组
|
processInnerGroup(records, innerStart, k - 1); // 处理完整个新三级分组
|
||||||
innerStart = j;
|
innerStart = k;
|
||||||
currentTypeId = records.get(j).getTypeId();
|
currentTypeId = records.get(k).getTypeId();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
processMiddleGroup(records, innerStart, end); // 处理最后一组二级数据
|
processInnerGroup(records, innerStart, end); // 处理最后一组新三级数据
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 处理二级typeId分组(包含三级instructionTagId分组)
|
|
||||||
*
|
|
||||||
* @param records 记录列表
|
|
||||||
* @param start 当前分组的起始索引
|
|
||||||
* @param end 当前分组的结束索引
|
|
||||||
*/
|
|
||||||
private void processMiddleGroup(List<ConfigServiceDirective> records, int start, int end) {
|
|
||||||
processTypeRowSpan(records, start, end); // 设置二级typeRowSpan
|
|
||||||
|
|
||||||
int instructionStart = start; // 三级分组起始索引
|
|
||||||
String currentInstructionId = records.get(instructionStart).getInstructionTagId();
|
|
||||||
|
|
||||||
// 三级循环:处理当前二级分组内的instructionTagId分组
|
|
||||||
for (int k = instructionStart + 1; k <= end; k++) {
|
|
||||||
if (!records.get(k).getInstructionTagId().equals(currentInstructionId)) {
|
|
||||||
processInnerGroup(records, instructionStart, k - 1); // 处理完整个三级分组
|
|
||||||
instructionStart = k;
|
|
||||||
currentInstructionId = records.get(k).getInstructionTagId();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
processInnerGroup(records, instructionStart, end); // 处理最后一组三级数据
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处理三级instructionTagId分组
|
|
||||||
*
|
|
||||||
* @param records 记录列表
|
|
||||||
* @param start 当前分组的起始索引
|
|
||||||
* @param end 当前分组的结束索引
|
|
||||||
*/
|
|
||||||
private void processInnerGroup(List<ConfigServiceDirective> records, int start, int end) {
|
private void processInnerGroup(List<ConfigServiceDirective> records, int start, int end) {
|
||||||
int count = end - start + 1;
|
|
||||||
if (count > 1) {
|
|
||||||
records.get(start).setInstructionRowSpan(count);
|
|
||||||
// 将后续记录的instructionRowSpan置0
|
|
||||||
for (int i = start + 1; i <= end; i++) {
|
|
||||||
records.get(i).setInstructionRowSpan(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 处理一级categoryRowSpan(与之前保持一致)
|
|
||||||
private void processOuterGroup(List<ConfigServiceDirective> records, int start, int end) {
|
|
||||||
int count = end - start + 1;
|
|
||||||
if (count > 1) {
|
|
||||||
records.get(start).setCategoryRowSpan(count);
|
|
||||||
for (int i = start + 1; i <= end; i++) {
|
|
||||||
records.get(i).setCategoryRowSpan(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 处理二级typeRowSpan(与之前保持一致)
|
|
||||||
private void processTypeRowSpan(List<ConfigServiceDirective> records, int start, int end) {
|
|
||||||
int count = end - start + 1;
|
int count = end - start + 1;
|
||||||
if (count > 1) {
|
if (count > 1) {
|
||||||
records.get(start).setTypeRowSpan(count);
|
records.get(start).setTypeRowSpan(count);
|
||||||
|
@ -152,28 +109,36 @@ public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigService
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// 处理新一级instructionRowSpan
|
||||||
* 存储指令标签数据
|
private void processOuterGroup(List<ConfigServiceDirective> records, int start, int end) {
|
||||||
*
|
int count = end - start + 1;
|
||||||
* @param configServiceDirective
|
if (count > 1) {
|
||||||
*/
|
records.get(start).setInstructionRowSpan(count);
|
||||||
@Override
|
for (int i = start + 1; i <= end; i++) {
|
||||||
public void saveTags(ConfigServiceDirective configServiceDirective) {
|
records.get(i).setInstructionRowSpan(0);
|
||||||
baseMapper.deleteTags(configServiceDirective);
|
}
|
||||||
baseMapper.saveTags(configServiceDirective);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// 处理新二级categoryRowSpan
|
||||||
* 移除改服务指令下指令标签
|
private void processTypeRowSpan(List<ConfigServiceDirective> records, int start, int end) {
|
||||||
* @param configServiceDirective
|
int count = end - start + 1;
|
||||||
*/
|
if (count > 1) {
|
||||||
@Override
|
records.get(start).setCategoryRowSpan(count);
|
||||||
public void removeTags(ConfigServiceDirective configServiceDirective) {
|
for (int i = start + 1; i <= end; i++) {
|
||||||
baseMapper.deleteTags(configServiceDirective);
|
records.get(i).setCategoryRowSpan(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ConfigServiceDirective> queryDirectiveIdByTagIds(String tags) {
|
public List<ConfigServiceDirective> queryDirectiveIdByBodyTagIds(String tags) {
|
||||||
return baseMapper.queryDirectiveIdByTagIds(tags);
|
return baseMapper.queryDirectiveIdByBodyTagIds(tags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ConfigServiceDirective> queryDirectiveIdByEmotionTagIds(String tags) {
|
||||||
|
return baseMapper.queryDirectiveIdByEmotionTagIds(tags);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,9 @@ public class DirectiveMQExceptionHandler implements RabbitListenerErrorHandler {
|
||||||
// 根据异常类型选择处理策略
|
// 根据异常类型选择处理策略
|
||||||
if (isRetryable(e)) {
|
if (isRetryable(e)) {
|
||||||
// 可重试异常:抛出异常触发重试
|
// 可重试异常:抛出异常触发重试
|
||||||
throw e;
|
// throw e;
|
||||||
|
// 不进行重试:
|
||||||
|
throw new AmqpRejectAndDontRequeueException("消息处理失败且禁止重试", e);
|
||||||
} else {
|
} else {
|
||||||
// 不可恢复异常:拒绝消息且不重新入队
|
// 不可恢复异常:拒绝消息且不重新入队
|
||||||
throw new AmqpRejectAndDontRequeueException("消息处理失败且禁止重试", e);
|
throw new AmqpRejectAndDontRequeueException("消息处理失败且禁止重试", e);
|
||||||
|
|
|
@ -3,6 +3,7 @@ package org.jeecg.modules.system.controller;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
@ -38,6 +39,7 @@ import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.cache.annotation.CacheEvict;
|
import org.springframework.cache.annotation.CacheEvict;
|
||||||
|
@ -183,6 +185,24 @@ public class SysDictController {
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = "/getDictItems/{dictCode}", method = RequestMethod.GET)
|
@RequestMapping(value = "/getDictItems/{dictCode}", method = RequestMethod.GET)
|
||||||
public Result<List<DictModel>> getDictItems(@PathVariable("dictCode") String dictCode, @RequestParam(value = "sign",required = false) String sign,HttpServletRequest request) {
|
public Result<List<DictModel>> getDictItems(@PathVariable("dictCode") String dictCode, @RequestParam(value = "sign",required = false) String sign,HttpServletRequest request) {
|
||||||
|
return getListResult(dictCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取字典数据 【接口签名验证】
|
||||||
|
* @param dictCode 字典code
|
||||||
|
* @param dictCode 表名,文本字段,code字段 | 举例:sys_user,realname,id
|
||||||
|
* @param orgCode 机构编码
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/getDictItems/{dictCode}/{orgCode}", method = RequestMethod.GET)
|
||||||
|
@DS("#orgCode")
|
||||||
|
public Result<List<DictModel>> getDictItems(@PathVariable("dictCode") String dictCode,@PathVariable("orgCode") String orgCode, @RequestParam(value = "sign",required = false) String sign,HttpServletRequest request) {
|
||||||
|
return getListResult(dictCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private Result<List<DictModel>> getListResult(String dictCode) {
|
||||||
log.info(" dictCode : "+ dictCode);
|
log.info(" dictCode : "+ dictCode);
|
||||||
Result<List<DictModel>> result = new Result<List<DictModel>>();
|
Result<List<DictModel>> result = new Result<List<DictModel>>();
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue