服务指令-指令库
This commit is contained in:
parent
fe39e1d0c1
commit
f6313df57a
|
|
@ -10,4 +10,6 @@ public interface ISysConfigApi {
|
|||
* @return
|
||||
*/
|
||||
public Object querySysConfigByKey(String key);
|
||||
|
||||
void asyncApi(SysConfigEntity entity);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,72 @@
|
|||
package com.nu.modules.sysconfig;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
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;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description: 系统参数配置
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-8-1
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
public class SysConfigEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 参数名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 键名
|
||||
*/
|
||||
private String configKey;
|
||||
/**
|
||||
* 键值
|
||||
*/
|
||||
private String configValue;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String descr;
|
||||
/**
|
||||
* 是否启用 0启用 1未启用
|
||||
*/
|
||||
private String izEnabled;
|
||||
/**
|
||||
* 是否删除 0未删除 1删除
|
||||
*/
|
||||
private String delFlag;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createBy;
|
||||
/**
|
||||
* 创建日期
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private String updateBy;
|
||||
/**
|
||||
* 更新日期
|
||||
*/
|
||||
private Date updateTime;
|
||||
private String orgCode;
|
||||
}
|
||||
|
|
@ -35,6 +35,10 @@ public class OrgAllInfo implements Serializable {
|
|||
* 协议+域名
|
||||
*/
|
||||
private String contextPath;
|
||||
/**
|
||||
* 是否标准指令库 0是1否
|
||||
*/
|
||||
private String izDirectiveMain;
|
||||
/**
|
||||
* 省份
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
d.org_code,
|
||||
d.url,
|
||||
d.plat_type,
|
||||
d.iz_directive_main,
|
||||
o.open_id,
|
||||
o.wechat_name,
|
||||
o.tel,
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import com.nu.dto.SysConfigMQDto;
|
|||
import com.nu.modules.async.entity.AsyncMain;
|
||||
import com.nu.modules.async.service.IAsyncMainService;
|
||||
import com.nu.modules.sysconfig.ISysConfigApi;
|
||||
import com.nu.modules.sysconfig.SysConfigEntity;
|
||||
import com.nu.modules.sysconfig.entity.SysConfig;
|
||||
import com.nu.modules.sysconfig.mapper.SysConfigMapper;
|
||||
import com.nu.modules.sysconfig.service.ISysConfigService;
|
||||
|
|
@ -82,6 +83,12 @@ public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig
|
|||
}
|
||||
}
|
||||
|
||||
public void asyncForAll(SysConfig sysConfig) {
|
||||
SysConfigMQDto sysConfigMQDto = new SysConfigMQDto();
|
||||
BeanUtils.copyProperties(sysConfig, sysConfigMQDto);
|
||||
rabbitMQUtil.sendToExchange("hldy.sysconfig.fanout", "", sysConfigMQDto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object querySysConfigByKey(String key) {
|
||||
QueryWrapper<SysConfig> qw = new QueryWrapper<>();
|
||||
|
|
@ -93,4 +100,11 @@ public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void asyncApi(SysConfigEntity entity) {
|
||||
SysConfig sysConfig = new SysConfig();
|
||||
BeanUtils.copyProperties(entity, sysConfig);
|
||||
asyncForAll(sysConfig);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,18 +2,21 @@ package com.nu.modules.common;
|
|||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.common.collect.Maps;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 获取常用信息(不涉及安全信息)
|
||||
*
|
||||
* @author zmy
|
||||
* @date 2025-5-22 08:43:05
|
||||
*/
|
||||
|
|
@ -27,6 +30,7 @@ public class SysBaseInfoApi {
|
|||
|
||||
/**
|
||||
* 返回机构信息配置的"协议域名"
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sysUrl")
|
||||
|
|
@ -36,4 +40,27 @@ public class SysBaseInfoApi {
|
|||
result.put("url", deptInfo.getString("url"));
|
||||
return Result.ok(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据机构编码获取机构api接口前缀
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getOrgApiAddress")
|
||||
public Result<?> getOrgInfo(@RequestParam("orgCode") String orgCode) {
|
||||
JSONObject deptInfo = sysBaseAPI.getOrgInfo(orgCode);
|
||||
Map<String, Object> result = Maps.newHashMap();
|
||||
String fullPath = "";
|
||||
String url = deptInfo.getString("url");
|
||||
String contextPath = deptInfo.getString("contextPath");
|
||||
String baseUrl = url.endsWith("/") ? url.substring(0, url.length() - 1) : url;
|
||||
String normalizedContextPath = contextPath.startsWith("/") ? contextPath : "/" + contextPath;
|
||||
normalizedContextPath = normalizedContextPath.endsWith("/")
|
||||
? normalizedContextPath.substring(0, normalizedContextPath.length() - 1)
|
||||
: normalizedContextPath;
|
||||
//接口协议、域名、上下文路径
|
||||
fullPath = baseUrl + normalizedContextPath;
|
||||
result.put("url", fullPath);
|
||||
return Result.ok(result);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,83 @@
|
|||
package com.nu.modules.canadddirective.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import com.nu.modules.canadddirective.entity.CanAddDirective;
|
||||
import com.nu.modules.canadddirective.service.ICanAddDirectiveService;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
||||
/**
|
||||
* @Description: 可新增指令
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-01
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="可新增指令")
|
||||
@RestController
|
||||
@RequestMapping("/canadddirective/canAddDirective")
|
||||
@Slf4j
|
||||
public class CanAddDirectiveController extends JeecgController<CanAddDirective, ICanAddDirectiveService> {
|
||||
@Autowired
|
||||
private ICanAddDirectiveService canAddDirectiveService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param canAddDirective
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "可新增指令-分页列表查询")
|
||||
@ApiOperation(value="可新增指令-分页列表查询", notes="可新增指令-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<CanAddDirective>> queryPageList(CanAddDirective canAddDirective,
|
||||
@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("orgCode", QueryRuleEnum.LIKE_WITH_OR);
|
||||
QueryWrapper<CanAddDirective> queryWrapper = QueryGenerator.initQueryWrapper(canAddDirective, req.getParameterMap(),customeRuleMap);
|
||||
queryWrapper.notIn("directive_id",canAddDirective.getExistDirectiveIds().split(","));
|
||||
Page<CanAddDirective> page = new Page<CanAddDirective>(pageNo, pageSize);
|
||||
IPage<CanAddDirective> pageList = canAddDirectiveService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,103 @@
|
|||
package com.nu.modules.canadddirective.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import org.jeecg.common.constant.ProvinceCityArea;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
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: jeecg-boot
|
||||
* @Date: 2025-08-01
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_can_add_directive")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_can_add_directive对象", description="可新增指令")
|
||||
public class CanAddDirective implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.String id;
|
||||
/**指令ID*/
|
||||
@Excel(name = "指令ID", width = 15)
|
||||
@ApiModelProperty(value = "指令ID")
|
||||
private java.lang.String directiveId;
|
||||
/**分类标签*/
|
||||
@Excel(name = "分类标签", width = 15)
|
||||
@ApiModelProperty(value = "分类标签")
|
||||
private java.lang.String instructionTag;
|
||||
/**服务类别*/
|
||||
@Excel(name = "服务类别", width = 15)
|
||||
@ApiModelProperty(value = "服务类别")
|
||||
private java.lang.String category;
|
||||
/**服务类型*/
|
||||
@Excel(name = "服务类型", width = 15)
|
||||
@ApiModelProperty(value = "服务类型")
|
||||
private java.lang.String type;
|
||||
/**服务指令*/
|
||||
@Excel(name = "服务指令", width = 15)
|
||||
@ApiModelProperty(value = "服务指令")
|
||||
private java.lang.String directiveName;
|
||||
/**周期类型 1日常护理 2周期护理 3即时护理*/
|
||||
@Excel(name = "周期类型", width = 15)
|
||||
@ApiModelProperty(value = "周期类型")
|
||||
private java.lang.String cycleType;
|
||||
/**体型标签*/
|
||||
@Excel(name = "体型标签", width = 15)
|
||||
@ApiModelProperty(value = "体型标签")
|
||||
private java.lang.String bodyTags;
|
||||
/**情绪标签*/
|
||||
@Excel(name = "情绪标签", width = 15)
|
||||
@ApiModelProperty(value = "情绪标签")
|
||||
private java.lang.String emotionTags;
|
||||
/**是否删除 0未删除 1删除*/
|
||||
@Excel(name = "是否删除 0未删除 1删除", width = 15)
|
||||
@ApiModelProperty(value = "是否删除 0未删除 1删除")
|
||||
@TableLogic
|
||||
private java.lang.String delFlag;
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private java.lang.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 java.lang.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;
|
||||
/**所属部门*/
|
||||
@Excel(name = "所属部门", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "org_code")
|
||||
@Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "org_code")
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private java.lang.String orgCode;
|
||||
|
||||
/**
|
||||
* 已存在服务指令ids 逗号拼接
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String existDirectiveIds;
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.nu.modules.canadddirective.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.nu.modules.canadddirective.entity.CanAddDirective;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 可新增指令
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-01
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface CanAddDirectiveMapper extends BaseMapper<CanAddDirective> {
|
||||
|
||||
}
|
||||
|
|
@ -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.canadddirective.mapper.CanAddDirectiveMapper">
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.nu.modules.canadddirective.service;
|
||||
|
||||
import com.nu.modules.canadddirective.entity.CanAddDirective;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 可新增指令
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-01
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ICanAddDirectiveService extends IService<CanAddDirective> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.nu.modules.canadddirective.service.impl;
|
||||
|
||||
import com.nu.modules.canadddirective.entity.CanAddDirective;
|
||||
import com.nu.modules.canadddirective.mapper.CanAddDirectiveMapper;
|
||||
import com.nu.modules.canadddirective.service.ICanAddDirectiveService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 可新增指令
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-01
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class CanAddDirectiveServiceImpl extends ServiceImpl<CanAddDirectiveMapper, CanAddDirective> implements ICanAddDirectiveService {
|
||||
|
||||
}
|
||||
|
|
@ -9,6 +9,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||
import com.beust.jcommander.internal.Maps;
|
||||
import com.nu.dto.DirectiveAsyncMQDto;
|
||||
import com.nu.dto.DirectiveMQDto;
|
||||
import com.nu.enums.MQStatus;
|
||||
import com.nu.modules.async.entity.AsyncMain;
|
||||
import com.nu.modules.async.entity.AsyncStatus;
|
||||
import com.nu.modules.async.service.IAsyncMainService;
|
||||
import com.nu.modules.async.service.IAsyncStatusService;
|
||||
import com.nu.modules.directivetag.body.entity.DirectiveBodyTag;
|
||||
import com.nu.modules.directivetag.body.service.IDirectiveBodyTagService;
|
||||
import com.nu.modules.directivetag.emotion.entity.DirectiveEmotionTag;
|
||||
|
|
@ -58,6 +63,10 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
|||
private RabbitMQUtil rabbitMQUtil;
|
||||
@Autowired
|
||||
private ISysBaseAPI sysBaseAPI;
|
||||
@Autowired
|
||||
private IAsyncMainService asyncMainService;
|
||||
@Autowired
|
||||
private IAsyncStatusService asyncStatusService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
|
|
@ -182,6 +191,25 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
|||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询目标平台已有指令
|
||||
*
|
||||
* @param dataSourceCode
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/idListByDS")
|
||||
@DS("#dataSourceCode")
|
||||
public Result<IPage<ConfigServiceDirective>> idListByDS(@RequestParam(name = "dataSourceCode") String dataSourceCode) {
|
||||
if (StringUtils.isBlank(dataSourceCode)) {
|
||||
return Result.ok(new Page<>());
|
||||
}
|
||||
QueryWrapper<ConfigServiceDirective> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.select("id");
|
||||
Page<ConfigServiceDirective> page = new Page<>(1, -1);
|
||||
IPage<ConfigServiceDirective> list = configServiceDirectiveService.page(page, queryWrapper);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
|
|
@ -421,9 +449,11 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
|||
}
|
||||
|
||||
//同步-新增服务指令
|
||||
if (StringUtils.isNotBlank(dto.getSyncIds())) {
|
||||
configServiceDirectiveService.syncDirective(dto.getSyncIds(), dto.getSyncOrgCodes(), dto.getSyncOption(), fullPath, dataSourceCode);
|
||||
}
|
||||
|
||||
//给待更新的指令
|
||||
//待更新的指令
|
||||
if (StringUtils.isNotBlank(dto.getUpIds())) {
|
||||
DirectiveMQDto upDirectiveMQDto = new DirectiveMQDto();
|
||||
List<ConfigServiceDirective> directives;
|
||||
|
|
@ -444,6 +474,22 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
|||
new Thread(() -> {
|
||||
for (String code : dto.getSyncOrgCodes().split(",")) {
|
||||
try {
|
||||
AsyncMain asyncMain = new AsyncMain();
|
||||
asyncMain.setType("directive");
|
||||
asyncMain.setOrgCode(dataSourceCode);
|
||||
asyncMain.setDescr("服务指令同步");
|
||||
asyncMainService.saveData("master", asyncMain);
|
||||
upDirectiveMQDto.setAsyncId(asyncMain.getId());
|
||||
|
||||
AsyncStatus asyncStatus_file = new AsyncStatus();
|
||||
asyncStatus_file.setPkid(asyncMain.getId());
|
||||
asyncStatus_file.setCode("file");
|
||||
asyncStatus_file.setName("文件");
|
||||
asyncStatus_file.setStatus(MQStatus.LOADING.getCode() + "");
|
||||
asyncStatus_file.setMsg("同步中");
|
||||
asyncStatus_file.setTargetOrgCode(code);
|
||||
asyncStatusService.saveData("master", asyncStatus_file);
|
||||
|
||||
rabbitMQUtil.sendToExchange("hldy.directive", code + ".directive.createmedia", upDirectiveMQDto);
|
||||
// 发送完后,休眠 5 分钟
|
||||
// Thread.sleep(TimeUnit.MINUTES.toMillis(5));
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ import com.nu.modules.async.entity.AsyncMain;
|
|||
import com.nu.modules.async.entity.AsyncStatus;
|
||||
import com.nu.modules.async.service.IAsyncMainService;
|
||||
import com.nu.modules.async.service.IAsyncStatusService;
|
||||
import com.nu.modules.canadddirective.entity.CanAddDirective;
|
||||
import com.nu.modules.canadddirective.service.ICanAddDirectiveService;
|
||||
import com.nu.modules.directivetag.body.entity.DirectiveBodyTag;
|
||||
import com.nu.modules.directivetag.body.entity.DirectiveBodyTagRelation;
|
||||
import com.nu.modules.directivetag.body.service.IDirectiveBodyTagService;
|
||||
|
|
@ -40,6 +42,7 @@ import org.springframework.stereotype.Component;
|
|||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
|
|
@ -61,14 +64,45 @@ public class DirectiveMQListener {
|
|||
private IDirectiveBodyTagService bodyTagService;
|
||||
@Autowired
|
||||
private IDirectiveEmotionTagService emotionTagService;
|
||||
@Autowired
|
||||
private ICanAddDirectiveService canAddDirectiveService;
|
||||
|
||||
/**
|
||||
*其他平台新增指令
|
||||
*/
|
||||
@RabbitListener(bindings = @QueueBinding(value = @Queue(name = "hldy.directive.newadd"), exchange = @Exchange(name = "hldy.directive", type = ExchangeTypes.DIRECT), key = "hldy.directive.newadd"), errorHandler = "directiveMQErrorHandler")
|
||||
public void auditBizDirective(DirectiveAsyncMQDto dto) {
|
||||
|
||||
CanAddDirective canAddDirective = new CanAddDirective();
|
||||
canAddDirective.setDirectiveId(dto.getId());
|
||||
canAddDirective.setDirectiveName(dto.getDirectiveName());
|
||||
canAddDirective.setInstructionTag(dto.getInstructionName());
|
||||
canAddDirective.setCategory(dto.getCategoryName());
|
||||
canAddDirective.setType(dto.getTypeName());
|
||||
canAddDirective.setCycleType(dto.getCycleTypeName());
|
||||
List<Map> bodyTagsList = JSON.parseArray(dto.getBodyTagsObj(), Map.class);
|
||||
String bodyTags = bodyTagsList.stream()
|
||||
.map(map -> map.get("label").toString())
|
||||
.collect(Collectors.joining(","));
|
||||
canAddDirective.setBodyTags(bodyTags);
|
||||
|
||||
List<Map> emotionTagsList = JSON.parseArray(dto.getEmotionTagsObj(), Map.class);
|
||||
String emotionTags = emotionTagsList.stream()
|
||||
.map(map -> map.get("label").toString())
|
||||
.collect(Collectors.joining(","));
|
||||
canAddDirective.setEmotionTags(emotionTags);
|
||||
canAddDirective.setOrgCode(dto.getSysOrgCode());
|
||||
canAddDirective.setDelFlag("0");
|
||||
canAddDirectiveService.save(canAddDirective);
|
||||
}
|
||||
|
||||
/**
|
||||
* 业务平台新增指令/编辑未授权指令 传给 管理平台进行审核
|
||||
*
|
||||
* @param dto
|
||||
*/
|
||||
@RabbitListener(bindings = @QueueBinding(value = @Queue(name = "hldy.directive.audit"), exchange = @Exchange(name = "hldy.directive", type = ExchangeTypes.DIRECT), key = "hldy.directive.audit"), errorHandler = "directiveMQErrorHandler")
|
||||
public void auditBizDirective(DirectiveAsyncMQDto dto) {
|
||||
// @RabbitListener(bindings = @QueueBinding(value = @Queue(name = "hldy.directive.audit"), exchange = @Exchange(name = "hldy.directive", type = ExchangeTypes.DIRECT), key = "hldy.directive.audit"), errorHandler = "directiveMQErrorHandler")
|
||||
public void auditBizDirective2(DirectiveAsyncMQDto dto) {
|
||||
//先处理各字典项 只新增,不修改
|
||||
String instructionTagId = dto.getInstructionTagId();
|
||||
String categoryId = dto.getCategoryId();
|
||||
|
|
|
|||
|
|
@ -64,6 +64,10 @@ public class SysDepartEntity implements Serializable {
|
|||
* 项目访问路径
|
||||
*/
|
||||
private String contextPath;
|
||||
/**
|
||||
* 是否标准指令库 0是1否
|
||||
*/
|
||||
private String izDirectiveMain;
|
||||
/**
|
||||
* 省份
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||
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.sysconfig.ISysConfigApi;
|
||||
import com.nu.modules.sysconfig.SysConfigEntity;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
|
@ -72,6 +74,9 @@ public class SysDepartController {
|
|||
private ISysUserDepartService sysUserDepartService;
|
||||
@Autowired
|
||||
private RedisUtil redisUtil;
|
||||
@Autowired
|
||||
private ISysConfigApi sysConfigApi;
|
||||
|
||||
/**
|
||||
* 查询数据 查出我的部门,并以树结构数据格式响应给前端
|
||||
*
|
||||
|
|
@ -132,6 +137,7 @@ public class SysDepartController {
|
|||
|
||||
/**
|
||||
* 异步查询部门list
|
||||
*
|
||||
* @param parentId 父节点 异步加载时传递
|
||||
* @param ids 前端回显是传递
|
||||
* @param primaryKey 主键字段(id或者orgCode)
|
||||
|
|
@ -235,6 +241,7 @@ public class SysDepartController {
|
|||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -499,6 +506,7 @@ public class SysDepartController {
|
|||
|
||||
/**
|
||||
* 查询所有部门信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("listAll")
|
||||
|
|
@ -515,6 +523,7 @@ public class SysDepartController {
|
|||
result.setResult(ls);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询数据 查出所有部门,并以树结构数据格式响应给前端
|
||||
*
|
||||
|
|
@ -574,9 +583,9 @@ public class SysDepartController {
|
|||
}
|
||||
|
||||
/**
|
||||
* @功能:根据id 批量查询
|
||||
* @param deptIds
|
||||
* @return
|
||||
* @功能:根据id 批量查询
|
||||
*/
|
||||
@RequestMapping(value = "/queryByIds", method = RequestMethod.GET)
|
||||
public Result<Collection<SysDepart>> queryByIds(@RequestParam(name = "deptIds") String deptIds) {
|
||||
|
|
@ -597,6 +606,7 @@ public class SysDepartController {
|
|||
|
||||
/**
|
||||
* 异步查询部门list
|
||||
*
|
||||
* @param parentId 父节点 异步加载时传递
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -617,6 +627,7 @@ public class SysDepartController {
|
|||
|
||||
/**
|
||||
* 通过部门id和租户id获取用户 【低代码应用: 用于选择部门负责人】
|
||||
*
|
||||
* @param departId
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -693,6 +704,7 @@ public class SysDepartController {
|
|||
|
||||
/**
|
||||
* 人员入住可选择的机构
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/queryInstitutionsList", method = RequestMethod.GET)
|
||||
|
|
@ -717,6 +729,7 @@ public class SysDepartController {
|
|||
|
||||
/**
|
||||
* 查询所有子区域信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("queryChildrenByParentId")
|
||||
|
|
@ -734,6 +747,7 @@ public class SysDepartController {
|
|||
|
||||
/**
|
||||
* 查询所有子区域信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("getDepartServerUrl")
|
||||
|
|
@ -748,7 +762,6 @@ public class SysDepartController {
|
|||
}
|
||||
|
||||
|
||||
|
||||
@AutoLog(value = "机构列表-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<?> list(SysDepart sysDepart,
|
||||
|
|
@ -761,4 +774,29 @@ public class SysDepartController {
|
|||
return Result.ok(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "指令库变更")
|
||||
@PostMapping(value = "/changeDirectiveMain")
|
||||
public Result<?> changeDirectiveMain(@RequestParam(name = "orgCode") String orgCode) {
|
||||
sysDepartService.changeDirectiveMain(orgCode);
|
||||
|
||||
//发消息通知所有平台修改指令库主库编码
|
||||
SysConfigEntity config = new SysConfigEntity();
|
||||
config.setId("1944154379395543440");
|
||||
config.setName("服务指令主指令库机构编码");
|
||||
config.setConfigKey("directive_main_org_code");
|
||||
config.setConfigValue(orgCode);
|
||||
config.setDescr("服务指令主指令库机构编码");
|
||||
config.setIzEnabled("0");
|
||||
config.setDelFlag("0");
|
||||
sysConfigApi.asyncApi(config);
|
||||
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@GetMapping(value = "/getDirectiveMain")
|
||||
public Result<?> getDirectiveMain() {
|
||||
QueryWrapper<SysDepart> qw = new QueryWrapper<>();
|
||||
qw.eq("iz_directive_main","0");
|
||||
return Result.ok(sysDepartService.getOne(qw));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,6 +84,10 @@ public class SysDepart implements Serializable {
|
|||
* 项目访问路径
|
||||
*/
|
||||
private String contextPath;
|
||||
/**
|
||||
* 是否标准指令库 0是1否
|
||||
*/
|
||||
private String izDirectiveMain;
|
||||
/**
|
||||
* 省份
|
||||
*/
|
||||
|
|
@ -251,6 +255,7 @@ public class SysDepart implements Serializable {
|
|||
Objects.equals(orgCode, depart.orgCode) &&
|
||||
Objects.equals(url, depart.url) &&
|
||||
Objects.equals(contextPath, depart.contextPath) &&
|
||||
Objects.equals(izDirectiveMain, depart.izDirectiveMain) &&
|
||||
Objects.equals(province, depart.province) &&
|
||||
Objects.equals(city, depart.city) &&
|
||||
Objects.equals(district, depart.district) &&
|
||||
|
|
@ -279,7 +284,7 @@ public class SysDepart implements Serializable {
|
|||
public int hashCode() {
|
||||
return Objects.hash(super.hashCode(), id, parentId, departName,
|
||||
departNameEn, departNameAbbr, departOrder, description, orgCategory,
|
||||
orgType, orgCode, url,contextPath, province, city, district, operationStartTime,
|
||||
orgType, orgCode, url, contextPath, izDirectiveMain, province, city, district, operationStartTime,
|
||||
operationEndTime, contractStartTime, contractEndTime, mobile, fax, address, memo, status,
|
||||
delFlag, createBy, createTime, updateBy, updateTime, tenantId, payableAmount);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,6 +69,8 @@ public class SysDepartTreeModel implements Serializable {
|
|||
|
||||
private String contextPath;
|
||||
|
||||
private String izDirectiveMain;
|
||||
|
||||
private String province;
|
||||
|
||||
private String city;
|
||||
|
|
@ -141,6 +143,7 @@ public class SysDepartTreeModel implements Serializable {
|
|||
this.orgCode = sysDepart.getOrgCode();
|
||||
this.url = sysDepart.getUrl();
|
||||
this.contextPath = sysDepart.getContextPath();
|
||||
this.izDirectiveMain = sysDepart.getIzDirectiveMain();
|
||||
this.province = sysDepart.getProvince();
|
||||
this.city = sysDepart.getCity();
|
||||
this.district = sysDepart.getDistrict();
|
||||
|
|
@ -493,6 +496,14 @@ public class SysDepartTreeModel implements Serializable {
|
|||
return contextPath;
|
||||
}
|
||||
|
||||
public String getIzDirectiveMain() {
|
||||
return izDirectiveMain;
|
||||
}
|
||||
|
||||
public void setIzDirectiveMain(String izDirectiveMain) {
|
||||
this.izDirectiveMain = izDirectiveMain;
|
||||
}
|
||||
|
||||
public void setContextPath(String contextPath) {
|
||||
this.contextPath = contextPath;
|
||||
}
|
||||
|
|
@ -522,6 +533,7 @@ public class SysDepartTreeModel implements Serializable {
|
|||
Objects.equals(orgCode, model.orgCode) &&
|
||||
Objects.equals(url, model.url) &&
|
||||
Objects.equals(contextPath, model.contextPath) &&
|
||||
Objects.equals(izDirectiveMain, model.izDirectiveMain) &&
|
||||
Objects.equals(province, model.province) &&
|
||||
Objects.equals(city, model.city) &&
|
||||
Objects.equals(district, model.district) &&
|
||||
|
|
@ -552,7 +564,7 @@ public class SysDepartTreeModel implements Serializable {
|
|||
public int hashCode() {
|
||||
|
||||
return Objects.hash(id, parentId, platType, departName, departNameEn, departNameAbbr,
|
||||
departOrder, description, orgCategory, orgType, orgCode, url, contextPath, province, city, district,
|
||||
departOrder, description, orgCategory, orgType, orgCode, url, contextPath, izDirectiveMain, province, city, district,
|
||||
operationStartTime, operationEndTime, contractStartTime, contractEndTime,
|
||||
mobile, fax, address, memo, status, delFlag, qywxIdentifier,
|
||||
createBy, createTime, updateBy, updateTime, children, directorUserIds, payableAmount);
|
||||
|
|
|
|||
|
|
@ -239,4 +239,6 @@ public interface ISysDepartService extends IService<SysDepart>{
|
|||
* @param errorMessageList
|
||||
*/
|
||||
void importSysDepart(List<SysDepartExportVo> listSysDeparts, List<String> errorMessageList);
|
||||
|
||||
void changeDirectiveMain(String orgCode);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1918,6 +1918,7 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
|||
map.put("name",list.get(0).getDepartName());
|
||||
map.put("url",list.get(0).getUrl());
|
||||
map.put("contextPath",list.get(0).getContextPath());
|
||||
map.put("izDirectiveMain",list.get(0).getIzDirectiveMain());
|
||||
}
|
||||
return new JSONObject(map);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1353,6 +1353,23 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeDirectiveMain(String orgCode) {
|
||||
SysDepart sysDepart = new SysDepart();
|
||||
|
||||
//将非当前机构变更为非指令库
|
||||
QueryWrapper<SysDepart> uqw1 = new QueryWrapper<>();
|
||||
uqw1.ne("org_code",orgCode);
|
||||
sysDepart.setIzDirectiveMain("1");
|
||||
baseMapper.update(sysDepart,uqw1);
|
||||
|
||||
//将当前机构变更为指令库
|
||||
QueryWrapper<SysDepart> uqw2 = new QueryWrapper<>();
|
||||
uqw2.eq("org_code",orgCode);
|
||||
sysDepart.setIzDirectiveMain("0");
|
||||
baseMapper.update(sysDepart,uqw2);
|
||||
}
|
||||
|
||||
/**
|
||||
* 寻找部门路径
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue