服务指令-指令库

This commit is contained in:
1378012178@qq.com 2025-08-04 14:49:58 +08:00
parent fe39e1d0c1
commit f6313df57a
21 changed files with 1069 additions and 549 deletions

View File

@ -10,4 +10,6 @@ public interface ISysConfigApi {
* @return
*/
public Object querySysConfigByKey(String key);
void asyncApi(SysConfigEntity entity);
}

View File

@ -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;
}

View File

@ -35,6 +35,10 @@ public class OrgAllInfo implements Serializable {
* 协议+域名
*/
private String contextPath;
/**
* 是否标准指令库 0是1否
*/
private String izDirectiveMain;
/**
* 省份
*/

View File

@ -9,6 +9,7 @@
d.org_code,
d.url,
d.plat_type,
d.iz_directive_main,
o.open_id,
o.wechat_name,
o.tel,

View File

@ -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);
}
}

View File

@ -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,13 +30,37 @@ public class SysBaseInfoApi {
/**
* 返回机构信息配置的"协议域名"
*
* @return
*/
@GetMapping("/sysUrl")
public Result<?> sysUrl(){
public Result<?> sysUrl() {
JSONObject deptInfo = sysBaseAPI.getDeptInfo();
Map<String,Object> result = Maps.newHashMap();
result.put("url",deptInfo.getString("url"));
Map<String, Object> result = Maps.newHashMap();
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);
}
}

View File

@ -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);
}
}

View File

@ -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;
}

View File

@ -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> {
}

View File

@ -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>

View File

@ -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> {
}

View File

@ -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 {
}

View File

@ -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);
}
/**
* 添加
*
@ -408,7 +436,7 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
//处理接口地址
String fullPath = "";
if ("all".equals(dto.getSyncOption()) || "media".equals(dto.getSyncOption()) || StringUtils.isNotBlank(dto.getUpIds())) {
JSONObject deptInfo = configServiceDirectiveService.getDeptInfo("master",dataSourceCode);
JSONObject deptInfo = configServiceDirectiveService.getDeptInfo("master", dataSourceCode);
String url = deptInfo.getString("url");
String contextPath = deptInfo.getString("contextPath");
String baseUrl = url.endsWith("/") ? url.substring(0, url.length() - 1) : url;
@ -421,9 +449,11 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
}
//同步-新增服务指令
configServiceDirectiveService.syncDirective(dto.getSyncIds(), dto.getSyncOrgCodes(), dto.getSyncOption(),fullPath,dataSourceCode);
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));

View File

@ -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();

View File

@ -64,6 +64,10 @@ public class SysDepartEntity implements Serializable {
* 项目访问路径
*/
private String contextPath;
/**
* 是否标准指令库 0是1否
*/
private String izDirectiveMain;
/**
* 省份
*/

View File

@ -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);
}

View File

@ -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);

View File

@ -239,4 +239,6 @@ public interface ISysDepartService extends IService<SysDepart>{
* @param errorMessageList
*/
void importSysDepart(List<SysDepartExportVo> listSysDeparts, List<String> errorMessageList);
void changeDirectiveMain(String orgCode);
}

View File

@ -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);
}

View File

@ -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);
}
/**
* 寻找部门路径
*