Compare commits
2 Commits
4f3bde6f95
...
917a089c37
Author | SHA1 | Date |
---|---|---|
|
917a089c37 | |
|
403aa99533 |
|
@ -1,11 +1,8 @@
|
|||
package com.nu.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令审核
|
||||
|
@ -15,74 +12,74 @@ import java.util.Map;
|
|||
*/
|
||||
@Data
|
||||
public class DirectiveAsyncMQDto implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
/**id*/
|
||||
private String id;
|
||||
/**服务类别id*/
|
||||
/**服务类别id*/
|
||||
private String categoryId;
|
||||
/**服务类型id*/
|
||||
/**服务类型id*/
|
||||
private String typeId;
|
||||
/**分类标签*/
|
||||
/**分类标签*/
|
||||
private String instructionTagId;
|
||||
/**服务指令名称*/
|
||||
/**服务指令名称*/
|
||||
private String directiveName;
|
||||
/**收费价格*/
|
||||
/**收费价格*/
|
||||
private java.math.BigDecimal tollPrice;
|
||||
/**提成价格*/
|
||||
/**提成价格*/
|
||||
private java.math.BigDecimal comPrice;
|
||||
/**是否参与医保报销 0不报销 1报销*/
|
||||
/**是否参与医保报销 0不报销 1报销*/
|
||||
private String izReimbursement;
|
||||
/**是否参与机构优惠 0不参与 1参与*/
|
||||
/**是否参与机构优惠 0不参与 1参与*/
|
||||
private String izPreferential;
|
||||
/**收费频次 1按次收费 2按天收费*/
|
||||
/**收费频次 1按次收费 2按天收费*/
|
||||
private String chargingFrequency;
|
||||
/**周期类型 1日常护理 2周期护理 3即时护理*/
|
||||
/**周期类型 1日常护理 2周期护理 3即时护理*/
|
||||
private String cycleType;
|
||||
/**排序*/
|
||||
/**排序*/
|
||||
private Integer sort;
|
||||
/**服务描述*/
|
||||
/**服务描述*/
|
||||
private String serviceContent;
|
||||
/**服务时长(分钟)*/
|
||||
/**服务时长(分钟)*/
|
||||
private String serviceDuration;
|
||||
/**是否启用 0启用 1未启用*/
|
||||
/**指令状态*/
|
||||
private String status;
|
||||
/**是否启用 0启用 1未启用*/
|
||||
private String izEnabled;
|
||||
/**是否删除*/
|
||||
/**是否删除*/
|
||||
private String delFlag;
|
||||
/**创建人*/
|
||||
/**创建人*/
|
||||
private String createBy;
|
||||
/**创建日期*/
|
||||
/**创建日期*/
|
||||
private java.util.Date createTime;
|
||||
/**更新人*/
|
||||
/**更新人*/
|
||||
private String updateBy;
|
||||
/**更新日期*/
|
||||
/**更新日期*/
|
||||
private java.util.Date updateTime;
|
||||
/**所属部门*/
|
||||
/**所属部门*/
|
||||
private String sysOrgCode;
|
||||
/**指令音频文件*/
|
||||
/**指令音频文件*/
|
||||
private String mp3File;
|
||||
/**指令视频文件*/
|
||||
/**指令视频文件*/
|
||||
private String mp4File;
|
||||
/**服务指令图片*/
|
||||
private String previewFile;
|
||||
/**即时指令图标*/
|
||||
private String immediateFile;
|
||||
|
||||
//体型标签
|
||||
List<Map<String,String>> bodyTagList;
|
||||
//情绪标签
|
||||
List<Map<String,String>> emotionTagList;
|
||||
|
||||
//分类标签中文名称
|
||||
@TableField(exist = false)
|
||||
private String instructionName;
|
||||
//服务类别中文名称
|
||||
@TableField(exist = false)
|
||||
private String categoryName;
|
||||
//服务类型中文名称
|
||||
@TableField(exist = false)
|
||||
private String typeName;
|
||||
//周期类型中文名称
|
||||
@TableField(exist = false)
|
||||
private String cycleTypeName;
|
||||
//体型标签id,id,id
|
||||
private String bodyTags;
|
||||
//情绪标签id,id,id
|
||||
private String emotionTags;
|
||||
//体型标签json字符串(有id、label)
|
||||
private String bodyTagsObj;
|
||||
//情绪标签json字符串(有id、label)
|
||||
private String emotionTagsObj;
|
||||
}
|
||||
|
|
|
@ -42,6 +42,11 @@ public class DirectiveBodyTag implements Serializable {
|
|||
@Excel(name = "排序", width = 15)
|
||||
@ApiModelProperty(value = "排序")
|
||||
private Integer sort;
|
||||
/**状态 0已授权 1未授权*/
|
||||
@Excel(name = "状态 0已授权 1未授权", width = 15)
|
||||
@ApiModelProperty(value = "状态 0已授权 1未授权")
|
||||
@Dict(dicCode = "status")
|
||||
private java.lang.String status;
|
||||
/**是否启用 0启用 1未启用*/
|
||||
@Excel(name = "是否启用", width = 15, dicCode = "iz_enabled")
|
||||
@Dict(dicCode = "iz_enabled")
|
||||
|
|
|
@ -42,6 +42,11 @@ public class DirectiveEmotionTag implements Serializable {
|
|||
@Excel(name = "排序", width = 15)
|
||||
@ApiModelProperty(value = "排序")
|
||||
private java.lang.Integer sort;
|
||||
/**状态 0已授权 1未授权*/
|
||||
@Excel(name = "状态 0已授权 1未授权", width = 15)
|
||||
@ApiModelProperty(value = "状态 0已授权 1未授权")
|
||||
@Dict(dicCode = "status")
|
||||
private java.lang.String status;
|
||||
/**是否启用 0启用 1未启用*/
|
||||
@Excel(name = "是否启用", width = 15, dicCode = "iz_enabled")
|
||||
@Dict(dicCode = "iz_enabled")
|
||||
|
|
|
@ -46,6 +46,11 @@ public class InstructionTag implements Serializable {
|
|||
@Excel(name = "排序", width = 15)
|
||||
@ApiModelProperty(value = "排序")
|
||||
private java.lang.Integer sort;
|
||||
/**状态 0已授权 1未授权*/
|
||||
@Excel(name = "状态 0已授权 1未授权", width = 15)
|
||||
@ApiModelProperty(value = "状态 0已授权 1未授权")
|
||||
@Dict(dicCode = "status")
|
||||
private java.lang.String status;
|
||||
/**是否启用 0启用 1未启用*/
|
||||
@Excel(name = "是否启用", width = 15)
|
||||
@ApiModelProperty(value = "是否启用")
|
||||
|
|
|
@ -47,6 +47,11 @@ public class ConfigServiceCategory implements Serializable {
|
|||
@Excel(name = "排序", width = 15)
|
||||
@ApiModelProperty(value = "排序")
|
||||
private java.lang.Integer sort;
|
||||
/**状态 0已授权 1未授权*/
|
||||
@Excel(name = "状态 0已授权 1未授权", width = 15)
|
||||
@ApiModelProperty(value = "状态 0已授权 1未授权")
|
||||
@Dict(dicCode = "status")
|
||||
private java.lang.String status;
|
||||
/**是否启用 0启用 1未启用*/
|
||||
@Excel(name = "是否启用", width = 15)
|
||||
@ApiModelProperty(value = "是否启用")
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
|
|||
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.dto.DirectiveAsyncMQDto;
|
||||
import com.nu.modules.servicedirective.entity.ConfigServiceDirective;
|
||||
import com.nu.modules.servicedirective.service.IConfigServiceDirectiveService;
|
||||
import com.nu.modules.sysconfig.ISysConfigApi;
|
||||
|
@ -16,9 +17,11 @@ import org.apache.commons.lang.StringUtils;
|
|||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
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.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
@ -46,6 +49,8 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
|||
private IConfigServiceDirectiveService configServiceDirectiveService;
|
||||
@Autowired
|
||||
private RabbitMQUtil rabbitMQUtil;
|
||||
@Autowired
|
||||
private ISysBaseAPI sysBaseAPI;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
|
@ -112,10 +117,13 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
|||
@ApiOperation(value = "服务指令-添加", notes = "服务指令-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody ConfigServiceDirective configServiceDirective) {
|
||||
//存储机构编码
|
||||
JSONObject deptInfo = sysBaseAPI.getDeptInfo();
|
||||
configServiceDirective.setSysOrgCode(deptInfo.getString("code"));
|
||||
//设置为“未授权”
|
||||
configServiceDirective.setStatus("1");
|
||||
//业务平台添加时无媒体资源 处理媒体资源(放在保存方法之前)
|
||||
// configServiceDirectiveService.handleMediaFile(configServiceDirective);
|
||||
//业务平台创建的数据初始状态为“未授权” iz_enabled = 2
|
||||
configServiceDirective.setIzEnabled("2");
|
||||
configServiceDirectiveService.save(configServiceDirective);
|
||||
if (StringUtils.isNotBlank(configServiceDirective.getBodyTags())) {
|
||||
configServiceDirectiveService.saveBodyTags(configServiceDirective);
|
||||
|
@ -130,7 +138,12 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
|||
}
|
||||
|
||||
//同步给管理平台
|
||||
// rabbitMQUtil.sendToExchange("hldy.directive.add", "hldy.directive.add", null);
|
||||
{
|
||||
DirectiveAsyncMQDto directiveAsyncMQDto = new DirectiveAsyncMQDto();
|
||||
BeanUtils.copyProperties(configServiceDirective, directiveAsyncMQDto);
|
||||
rabbitMQUtil.sendToExchange("hldy.directive", "hldy.directive.audit", directiveAsyncMQDto);
|
||||
}
|
||||
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
|
@ -159,6 +172,13 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
|||
configServiceDirectiveService.removeEmotionTags(configServiceDirective);
|
||||
}
|
||||
|
||||
//如果是未授权 则同步给管理平台进行更新
|
||||
if("1".equals(configServiceDirective.getStatus())){
|
||||
DirectiveAsyncMQDto directiveAsyncMQDto = new DirectiveAsyncMQDto();
|
||||
BeanUtils.copyProperties(configServiceDirective, directiveAsyncMQDto);
|
||||
rabbitMQUtil.sendToExchange("hldy.directive", "hldy.directive.audit", directiveAsyncMQDto);
|
||||
}
|
||||
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
|
|
|
@ -93,10 +93,15 @@ public class ConfigServiceDirective implements Serializable {
|
|||
@Excel(name = "服务时长(分钟)", width = 15)
|
||||
@ApiModelProperty(value = "服务时长(分钟)")
|
||||
private java.lang.String serviceDuration;
|
||||
/**指令状态*/
|
||||
@Excel(name = "指令状态", width = 15)
|
||||
@ApiModelProperty(value = "指令状态")
|
||||
@Dict(dicCode = "directive_status")
|
||||
private java.lang.String status;
|
||||
/**是否启用 0启用 1未启用*/
|
||||
@Excel(name = "是否启用", width = 15)
|
||||
@ApiModelProperty(value = "是否启用")
|
||||
@Dict(dicCode = "directive_status")
|
||||
@Dict(dicCode = "iz_enabled")
|
||||
private java.lang.String izEnabled;
|
||||
/**是否删除*/
|
||||
@Excel(name = "是否删除", width = 15)
|
||||
|
@ -193,6 +198,12 @@ public class ConfigServiceDirective implements Serializable {
|
|||
//媒体资源存储路径名
|
||||
@TableField(exist = false)
|
||||
private String mediaFileSavePath;
|
||||
//体型标签json字符串(前台封装好的 有id、label)
|
||||
@TableField(exist = false)
|
||||
private String bodyTagsObj;
|
||||
//情绪标签json字符串(前台封装好的 有id、label)
|
||||
@TableField(exist = false)
|
||||
private String emotionTagsObj;
|
||||
//护理分类名称
|
||||
@TableField(exist = false)
|
||||
private String instructionTagName;
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
<result property="sort" column="sort"/>
|
||||
<result property="serviceContent" column="service_content"/>
|
||||
<result property="serviceDuration" column="service_duration"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="izEnabled" column="iz_enabled"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
|
@ -59,6 +60,7 @@
|
|||
c.sort,
|
||||
c.service_content,
|
||||
c.service_duration,
|
||||
c.status,
|
||||
c.iz_enabled,
|
||||
c.del_flag,
|
||||
c.create_by,
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package com.nu.modules.servicedirective.service;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.nu.dto.DirectiveAsyncMQDto;
|
||||
import com.nu.modules.servicedirective.entity.ConfigServiceDirective;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -58,4 +58,6 @@ public interface IConfigServiceDirectiveService extends IService<ConfigServiceDi
|
|||
void insertAllDirectives(List<ConfigServiceDirective> directives);
|
||||
|
||||
void handleMediaFile(ConfigServiceDirective configServiceDirective);
|
||||
|
||||
void auditPass(DirectiveAsyncMQDto dto);
|
||||
}
|
||||
|
|
|
@ -2,23 +2,36 @@ package com.nu.modules.servicedirective.service.impl;
|
|||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.dto.DirectiveAsyncMQDto;
|
||||
import com.nu.modules.directivetag.body.entity.DirectiveBodyTag;
|
||||
import com.nu.modules.directivetag.body.service.IDirectiveBodyTagService;
|
||||
import com.nu.modules.directivetag.emotion.entity.DirectiveEmotionTag;
|
||||
import com.nu.modules.directivetag.emotion.service.IDirectiveEmotionTagService;
|
||||
import com.nu.modules.instructiontag.entity.InstructionTag;
|
||||
import com.nu.modules.instructiontag.service.IInstructionTagService;
|
||||
import com.nu.modules.servicecategory.entity.ConfigServiceCategory;
|
||||
import com.nu.modules.servicecategory.service.IConfigServiceCategoryService;
|
||||
import com.nu.modules.servicedirective.entity.ConfigServiceDirective;
|
||||
import com.nu.modules.servicedirective.mapper.ConfigServiceDirectiveMapper;
|
||||
import com.nu.modules.servicedirective.service.IConfigServiceDirectiveService;
|
||||
import com.nu.modules.servicetype.entity.ConfigServiceType;
|
||||
import com.nu.modules.servicetype.service.IConfigServiceTypeService;
|
||||
import com.nu.modules.sysconfig.ISysConfigApi;
|
||||
import com.nu.utils.RabbitMQUtil;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Files;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
@ -40,6 +53,21 @@ public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigService
|
|||
private ISysBaseAPI sysBaseAPI;
|
||||
@Autowired
|
||||
private RabbitMQUtil rabbitMQUtil;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private IInstructionTagService instructionTagService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private IConfigServiceCategoryService categoryService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private IConfigServiceTypeService typeService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private IDirectiveBodyTagService bodyTagService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private IDirectiveEmotionTagService emotionTagService;
|
||||
|
||||
@Override
|
||||
public List<ConfigServiceDirective> pageList(ConfigServiceDirective configServiceDirective, IPage<ConfigServiceDirective> list_) {
|
||||
|
@ -270,9 +298,10 @@ public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigService
|
|||
|
||||
/**
|
||||
* 处理单个文件,检查路径是否需要迁移
|
||||
* @param basePath 基础路径
|
||||
*
|
||||
* @param basePath 基础路径
|
||||
* @param targetDir 目标目录
|
||||
* @param filePath 文件路径
|
||||
* @param filePath 文件路径
|
||||
* @return 如果路径有变化返回新路径,否则返回null
|
||||
*/
|
||||
private String processFile(String basePath, String targetDir, String filePath) {
|
||||
|
@ -322,4 +351,50 @@ public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigService
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void auditPass(DirectiveAsyncMQDto dto) {
|
||||
//将相应字典项改为已授权
|
||||
|
||||
//分类标签
|
||||
UpdateWrapper<InstructionTag> instruUW = new UpdateWrapper<>();
|
||||
instruUW.eq("id", dto.getInstructionTagId());
|
||||
instruUW.eq("status", "1");
|
||||
InstructionTag instructionTag = new InstructionTag();
|
||||
instructionTag.setStatus("0");
|
||||
instructionTagService.update(instructionTag, instruUW);
|
||||
//服务类别
|
||||
UpdateWrapper<ConfigServiceCategory> categoryUW = new UpdateWrapper<>();
|
||||
categoryUW.eq("id", dto.getCategoryId());
|
||||
categoryUW.eq("status", "1");
|
||||
ConfigServiceCategory category = new ConfigServiceCategory();
|
||||
category.setStatus("0");
|
||||
categoryService.update(category, categoryUW);
|
||||
//服务类型
|
||||
UpdateWrapper<ConfigServiceType> typeUW = new UpdateWrapper<>();
|
||||
typeUW.eq("id", dto.getTypeId());
|
||||
typeUW.eq("status", "1");
|
||||
ConfigServiceType type = new ConfigServiceType();
|
||||
type.setStatus("0");
|
||||
typeService.update(type, typeUW);
|
||||
//体型标签
|
||||
List<String> bodyTags = Arrays.asList(dto.getBodyTags().split(","));
|
||||
bodyTags.stream().forEach(b -> {
|
||||
UpdateWrapper<DirectiveBodyTag> bodyTagUW = new UpdateWrapper<>();
|
||||
bodyTagUW.eq("id", b);
|
||||
bodyTagUW.eq("status", "1");
|
||||
DirectiveBodyTag bodyTag = new DirectiveBodyTag();
|
||||
bodyTag.setStatus("0");
|
||||
bodyTagService.update(bodyTag, bodyTagUW);
|
||||
});
|
||||
//情绪标签
|
||||
List<String> emotionTags = Arrays.asList(dto.getEmotionTags().split(","));
|
||||
emotionTags.stream().forEach(b -> {
|
||||
UpdateWrapper<DirectiveEmotionTag> emotionTagUW = new UpdateWrapper<>();
|
||||
emotionTagUW.eq("id", b);
|
||||
emotionTagUW.eq("status", "1");
|
||||
DirectiveEmotionTag emotionTag = new DirectiveEmotionTag();
|
||||
emotionTag.setStatus("0");
|
||||
emotionTagService.update(emotionTag, emotionTagUW);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,6 +52,11 @@ public class ConfigServiceType implements Serializable {
|
|||
@Excel(name = "排序", width = 15)
|
||||
@ApiModelProperty(value = "排序")
|
||||
private java.lang.Integer sort;
|
||||
/**状态 0已授权 1未授权*/
|
||||
@Excel(name = "状态 0已授权 1未授权", width = 15)
|
||||
@ApiModelProperty(value = "状态 0已授权 1未授权")
|
||||
@Dict(dicCode = "status")
|
||||
private java.lang.String status;
|
||||
/**是否启用 0启用 1未启用*/
|
||||
@Excel(name = "是否启用", width = 15)
|
||||
@ApiModelProperty(value = "是否启用")
|
||||
|
|
|
@ -1,6 +1,15 @@
|
|||
package com.nu.mq.directive.listener;
|
||||
|
||||
import com.nu.dto.DirectiveAsyncMQDto;
|
||||
import com.nu.modules.servicedirective.entity.ConfigServiceDirective;
|
||||
import com.nu.modules.servicedirective.service.IConfigServiceDirectiveService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.amqp.core.ExchangeTypes;
|
||||
import org.springframework.amqp.rabbit.annotation.Exchange;
|
||||
import org.springframework.amqp.rabbit.annotation.Queue;
|
||||
import org.springframework.amqp.rabbit.annotation.QueueBinding;
|
||||
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Slf4j
|
||||
|
@ -18,8 +27,8 @@ public class DirectiveMQListener {
|
|||
// private ISysConfigService sysConfigService;
|
||||
// @Autowired
|
||||
// private IMediaAsyncErrorLogService mediaAsyncErrorLogService;
|
||||
// @Autowired
|
||||
// private IConfigServiceDirectiveService directiveService;
|
||||
@Autowired
|
||||
private IConfigServiceDirectiveService directiveService;
|
||||
// @Autowired
|
||||
// private IDirectiveBodyTagService bodyTagService;
|
||||
// @Autowired
|
||||
|
@ -30,7 +39,25 @@ public class DirectiveMQListener {
|
|||
// private IConfigServiceTypeService serviceTypeService;
|
||||
// @Autowired
|
||||
// private RabbitMQUtil rabbitMQUtil;
|
||||
//
|
||||
|
||||
@RabbitListener(
|
||||
bindings = @QueueBinding(
|
||||
value = @Queue(name = "#{directiveAsyncDQNP.getAuditResultQueueName()}"),
|
||||
exchange = @Exchange(name = "hldy.directive", type = ExchangeTypes.DIRECT),
|
||||
key = "#{directiveAsyncDQNP.getAuditResultKeyName()}"
|
||||
),
|
||||
errorHandler = "directiveMQErrorHandler"
|
||||
)
|
||||
public void handleMessage(DirectiveAsyncMQDto dto) {
|
||||
//将字典项更新为已授权
|
||||
directiveService.auditPass(dto);
|
||||
//更新服务指令状态
|
||||
ConfigServiceDirective configServiceDirective = new ConfigServiceDirective();
|
||||
configServiceDirective.setId(dto.getId());
|
||||
configServiceDirective.setStatus(dto.getStatus());
|
||||
directiveService.updateById(configServiceDirective);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * if 未到运营开始时间时 全量变更
|
||||
// * else 增量
|
||||
|
|
|
@ -25,4 +25,18 @@ public class DynamicQueueNameProvider {
|
|||
public String getKeyName() {
|
||||
return getQueueName();
|
||||
}
|
||||
|
||||
public String getAuditResultQueueName() {
|
||||
JSONObject deptInfo = sysBaseAPI.getDeptInfo();
|
||||
String orgCode = deptInfo.getString("code");
|
||||
if (StringUtils.isNotBlank(orgCode)) {
|
||||
return orgCode + ".directive.auditresult";
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public String getAuditResultKeyName() {
|
||||
return getAuditResultQueueName();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue