服务指令同步(临时版本)
This commit is contained in:
parent
bbe90c7203
commit
4cbe3c689e
|
|
@ -0,0 +1,41 @@
|
||||||
|
package com.nu.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 体型标签
|
||||||
|
* @Author: 张明远
|
||||||
|
* @Date: 2025-07-25
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class BodyTagMQDto implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
/**
|
||||||
|
* 标签名称
|
||||||
|
*/
|
||||||
|
private String tagName;
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
private Integer sort;
|
||||||
|
/**
|
||||||
|
* 状态 0已授权 1未授权
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
/**
|
||||||
|
* 是否启用 0启用 1未启用
|
||||||
|
*/
|
||||||
|
private String izEnabled;
|
||||||
|
/**
|
||||||
|
* 是否删除 0未删除 1删除
|
||||||
|
*/
|
||||||
|
private String delFlag;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,45 @@
|
||||||
|
package com.nu.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 服务类别
|
||||||
|
* @Author: 张明远
|
||||||
|
* @Date: 2025-07-25
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CategoryMQDto implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
/**
|
||||||
|
* 分类标签id
|
||||||
|
*/
|
||||||
|
private String instructionId;
|
||||||
|
/**
|
||||||
|
* 服务类别名称
|
||||||
|
*/
|
||||||
|
private String categoryName;
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
private Integer sort;
|
||||||
|
/**
|
||||||
|
* 状态 0已授权 1未授权
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
/**
|
||||||
|
* 是否启用 0启用 1未启用
|
||||||
|
*/
|
||||||
|
private String izEnabled;
|
||||||
|
/**
|
||||||
|
* 是否删除 0未删除 1删除
|
||||||
|
*/
|
||||||
|
private String delFlag;
|
||||||
|
}
|
||||||
|
|
@ -3,6 +3,7 @@ package com.nu.dto;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 服务指令审核
|
* @Description: 服务指令审核
|
||||||
|
|
@ -134,4 +135,6 @@ public class DirectiveAsyncMQDto implements Serializable {
|
||||||
private String bodyTagsObj;
|
private String bodyTagsObj;
|
||||||
//情绪标签json字符串(有id、label)
|
//情绪标签json字符串(有id、label)
|
||||||
private String emotionTagsObj;
|
private String emotionTagsObj;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,4 +15,17 @@ public class DirectiveMQDto {
|
||||||
private String asyncId;
|
private String asyncId;
|
||||||
//同步子表code
|
//同步子表code
|
||||||
private String code;
|
private String code;
|
||||||
|
|
||||||
|
//指令集合
|
||||||
|
private List<DirectiveAsyncMQDto> directiveList;
|
||||||
|
//分类标签字典项
|
||||||
|
private List<InstructionTagMQDto> instructionList;
|
||||||
|
//服务类别字典项
|
||||||
|
private List<CategoryMQDto> categoryList;
|
||||||
|
//服务类型字典项
|
||||||
|
private List<DirectiveTypeMQDto> typeList;
|
||||||
|
//体型标签字典项
|
||||||
|
private List<BodyTagMQDto> bodyTagList;
|
||||||
|
//情绪标签字典项
|
||||||
|
private List<EmotionTagMQDto> emotionTagList;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,61 @@
|
||||||
|
package com.nu.dto;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 服务类型
|
||||||
|
* @Author: 张明远
|
||||||
|
* @Date: 2025-07-25
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DirectiveTypeMQDto implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
/**
|
||||||
|
* 分类标签id
|
||||||
|
*/
|
||||||
|
private String instructionId;
|
||||||
|
/**
|
||||||
|
* 服务类别id
|
||||||
|
*/
|
||||||
|
private String categoryId;
|
||||||
|
/**
|
||||||
|
* 服务类型名称
|
||||||
|
*/
|
||||||
|
private String typeName;
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
private Integer sort;
|
||||||
|
/**
|
||||||
|
* 状态 0已授权 1未授权
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
/**
|
||||||
|
* 是否启用 0启用 1未启用
|
||||||
|
*/
|
||||||
|
private String izEnabled;
|
||||||
|
/**
|
||||||
|
* 是否删除 0未删除 1删除
|
||||||
|
*/
|
||||||
|
private String delFlag;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
package com.nu.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 情绪标签
|
||||||
|
* @Author: 张明远
|
||||||
|
* @Date: 2025-07-25
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class EmotionTagMQDto implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
/**
|
||||||
|
* 标签名称
|
||||||
|
*/
|
||||||
|
private String tagName;
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
private Integer sort;
|
||||||
|
/**
|
||||||
|
* 状态 0已授权 1未授权
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
/**
|
||||||
|
* 是否启用 0启用 1未启用
|
||||||
|
*/
|
||||||
|
private String izEnabled;
|
||||||
|
/**
|
||||||
|
* 是否删除 0未删除 1删除
|
||||||
|
*/
|
||||||
|
private String delFlag;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.nu.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 服务指令-分类标签
|
||||||
|
* @Author: zmy
|
||||||
|
* @Date: 2025-07-25
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class InstructionTagMQDto implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**id*/
|
||||||
|
private String id;
|
||||||
|
/**分类标签名称*/
|
||||||
|
private String instructionName;
|
||||||
|
/**排序*/
|
||||||
|
private Integer sort;
|
||||||
|
/**状态 0已授权 1未授权*/
|
||||||
|
private String status;
|
||||||
|
/**是否启用 0启用 1未启用*/
|
||||||
|
private String izEnabled;
|
||||||
|
/**是否删除 0未删除 1删除*/
|
||||||
|
private String delFlag;
|
||||||
|
}
|
||||||
|
|
@ -9,13 +9,14 @@ import java.util.List;
|
||||||
/**
|
/**
|
||||||
* @Description: 体型标签
|
* @Description: 体型标签
|
||||||
* @Author: 张明远
|
* @Author: 张明远
|
||||||
* @Date: 2025-03-17
|
* @Date: 2025-03-17
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
public interface IDirectiveBodyTagService extends IService<DirectiveBodyTag> {
|
public interface IDirectiveBodyTagService extends IService<DirectiveBodyTag> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询数据是否已被使用
|
* 查询数据是否已被使用
|
||||||
|
*
|
||||||
* @param ids
|
* @param ids
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -23,11 +24,11 @@ public interface IDirectiveBodyTagService extends IService<DirectiveBodyTag> {
|
||||||
|
|
||||||
public void removeAllByDirectiveId(String directiveId);
|
public void removeAllByDirectiveId(String directiveId);
|
||||||
|
|
||||||
public List<DirectiveBodyTagRelation> selectAllRelation(String dataSourceCode, List<String> ids,List<String> excludeIds);
|
public List<DirectiveBodyTagRelation> selectAllRelation(String dataSourceCode, List<String> ids, List<String> excludeIds);
|
||||||
|
|
||||||
void insertAllRelation(List<DirectiveBodyTagRelation> relations);
|
void insertAllRelation(List<DirectiveBodyTagRelation> relations);
|
||||||
|
|
||||||
List<DirectiveBodyTag> selectAll(String dataSourceCode, List<String> ids,List<String> excludeIds);
|
List<DirectiveBodyTag> selectAll(List<String> ids, List<String> excludeIds);
|
||||||
|
|
||||||
void insertAll(List<DirectiveBodyTag> bodyAll);
|
void insertAll(List<DirectiveBodyTag> bodyAll);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,8 +50,8 @@ public class DirectiveBodyTagServiceImpl extends ServiceImpl<DirectiveBodyTagMap
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@DS("#dataSourceCode")
|
@DS("#dataSourceCode")
|
||||||
public List<DirectiveBodyTagRelation> selectAllRelation(String dataSourceCode, List<String> ids,List<String> excludeIds) {
|
public List<DirectiveBodyTagRelation> selectAllRelation(String dataSourceCode, List<String> ids, List<String> excludeIds) {
|
||||||
return tagRelationMapper.selectAllRelation(ids,excludeIds);
|
return tagRelationMapper.selectAllRelation(ids, excludeIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -62,9 +62,8 @@ public class DirectiveBodyTagServiceImpl extends ServiceImpl<DirectiveBodyTagMap
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@DS("#dataSourceCode")
|
public List<DirectiveBodyTag> selectAll(List<String> ids, List<String> excludeIds) {
|
||||||
public List<DirectiveBodyTag> selectAll(String dataSourceCode, List<String> ids,List<String> excludeIds) {
|
return baseMapper.selectAll(ids, excludeIds);
|
||||||
return baseMapper.selectAll(ids,excludeIds);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -9,13 +9,14 @@ import java.util.List;
|
||||||
/**
|
/**
|
||||||
* @Description: 情绪标签
|
* @Description: 情绪标签
|
||||||
* @Author: 张明远
|
* @Author: 张明远
|
||||||
* @Date: 2025-03-17
|
* @Date: 2025-03-17
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
public interface IDirectiveEmotionTagService extends IService<DirectiveEmotionTag> {
|
public interface IDirectiveEmotionTagService extends IService<DirectiveEmotionTag> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询数据是否已被使用
|
* 查询数据是否已被使用
|
||||||
|
*
|
||||||
* @param ids
|
* @param ids
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -23,11 +24,11 @@ public interface IDirectiveEmotionTagService extends IService<DirectiveEmotionTa
|
||||||
|
|
||||||
public void removeAllByDirectiveId(String directiveId);
|
public void removeAllByDirectiveId(String directiveId);
|
||||||
|
|
||||||
public List<DirectiveEmotionTagRelation> selectAllRelation(String dataSourceCode, List<String> ids,List<String> excludeIds);
|
public List<DirectiveEmotionTagRelation> selectAllRelation(String dataSourceCode, List<String> ids, List<String> excludeIds);
|
||||||
|
|
||||||
void insertAllRelation(List<DirectiveEmotionTagRelation> relations);
|
void insertAllRelation(List<DirectiveEmotionTagRelation> relations);
|
||||||
|
|
||||||
List<DirectiveEmotionTag> selectAll(String dataSourceCode, List<String> ids,List<String> excludeIds);
|
List<DirectiveEmotionTag> selectAll(List<String> ids, List<String> excludeIds);
|
||||||
|
|
||||||
void insertAll(List<DirectiveEmotionTag> emoRelations);
|
void insertAll(List<DirectiveEmotionTag> emoRelations);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -62,8 +62,7 @@ public class DirectiveEmotionTagServiceImpl extends ServiceImpl<DirectiveEmotion
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@DS("#dataSourceCode")
|
public List<DirectiveEmotionTag> selectAll(List<String> ids, List<String> excludeIds) {
|
||||||
public List<DirectiveEmotionTag> selectAll(String dataSourceCode, List<String> ids, List<String> excludeIds) {
|
|
||||||
return baseMapper.selectAll(ids, excludeIds);
|
return baseMapper.selectAll(ids, excludeIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ public interface IConfigServiceCategoryService extends IService<ConfigServiceCat
|
||||||
|
|
||||||
void removeAll();
|
void removeAll();
|
||||||
|
|
||||||
List<ConfigServiceCategory> selectAll(String dataSourceCode, List<String> ids, List<String> excludeSubIds);
|
List<ConfigServiceCategory> selectAll(List<String> ids, List<String> excludeSubIds);
|
||||||
|
|
||||||
void insertAll(List<ConfigServiceCategory> categoryList);
|
void insertAll(List<ConfigServiceCategory> categoryList);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -65,8 +65,7 @@ public class ConfigServiceCategoryServiceImpl extends ServiceImpl<ConfigServiceC
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@DS("#dataSourceCode")
|
public List<ConfigServiceCategory> selectAll(List<String> ids, List<String> excludeSubIds) {
|
||||||
public List<ConfigServiceCategory> selectAll(String dataSourceCode, List<String> ids, List<String> excludeSubIds) {
|
|
||||||
return baseMapper.selectAll(ids, excludeSubIds);
|
return baseMapper.selectAll(ids, excludeSubIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ 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.beust.jcommander.internal.Maps;
|
import com.beust.jcommander.internal.Maps;
|
||||||
import com.nu.dto.DirectiveAsyncMQDto;
|
import com.nu.dto.DirectiveAsyncMQDto;
|
||||||
|
import com.nu.modules.directivetag.body.service.IDirectiveBodyTagService;
|
||||||
import com.nu.modules.servicedirective.entity.ConfigServiceDirective;
|
import com.nu.modules.servicedirective.entity.ConfigServiceDirective;
|
||||||
import com.nu.modules.servicedirective.service.IConfigServiceDirectiveService;
|
import com.nu.modules.servicedirective.service.IConfigServiceDirectiveService;
|
||||||
import com.nu.utils.RabbitMQUtil;
|
import com.nu.utils.RabbitMQUtil;
|
||||||
|
|
@ -65,10 +66,7 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
||||||
//@AutoLog(value = "服务指令-分页列表查询")
|
//@AutoLog(value = "服务指令-分页列表查询")
|
||||||
@ApiOperation(value = "服务指令-分页列表查询", notes = "服务指令-分页列表查询")
|
@ApiOperation(value = "服务指令-分页列表查询", notes = "服务指令-分页列表查询")
|
||||||
@GetMapping(value = "/list")
|
@GetMapping(value = "/list")
|
||||||
public Result<IPage<ConfigServiceDirective>> queryPageList(ConfigServiceDirective configServiceDirective,
|
public Result<IPage<ConfigServiceDirective>> queryPageList(ConfigServiceDirective configServiceDirective, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
|
||||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
|
||||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
|
||||||
HttpServletRequest req) {
|
|
||||||
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);
|
||||||
|
|
@ -127,10 +125,7 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
||||||
@ApiOperation(value = "服务指令-分页列表查询", notes = "服务指令-分页列表查询")
|
@ApiOperation(value = "服务指令-分页列表查询", notes = "服务指令-分页列表查询")
|
||||||
@GetMapping(value = "/listByDS")
|
@GetMapping(value = "/listByDS")
|
||||||
@DS("#dataSourceCode")
|
@DS("#dataSourceCode")
|
||||||
public Result<IPage<ConfigServiceDirective>> queryPageListByDS(@RequestParam(name = "dataSourceCode") String dataSourceCode, ConfigServiceDirective configServiceDirective,
|
public Result<IPage<ConfigServiceDirective>> queryPageListByDS(@RequestParam(name = "dataSourceCode") String dataSourceCode, ConfigServiceDirective configServiceDirective, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
|
||||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
|
||||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
|
||||||
HttpServletRequest req) {
|
|
||||||
if (StringUtils.isBlank(dataSourceCode)) {
|
if (StringUtils.isBlank(dataSourceCode)) {
|
||||||
return Result.ok(new Page<ConfigServiceDirective>());
|
return Result.ok(new Page<ConfigServiceDirective>());
|
||||||
}
|
}
|
||||||
|
|
@ -167,13 +162,13 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//只查询已授权(status = 0)
|
//只查询已授权(status = 0)
|
||||||
if (StringUtils.isNotBlank(configServiceDirective.getStatus())) {
|
// if (StringUtils.isNotBlank(configServiceDirective.getStatus())) {
|
||||||
queryWrapper.in("status", configServiceDirective.getStatus().split(","));
|
// queryWrapper.in("status", configServiceDirective.getStatus().split(","));
|
||||||
} else {
|
// } else {
|
||||||
queryWrapper.in("status", new String[]{"0", "2"});
|
// queryWrapper.in("status", new String[]{"0", "2"});
|
||||||
}
|
// }
|
||||||
if(StringUtils.isNotBlank(configServiceDirective.getExcludeIds())){
|
if (StringUtils.isNotBlank(configServiceDirective.getExcludeIds())) {
|
||||||
queryWrapper.notIn("id",configServiceDirective.getExcludeIds().split(","));
|
queryWrapper.notIn("id", configServiceDirective.getExcludeIds().split(","));
|
||||||
}
|
}
|
||||||
Page<ConfigServiceDirective> page = new Page<ConfigServiceDirective>(pageNo, pageSize);
|
Page<ConfigServiceDirective> page = new Page<ConfigServiceDirective>(pageNo, pageSize);
|
||||||
IPage<ConfigServiceDirective> list = configServiceDirectiveService.page(page, queryWrapper);
|
IPage<ConfigServiceDirective> list = configServiceDirectiveService.page(page, queryWrapper);
|
||||||
|
|
@ -377,9 +372,7 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
||||||
BeanUtils.copyProperties(dto, directiveAsyncMQDto);
|
BeanUtils.copyProperties(dto, directiveAsyncMQDto);
|
||||||
|
|
||||||
List<JSONObject> orgList = sysBaseAPI.queryOpeDept();
|
List<JSONObject> orgList = sysBaseAPI.queryOpeDept();
|
||||||
List<String> codes = orgList.stream()
|
List<String> codes = orgList.stream().map(o -> o.getString("code")).collect(Collectors.toList());
|
||||||
.map(o -> o.getString("code"))
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
|
|
||||||
//启动线程,循环 codes, 5 分钟通知一个平台
|
//启动线程,循环 codes, 5 分钟通知一个平台
|
||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
|
|
@ -397,4 +390,16 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
||||||
|
|
||||||
return Result.OK(Maps.newHashMap());
|
return Result.OK(Maps.newHashMap());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@AutoLog(value = "服务指令-指令同步")
|
||||||
|
@ApiOperation(value = "服务指令-指令同步", notes = "服务指令-指令同步")
|
||||||
|
@GetMapping(value = "/syncDirective")
|
||||||
|
@DS("#dataSourceCode")
|
||||||
|
public Result<Map> syncDirective(@RequestParam(name = "dataSourceCode") String dataSourceCode, @RequestParam(name = "syncIds") String syncIds, @RequestParam(name = "syncOrgCodes") String syncOrgCodes) {
|
||||||
|
//服务指令
|
||||||
|
configServiceDirectiveService.syncDirective(syncIds, syncOrgCodes);
|
||||||
|
//发送消息
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -204,4 +204,8 @@ public class ConfigServiceDirective implements Serializable {
|
||||||
private String instructionTagName;
|
private String instructionTagName;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String excludeIds;//需要排除的ids
|
private String excludeIds;//需要排除的ids
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String syncIds;//需要同步的的指令id,逗号拼接
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String syncOrgCodes;//需要同步的指令的机构编码,逗号拼接
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -60,4 +60,7 @@ public interface IConfigServiceDirectiveService extends IService<ConfigServiceDi
|
||||||
void handleMediaFile(ConfigServiceDirective configServiceDirective);
|
void handleMediaFile(ConfigServiceDirective configServiceDirective);
|
||||||
|
|
||||||
void auditPass(ConfigServiceDirective dto);
|
void auditPass(ConfigServiceDirective dto);
|
||||||
|
|
||||||
|
//同步服务指令
|
||||||
|
void syncDirective(String syncIds, String syncOrgCodes);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,12 @@
|
||||||
package com.nu.modules.servicedirective.service.impl;
|
package com.nu.modules.servicedirective.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
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.dto.*;
|
||||||
import com.nu.modules.directivetag.body.entity.DirectiveBodyTag;
|
import com.nu.modules.directivetag.body.entity.DirectiveBodyTag;
|
||||||
import com.nu.modules.directivetag.body.service.IDirectiveBodyTagService;
|
import com.nu.modules.directivetag.body.service.IDirectiveBodyTagService;
|
||||||
import com.nu.modules.directivetag.emotion.entity.DirectiveEmotionTag;
|
import com.nu.modules.directivetag.emotion.entity.DirectiveEmotionTag;
|
||||||
|
|
@ -19,6 +21,8 @@ import com.nu.modules.servicedirective.service.IConfigServiceDirectiveService;
|
||||||
import com.nu.modules.servicetype.entity.ConfigServiceType;
|
import com.nu.modules.servicetype.entity.ConfigServiceType;
|
||||||
import com.nu.modules.servicetype.service.IConfigServiceTypeService;
|
import com.nu.modules.servicetype.service.IConfigServiceTypeService;
|
||||||
import com.nu.modules.sysconfig.ISysConfigApi;
|
import com.nu.modules.sysconfig.ISysConfigApi;
|
||||||
|
import com.nu.utils.RabbitMQUtil;
|
||||||
|
import org.apache.commons.compress.utils.Lists;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -63,6 +67,8 @@ public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigService
|
||||||
@Lazy
|
@Lazy
|
||||||
@Autowired
|
@Autowired
|
||||||
private IDirectiveEmotionTagService emotionTagService;
|
private IDirectiveEmotionTagService emotionTagService;
|
||||||
|
@Autowired
|
||||||
|
private RabbitMQUtil rabbitMQUtil;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ConfigServiceDirective> pageList(ConfigServiceDirective configServiceDirective, IPage<ConfigServiceDirective> list_) {
|
public List<ConfigServiceDirective> pageList(ConfigServiceDirective configServiceDirective, IPage<ConfigServiceDirective> list_) {
|
||||||
|
|
@ -297,44 +303,44 @@ public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigService
|
||||||
|
|
||||||
//分类标签
|
//分类标签
|
||||||
UpdateWrapper<InstructionTag> instruUW = new UpdateWrapper<>();
|
UpdateWrapper<InstructionTag> instruUW = new UpdateWrapper<>();
|
||||||
instruUW.eq("id",dto.getInstructionTagId());
|
instruUW.eq("id", dto.getInstructionTagId());
|
||||||
instruUW.eq("status","1");
|
instruUW.eq("status", "1");
|
||||||
InstructionTag instructionTag = new InstructionTag();
|
InstructionTag instructionTag = new InstructionTag();
|
||||||
instructionTag.setStatus("0");
|
instructionTag.setStatus("0");
|
||||||
instructionTagService.update(instructionTag,instruUW);
|
instructionTagService.update(instructionTag, instruUW);
|
||||||
//服务类别
|
//服务类别
|
||||||
UpdateWrapper<ConfigServiceCategory> categoryUW = new UpdateWrapper<>();
|
UpdateWrapper<ConfigServiceCategory> categoryUW = new UpdateWrapper<>();
|
||||||
categoryUW.eq("id",dto.getCategoryId());
|
categoryUW.eq("id", dto.getCategoryId());
|
||||||
categoryUW.eq("status","1");
|
categoryUW.eq("status", "1");
|
||||||
ConfigServiceCategory category = new ConfigServiceCategory();
|
ConfigServiceCategory category = new ConfigServiceCategory();
|
||||||
category.setStatus("0");
|
category.setStatus("0");
|
||||||
categoryService.update(category,categoryUW);
|
categoryService.update(category, categoryUW);
|
||||||
//服务类型
|
//服务类型
|
||||||
UpdateWrapper<ConfigServiceType> typeUW = new UpdateWrapper<>();
|
UpdateWrapper<ConfigServiceType> typeUW = new UpdateWrapper<>();
|
||||||
typeUW.eq("id",dto.getTypeId());
|
typeUW.eq("id", dto.getTypeId());
|
||||||
typeUW.eq("status","1");
|
typeUW.eq("status", "1");
|
||||||
ConfigServiceType type = new ConfigServiceType();
|
ConfigServiceType type = new ConfigServiceType();
|
||||||
type.setStatus("0");
|
type.setStatus("0");
|
||||||
typeService.update(type,typeUW);
|
typeService.update(type, typeUW);
|
||||||
//体型标签
|
//体型标签
|
||||||
List<String> bodyTags = Arrays.asList(dto.getBodyTags().split(","));
|
List<String> bodyTags = Arrays.asList(dto.getBodyTags().split(","));
|
||||||
bodyTags.stream().forEach(b -> {
|
bodyTags.stream().forEach(b -> {
|
||||||
UpdateWrapper<DirectiveBodyTag> bodyTagUW = new UpdateWrapper<>();
|
UpdateWrapper<DirectiveBodyTag> bodyTagUW = new UpdateWrapper<>();
|
||||||
bodyTagUW.eq("id",b);
|
bodyTagUW.eq("id", b);
|
||||||
bodyTagUW.eq("status","1");
|
bodyTagUW.eq("status", "1");
|
||||||
DirectiveBodyTag bodyTag = new DirectiveBodyTag();
|
DirectiveBodyTag bodyTag = new DirectiveBodyTag();
|
||||||
bodyTag.setStatus("0");
|
bodyTag.setStatus("0");
|
||||||
bodyTagService.update(bodyTag,bodyTagUW);
|
bodyTagService.update(bodyTag, bodyTagUW);
|
||||||
});
|
});
|
||||||
//情绪标签
|
//情绪标签
|
||||||
List<String> emotionTags = Arrays.asList(dto.getEmotionTags().split(","));
|
List<String> emotionTags = Arrays.asList(dto.getEmotionTags().split(","));
|
||||||
emotionTags.stream().forEach(b -> {
|
emotionTags.stream().forEach(b -> {
|
||||||
UpdateWrapper<DirectiveEmotionTag> emotionTagUW = new UpdateWrapper<>();
|
UpdateWrapper<DirectiveEmotionTag> emotionTagUW = new UpdateWrapper<>();
|
||||||
emotionTagUW.eq("id",b);
|
emotionTagUW.eq("id", b);
|
||||||
emotionTagUW.eq("status","1");
|
emotionTagUW.eq("status", "1");
|
||||||
DirectiveEmotionTag emotionTag = new DirectiveEmotionTag();
|
DirectiveEmotionTag emotionTag = new DirectiveEmotionTag();
|
||||||
emotionTag.setStatus("0");
|
emotionTag.setStatus("0");
|
||||||
emotionTagService.update(emotionTag,emotionTagUW);
|
emotionTagService.update(emotionTag, emotionTagUW);
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -394,4 +400,69 @@ public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigService
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param syncIds 需要同步的指令ID
|
||||||
|
* @param syncOrgCodes 需要同步的目标平台orgCode
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void syncDirective(String syncIds, String syncOrgCodes) {
|
||||||
|
DirectiveMQDto directiveMQDto = new DirectiveMQDto();
|
||||||
|
List<ConfigServiceDirective> directives;
|
||||||
|
List<String> directiveIds = Arrays.asList(syncIds.split(","));
|
||||||
|
{
|
||||||
|
List<ConfigServiceDirective> param = Lists.newArrayList();
|
||||||
|
Arrays.stream(syncIds.split(",")).forEach(id -> {
|
||||||
|
ConfigServiceDirective configServiceDirective = new ConfigServiceDirective();
|
||||||
|
configServiceDirective.setId(id);
|
||||||
|
param.add(configServiceDirective);
|
||||||
|
});
|
||||||
|
directives = baseMapper.pageList(null, param);
|
||||||
|
if (directives != null && !directives.isEmpty()) {
|
||||||
|
directives.stream().forEach(record -> {
|
||||||
|
List<DirectiveBodyTag> bodyTagList = record.getBodyTagList();
|
||||||
|
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(",")));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
directiveMQDto.setDirectiveList(BeanUtil.copyToList(directives, DirectiveAsyncMQDto.class));
|
||||||
|
}
|
||||||
|
//分类标签
|
||||||
|
{
|
||||||
|
List<String> instructionTagIds = directives.stream().map(ConfigServiceDirective::getInstructionTagId).filter(instructionTagId -> instructionTagId != null && !instructionTagId.isEmpty()).distinct().collect(Collectors.toList());
|
||||||
|
QueryWrapper<InstructionTag> qw = new QueryWrapper<>();
|
||||||
|
qw.in("id", instructionTagIds);
|
||||||
|
List<InstructionTag> list = instructionTagService.list(qw);
|
||||||
|
directiveMQDto.setInstructionList(BeanUtil.copyToList(list, InstructionTagMQDto.class));
|
||||||
|
}
|
||||||
|
//服务类别
|
||||||
|
{
|
||||||
|
List<String> categoryIds = directives.stream().map(ConfigServiceDirective::getCategoryId).filter(categoryId -> categoryId != null && !categoryId.isEmpty()).distinct().collect(Collectors.toList());
|
||||||
|
QueryWrapper<ConfigServiceCategory> qw = new QueryWrapper<>();
|
||||||
|
qw.in("id", categoryIds);
|
||||||
|
List<ConfigServiceCategory> list = categoryService.list(qw);
|
||||||
|
directiveMQDto.setCategoryList(BeanUtil.copyToList(list, CategoryMQDto.class));
|
||||||
|
}
|
||||||
|
//服务类型
|
||||||
|
{
|
||||||
|
List<String> typeIds = directives.stream().map(ConfigServiceDirective::getTypeId).filter(typeId -> typeId != null && !typeId.isEmpty()).distinct().collect(Collectors.toList());
|
||||||
|
QueryWrapper<ConfigServiceType> qw = new QueryWrapper<>();
|
||||||
|
qw.in("id", typeIds);
|
||||||
|
List<ConfigServiceType> list = typeService.list(qw);
|
||||||
|
directiveMQDto.setTypeList(BeanUtil.copyToList(list, DirectiveTypeMQDto.class));
|
||||||
|
}
|
||||||
|
//体型标签
|
||||||
|
{
|
||||||
|
directiveMQDto.setBodyTagList(BeanUtil.copyToList(bodyTagService.selectAll(directiveIds, null), BodyTagMQDto.class));
|
||||||
|
}
|
||||||
|
//情绪标签
|
||||||
|
{
|
||||||
|
directiveMQDto.setEmotionTagList(BeanUtil.copyToList(emotionTagService.selectAll(directiveIds, null), EmotionTagMQDto.class));
|
||||||
|
}
|
||||||
|
//给对应业务平台发送消息
|
||||||
|
Arrays.stream(syncOrgCodes.split(",")).forEach(orgCode -> {
|
||||||
|
// rabbitMQUtil.sendToExchange("hldy.directive", orgCode + ".directive.syncDirective", directiveMQDto);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue