服务指令相关
This commit is contained in:
parent
5ad7a20675
commit
0faa2a5c89
|
|
@ -1,6 +1,6 @@
|
|||
package com.nu.modules.sysconfig;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
public interface ISysConfigApi {
|
||||
|
||||
|
|
@ -12,4 +12,6 @@ public interface ISysConfigApi {
|
|||
public Object querySysConfigByKey(String key);
|
||||
|
||||
void asyncApi(SysConfigEntity entity);
|
||||
|
||||
JSONObject getByKeyByDS(String ds,String key);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.nu.modules.sysconfig.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.google.common.collect.Lists;
|
||||
|
|
@ -15,6 +17,7 @@ import com.nu.modules.sysconfig.service.ISysConfigService;
|
|||
import com.nu.utils.RabbitMQUtil;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -107,4 +110,33 @@ public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig
|
|||
BeanUtils.copyProperties(entity, sysConfig);
|
||||
asyncForAll(sysConfig);
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("#ds")
|
||||
public JSONObject getByKeyByDS(String ds, String key) {
|
||||
JSONObject result = getJsonObject(key);
|
||||
return result;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private JSONObject getJsonObject(String key) {
|
||||
LambdaQueryWrapper<SysConfig> qw = new LambdaQueryWrapper<>();
|
||||
qw.eq(SysConfig::getDelFlag, "0");
|
||||
qw.eq(SysConfig::getConfigKey, key);
|
||||
SysConfig sysConfig = baseMapper.selectOne(qw);
|
||||
JSONObject result = new JSONObject();
|
||||
if (sysConfig != null) {
|
||||
result.put("id", sysConfig.getId());
|
||||
result.put("name", sysConfig.getName());
|
||||
result.put("configKey", sysConfig.getConfigKey());
|
||||
result.put("configValue", sysConfig.getConfigValue());
|
||||
result.put("descr", sysConfig.getDescr());
|
||||
result.put("izEnabled", sysConfig.getIzEnabled());
|
||||
result.put("createBy", sysConfig.getCreateBy());
|
||||
result.put("createTime", sysConfig.getCreateTime());
|
||||
result.put("updateBy", sysConfig.getUpdateBy());
|
||||
result.put("updateTime", sysConfig.getUpdateTime());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,5 +26,11 @@
|
|||
<artifactId>nu-admin-local-api</artifactId>
|
||||
<version>2.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nu-services-local-api</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
|
@ -91,4 +92,19 @@ public class SysBaseInfoApi {
|
|||
result.put("url", fullPath);
|
||||
return Result.ok(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有机构名称编码
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getOrgCodeAndName")
|
||||
public Result<?> getOrgCodeAndName() {
|
||||
List<JSONObject> list = sysBaseAPI.queryOpeDept();
|
||||
Map<String, Object> result = Maps.newHashMap();
|
||||
list.stream().forEach(d -> {
|
||||
result.put(d.getString("code"), d.getString("name"));
|
||||
});
|
||||
return Result.ok(result);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,40 @@
|
|||
package com.nu.modules.services.directive.api;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
|
||||
import com.nu.modules.directive.api.DirectiveApi;
|
||||
import com.nu.modules.directive.entity.DirectiveExportApiEntity;
|
||||
import com.nu.modules.services.directive.entity.DirectiveExportDto;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 服务指令 !【暴露】! 接口
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/services/directive")
|
||||
public class DirectiveExportApi {
|
||||
|
||||
@Autowired
|
||||
private DirectiveApi directiveApi;
|
||||
|
||||
@GetMapping("/queryCompareDirectives")
|
||||
public Result<JSONObject> queryCompareDirectives(@RequestParam("orgCode") String orgCode) {
|
||||
//切换至业务数据源
|
||||
DynamicDataSourceContextHolder.push(orgCode);
|
||||
List<DirectiveExportApiEntity> list;
|
||||
try {
|
||||
list = directiveApi.queryCompareDirectives();
|
||||
} finally {
|
||||
//关闭数据源切换
|
||||
DynamicDataSourceContextHolder.clear();
|
||||
}
|
||||
JSONObject resultData = new JSONObject();
|
||||
resultData.put("list", list);
|
||||
return Result.ok(resultData);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package com.nu.modules.services.directive.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DirectiveExportDto {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String id;
|
||||
private String categoryId;
|
||||
private String typeId;
|
||||
private String instructionTagId;
|
||||
private String directiveName;
|
||||
private String cycleType;
|
||||
private String instructionName;
|
||||
private String categoryName;
|
||||
private String typeName;
|
||||
private String cycleTypeName;
|
||||
private String compareOrgCode;
|
||||
|
||||
}
|
||||
|
|
@ -126,6 +126,8 @@ public class ShiroConfig {
|
|||
filterChainDefinitionMap.put("/api/ocr/**", "anon");//阿里云证件识别
|
||||
filterChainDefinitionMap.put("/api/proxy/**", "anon");//代理请求
|
||||
filterChainDefinitionMap.put("/api/baseInfo/**", "anon");//获取系统中信息
|
||||
filterChainDefinitionMap.put("/api/services/directive/queryCompareDirectives", "anon");//服务指令暴露接口
|
||||
|
||||
|
||||
//update-begin--Author:scott Date:20221116 for:排除静态资源后缀
|
||||
filterChainDefinitionMap.put("/", "anon");
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
package com.nu.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令审核
|
||||
|
|
@ -111,9 +109,13 @@ public class DirectiveAsyncMQDto implements Serializable {
|
|||
*/
|
||||
private String mp4File;
|
||||
/**
|
||||
* 服务指令图片
|
||||
* 服务指令图片大图
|
||||
*/
|
||||
private String previewFile;
|
||||
/**
|
||||
* 服务指令图片小图
|
||||
*/
|
||||
private String previewFileSmall;
|
||||
/**
|
||||
* 即时指令图标
|
||||
*/
|
||||
|
|
@ -127,9 +129,13 @@ public class DirectiveAsyncMQDto implements Serializable {
|
|||
*/
|
||||
private java.lang.String mp4FileMd5;
|
||||
/**
|
||||
* 服务指令图片md5
|
||||
* 服务指令图片大图md5
|
||||
*/
|
||||
private java.lang.String previewFileMd5;
|
||||
/**
|
||||
* 服务指令图片小图md5
|
||||
*/
|
||||
private java.lang.String previewFileSmallMd5;
|
||||
/**
|
||||
* 即时指令图标md5
|
||||
*/
|
||||
|
|
@ -152,7 +158,6 @@ public class DirectiveAsyncMQDto implements Serializable {
|
|||
private String bodyTagsObj;
|
||||
//情绪标签json字符串(有id、label)
|
||||
private String emotionTagsObj;
|
||||
|
||||
//资源请求接口域名+项目上下文路径
|
||||
private String api;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,10 @@ public class DirectiveMQDto {
|
|||
private String orgCode;//机构编码
|
||||
private String idStr;
|
||||
private List<String> idList;
|
||||
/**
|
||||
* 管理平台服务指令媒体资源管理功能发起的(本地未必会有对应指令,没有的话只保存物理文件)
|
||||
*/
|
||||
private boolean izDirectiveMedia;
|
||||
|
||||
//同步主表id
|
||||
private String asyncId;
|
||||
|
|
|
|||
|
|
@ -43,6 +43,10 @@ public class AsyncMain implements Serializable {
|
|||
@Excel(name = "机构编码", width = 15)
|
||||
@ApiModelProperty(value = "机构编码")
|
||||
private java.lang.String orgCode;
|
||||
/**同步内容id逗号分隔*/
|
||||
@Excel(name = "同步内容id逗号分隔", width = 15)
|
||||
@ApiModelProperty(value = "同步内容id逗号分隔")
|
||||
private java.lang.String syncIds;
|
||||
/**机构名称*/
|
||||
@Excel(name = "机构名称", width = 15)
|
||||
@ApiModelProperty(value = "机构名称")
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
<result property="primaryKey" column="primaryKey"/>
|
||||
<result property="orgCode" column="orgCode"/>
|
||||
<result property="orgName" column="orgName"/>
|
||||
<result property="syncIds" column="syncIds"/>
|
||||
<result property="type" column="type"/>
|
||||
<result property="descr" column="descr"/>
|
||||
<result property="createBy" column="createBy"/>
|
||||
|
|
@ -30,6 +31,7 @@
|
|||
f.org_code as orgCode,
|
||||
md.depart_name as orgName,
|
||||
f.type as type,
|
||||
f.sync_ids as syncIds,
|
||||
f.descr as descr,
|
||||
f.create_by as createBy,
|
||||
f.create_time as createTime,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,101 @@
|
|||
package com.nu.utils;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.nio.file.Files;
|
||||
import java.security.MessageDigest;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
public class NuFileUtils {
|
||||
|
||||
private static String uploadpath;
|
||||
|
||||
// 通过Setter注入静态字段
|
||||
@Value("${jeecg.path.upload}")
|
||||
public void setUploadpath(String path) {
|
||||
uploadpath = path;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将文件转存到静态资源目录中
|
||||
*
|
||||
* @param targetDir 目标目录
|
||||
* @param filePath 文件路径
|
||||
* @return 如果路径有变化返回新路径,否则返回null
|
||||
*/
|
||||
public static Map<String, String> processFile(String targetDir, String filePath) {
|
||||
if (StringUtils.isBlank(filePath)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
// 检查文件路径是否以目标目录开头
|
||||
if (!filePath.startsWith(targetDir + "/")) {
|
||||
// 获取文件名(路径的最后一部分)
|
||||
String fileName = filePath.substring(filePath.lastIndexOf('/') + 1);
|
||||
|
||||
// 构建新的完整路径
|
||||
String newRelativePath = targetDir + "/" + fileName;
|
||||
String oldFullPath = uploadpath + "/" + filePath;
|
||||
String newFullPath = uploadpath + "/" + newRelativePath;
|
||||
|
||||
// 创建目标目录(如果不存在)
|
||||
File targetDirectory = new File(uploadpath + "/" + targetDir);
|
||||
if (!targetDirectory.exists()) {
|
||||
targetDirectory.mkdirs();
|
||||
}
|
||||
|
||||
// 移动文件
|
||||
File oldFile = new File(oldFullPath);
|
||||
if (oldFile.exists()) {
|
||||
// 计算原文件的MD5
|
||||
String md5 = calculateMD5(oldFile);
|
||||
|
||||
File newFile = new File(newFullPath);
|
||||
|
||||
// 如果目标文件已存在,先删除
|
||||
if (newFile.exists()) {
|
||||
newFile.delete();
|
||||
}
|
||||
|
||||
// 移动文件
|
||||
Files.move(oldFile.toPath(), newFile.toPath());
|
||||
|
||||
// 返回包含新路径和MD5的Map
|
||||
Map<String, String> result = new HashMap<>();
|
||||
result.put("path", newRelativePath);
|
||||
result.put("md5", md5);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// 处理异常,可以根据实际需求记录日志或抛出
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static String calculateMD5(File file) throws Exception {
|
||||
try (InputStream is = Files.newInputStream(file.toPath())) {
|
||||
MessageDigest md = MessageDigest.getInstance("MD5");
|
||||
byte[] buffer = new byte[8192];
|
||||
int read;
|
||||
while ((read = is.read(buffer)) != -1) {
|
||||
md.update(buffer, 0, read);
|
||||
}
|
||||
byte[] md5 = md.digest();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (byte b : md5) {
|
||||
sb.append(String.format("%02x", b));
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package com.nu.mq.eldertag.listener;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.nu.dto.ElderTagAsyncMQDto;
|
||||
import com.nu.dto.StatusMQDto;
|
||||
import com.nu.enums.MQStatus;
|
||||
|
|
@ -32,10 +33,17 @@ public class ElderTaggMQListener {
|
|||
private ICanAddElderTagService canAddElderTagService;
|
||||
|
||||
/**
|
||||
*其他平台新增指令
|
||||
* 其他平台新增指令
|
||||
*/
|
||||
@RabbitListener(bindings = @QueueBinding(value = @Queue(name = "hldy.eldettag.newadd"), exchange = @Exchange(name = "hldy.eldettag", type = ExchangeTypes.DIRECT), key = "hldy.eldettag.newadd"), errorHandler = "elderTaggMQErrorHandler")
|
||||
public void auditBizDirective(ElderTagAsyncMQDto dto) {
|
||||
QueryWrapper<CanAddElderTag> qw = new QueryWrapper<>();
|
||||
qw.eq("tag_id", dto.getId());
|
||||
CanAddElderTag one = canAddElderTagService.getOne(qw);
|
||||
if (one != null) {
|
||||
return;
|
||||
}
|
||||
|
||||
CanAddElderTag canAddElderTag = new CanAddElderTag();
|
||||
canAddElderTag.setTagId(dto.getId());
|
||||
canAddElderTag.setTagName(dto.getTagName());
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
package com.nu.modules.directive.api;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.nu.modules.directive.entity.DirectiveExportApiEntity;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface DirectiveApi {
|
||||
List<DirectiveExportApiEntity> queryCompareDirectives();
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package com.nu.modules.directive.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DirectiveExportApiEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String id;
|
||||
private String categoryId;
|
||||
private String typeId;
|
||||
private String instructionTagId;
|
||||
private String directiveName;
|
||||
private String cycleType;
|
||||
private String instructionName;
|
||||
private String categoryName;
|
||||
private String typeName;
|
||||
private String cycleTypeName;
|
||||
private String compareOrgCode;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
package com.nu.job.directive;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
|
||||
import com.nu.modules.directivebk.entity.DirectiveBkItem;
|
||||
import com.nu.modules.directivebk.entity.DirectiveBkMain;
|
||||
import com.nu.modules.directivebk.service.IDirectiveBkItemService;
|
||||
import com.nu.modules.directivebk.service.IDirectiveBkMainService;
|
||||
import com.nu.modules.servicedirective.entity.ConfigServiceDirective;
|
||||
import com.nu.modules.servicedirective.service.IConfigServiceDirectiveService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 服务指令备份
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class ServiceDirectiveBkJob implements Job {
|
||||
|
||||
@Autowired
|
||||
private IConfigServiceDirectiveService directiveService;
|
||||
@Autowired
|
||||
private ISysBaseAPI sysBaseAPI;
|
||||
@Autowired
|
||||
private IDirectiveBkMainService bkMainService;
|
||||
@Autowired
|
||||
private IDirectiveBkItemService bkItemService;
|
||||
|
||||
/**
|
||||
* 备份各机构服务指令
|
||||
* @param jobExecutionContext
|
||||
* @throws JobExecutionException
|
||||
*/
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
List<JSONObject> orgList = sysBaseAPI.queryOpeDept();
|
||||
List<String> codes = orgList.stream().map(o -> o.getString("code")).collect(Collectors.toList());
|
||||
String currentOrgCode = "";
|
||||
for (int i = 0; i < codes.size(); i++) {
|
||||
currentOrgCode = codes.get(i);
|
||||
try {
|
||||
DynamicDataSourceContextHolder.push(codes.get(i));
|
||||
List<ConfigServiceDirective> directives = directiveService.queryAndTranslate(null);
|
||||
DynamicDataSourceContextHolder.clear();
|
||||
if(directives!=null && directives.size()>0){
|
||||
//增加服务指令主备份记录
|
||||
DirectiveBkMain directiveBkMain = new DirectiveBkMain();
|
||||
directiveBkMain.setOrgCode(codes.get(i));
|
||||
bkMainService.save(directiveBkMain);
|
||||
//增加对应机构的指令到备份子表中
|
||||
List<DirectiveBkItem> needAddList = BeanUtil.copyToList(directives, DirectiveBkItem.class);
|
||||
needAddList.forEach(d -> {
|
||||
d.setDirectiveId(d.getId());
|
||||
d.setPkid(directiveBkMain.getId());
|
||||
d.setId(IdUtil.simpleUUID());
|
||||
});
|
||||
bkItemService.saveBatch(needAddList);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.info("备份机构【{}】的服务指令时报错",currentOrgCode,e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
package com.nu.job.directive;
|
||||
|
||||
import com.nu.modules.directivebk.service.IDirectiveBkItemService;
|
||||
import com.nu.modules.directivebk.service.IDirectiveBkMainService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 清理服务指令备份
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class ServiceDirectiveCleanBkJob implements Job {
|
||||
|
||||
@Autowired
|
||||
private IDirectiveBkMainService bkMainService;
|
||||
@Autowired
|
||||
private IDirectiveBkItemService bkItemService;
|
||||
|
||||
/**
|
||||
* 备份各机构服务指令
|
||||
*
|
||||
* @param jobExecutionContext
|
||||
* @throws JobExecutionException
|
||||
*/
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
bkItemService.cleanBkByPhysical();
|
||||
bkMainService.cleanBkByPhysical();
|
||||
}
|
||||
}
|
||||
|
|
@ -21,77 +21,131 @@ import lombok.experimental.Accessors;
|
|||
/**
|
||||
* @Description: 可新增指令
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-01
|
||||
* @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="可新增指令")
|
||||
@ApiModel(value = "nu_can_add_directive对象", description = "可新增指令")
|
||||
public class CanAddDirective implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.String id;
|
||||
/**指令ID*/
|
||||
/**
|
||||
* 指令ID
|
||||
*/
|
||||
@Excel(name = "指令ID", width = 15)
|
||||
@ApiModelProperty(value = "指令ID")
|
||||
private java.lang.String directiveId;
|
||||
/**分类标签*/
|
||||
@Excel(name = "分类标签", width = 15)
|
||||
/**
|
||||
* 分类标签
|
||||
*/
|
||||
@Excel(name = "分类标签", width = 15)
|
||||
@ApiModelProperty(value = "分类标签")
|
||||
private java.lang.String instructionTag;
|
||||
/**服务类别*/
|
||||
@Excel(name = "服务类别", width = 15)
|
||||
/**
|
||||
* 服务类别
|
||||
*/
|
||||
@Excel(name = "服务类别", width = 15)
|
||||
@ApiModelProperty(value = "服务类别")
|
||||
private java.lang.String category;
|
||||
/**服务类型*/
|
||||
@Excel(name = "服务类型", width = 15)
|
||||
/**
|
||||
* 服务类型
|
||||
*/
|
||||
@Excel(name = "服务类型", width = 15)
|
||||
@ApiModelProperty(value = "服务类型")
|
||||
private java.lang.String type;
|
||||
/**服务指令*/
|
||||
@Excel(name = "服务指令", width = 15)
|
||||
/**
|
||||
* 服务指令
|
||||
*/
|
||||
@Excel(name = "服务指令", width = 15)
|
||||
@ApiModelProperty(value = "服务指令")
|
||||
private java.lang.String directiveName;
|
||||
/**周期类型 1日常护理 2周期护理 3即时护理*/
|
||||
@Excel(name = "周期类型", width = 15)
|
||||
/**
|
||||
* 周期类型 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)
|
||||
/**
|
||||
* 收费价格
|
||||
*/
|
||||
@Excel(name = "收费价格", width = 15)
|
||||
@ApiModelProperty(value = "收费价格")
|
||||
private java.math.BigDecimal tollPrice;
|
||||
/**
|
||||
* 提成价格
|
||||
*/
|
||||
@Excel(name = "提成价格", width = 15)
|
||||
@ApiModelProperty(value = "提成价格")
|
||||
private java.math.BigDecimal comPrice;
|
||||
/**
|
||||
* 服务描述
|
||||
*/
|
||||
@Excel(name = "服务描述", width = 15)
|
||||
@ApiModelProperty(value = "服务描述")
|
||||
private java.lang.String serviceContent;
|
||||
/**
|
||||
* 服务时长(分钟)
|
||||
*/
|
||||
@Excel(name = "服务时长(分钟)", width = 15)
|
||||
@ApiModelProperty(value = "服务时长(分钟)")
|
||||
private java.lang.String serviceDuration;
|
||||
/**
|
||||
* 是否删除 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")
|
||||
/**
|
||||
* 创建日期
|
||||
*/
|
||||
@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")
|
||||
/**
|
||||
* 更新日期
|
||||
*/
|
||||
@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")
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
@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;
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,202 @@
|
|||
package com.nu.modules.directivebk.controller;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
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.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
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.system.vo.LoginUser;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import com.nu.modules.directivebk.entity.DirectiveBkItem;
|
||||
import com.nu.modules.directivebk.service.IDirectiveBkItemService;
|
||||
|
||||
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.jeecg.config.JeecgBaseConfig;
|
||||
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-25
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags = "指令备份子表")
|
||||
@RestController
|
||||
@RequestMapping("/directivebk/directiveBkItem")
|
||||
@Slf4j
|
||||
public class DirectiveBkItemController extends JeecgController<DirectiveBkItem, IDirectiveBkItemService> {
|
||||
@Autowired
|
||||
private IDirectiveBkItemService directiveBkItemService;
|
||||
@Resource
|
||||
private JeecgBaseConfig jeecgBaseConfig;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param directiveBkItem
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "指令备份子表-分页列表查询")
|
||||
@ApiOperation(value = "指令备份子表-分页列表查询", notes = "指令备份子表-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<DirectiveBkItem>> queryPageList(DirectiveBkItem directiveBkItem, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
|
||||
QueryWrapper<DirectiveBkItem> queryWrapper = QueryGenerator.initQueryWrapper(directiveBkItem, req.getParameterMap());
|
||||
Page<DirectiveBkItem> page = new Page<DirectiveBkItem>(pageNo, pageSize);
|
||||
IPage<DirectiveBkItem> pageList = directiveBkItemService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param directiveBkItem
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "指令备份子表-添加")
|
||||
@ApiOperation(value = "指令备份子表-添加", notes = "指令备份子表-添加")
|
||||
@RequiresPermissions("directivebk:nu_directive_bk_item:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody DirectiveBkItem directiveBkItem) {
|
||||
directiveBkItemService.save(directiveBkItem);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param directiveBkItem
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "指令备份子表-编辑")
|
||||
@ApiOperation(value = "指令备份子表-编辑", notes = "指令备份子表-编辑")
|
||||
@RequiresPermissions("directivebk:nu_directive_bk_item:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody DirectiveBkItem directiveBkItem) {
|
||||
directiveBkItemService.updateById(directiveBkItem);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "指令备份子表-通过id删除")
|
||||
@ApiOperation(value = "指令备份子表-通过id删除", notes = "指令备份子表-通过id删除")
|
||||
@RequiresPermissions("directivebk:nu_directive_bk_item:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
directiveBkItemService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "指令备份子表-批量删除")
|
||||
@ApiOperation(value = "指令备份子表-批量删除", notes = "指令备份子表-批量删除")
|
||||
@RequiresPermissions("directivebk:nu_directive_bk_item:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
this.directiveBkItemService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "指令备份子表-通过id查询")
|
||||
@ApiOperation(value = "指令备份子表-通过id查询", notes = "指令备份子表-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<DirectiveBkItem> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
DirectiveBkItem directiveBkItem = directiveBkItemService.getById(id);
|
||||
if (directiveBkItem == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(directiveBkItem);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param directiveBkItem
|
||||
*/
|
||||
@RequiresPermissions("directivebk:nu_directive_bk_item:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, DirectiveBkItem directiveBkItem) {
|
||||
String title = "服务指令备份,备份时间:" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(directiveBkItem.getCreateTime_());
|
||||
QueryWrapper<DirectiveBkItem> queryWrapper = new QueryWrapper<>();
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
||||
queryWrapper.eq("pkid", directiveBkItem.getExportPkId());
|
||||
List<DirectiveBkItem> exportList = service.list(queryWrapper);
|
||||
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
//此处设置的filename无效 ,前端会重更新设置一下
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME, title);
|
||||
mv.addObject(NormalExcelConstants.CLASS, DirectiveBkItem.class);
|
||||
//update-begin--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置--------------------
|
||||
ExportParams exportParams = new ExportParams(title + "报表", "导出人:" + sysUser.getRealname(), title);
|
||||
exportParams.setImageBasePath(jeecgBaseConfig.getPath().getUpload());
|
||||
//update-end--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置----------------------
|
||||
mv.addObject(NormalExcelConstants.PARAMS, exportParams);
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, exportList);
|
||||
return mv;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("directivebk:nu_directive_bk_item:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, DirectiveBkItem.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,184 @@
|
|||
package com.nu.modules.directivebk.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.directivebk.entity.DirectiveBkMain;
|
||||
import com.nu.modules.directivebk.service.IDirectiveBkMainService;
|
||||
|
||||
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-25
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="指令备份主表")
|
||||
@RestController
|
||||
@RequestMapping("/directivebk/directiveBkMain")
|
||||
@Slf4j
|
||||
public class DirectiveBkMainController extends JeecgController<DirectiveBkMain, IDirectiveBkMainService> {
|
||||
@Autowired
|
||||
private IDirectiveBkMainService directiveBkMainService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param directiveBkMain
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "指令备份主表-分页列表查询")
|
||||
@ApiOperation(value="指令备份主表-分页列表查询", notes="指令备份主表-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<DirectiveBkMain>> queryPageList(DirectiveBkMain directiveBkMain,
|
||||
@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<DirectiveBkMain> queryWrapper = QueryGenerator.initQueryWrapper(directiveBkMain, req.getParameterMap(),customeRuleMap);
|
||||
Page<DirectiveBkMain> page = new Page<DirectiveBkMain>(pageNo, pageSize);
|
||||
IPage<DirectiveBkMain> pageList = directiveBkMainService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param directiveBkMain
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "指令备份主表-添加")
|
||||
@ApiOperation(value="指令备份主表-添加", notes="指令备份主表-添加")
|
||||
@RequiresPermissions("directivebk:nu_directive_bk_main:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody DirectiveBkMain directiveBkMain) {
|
||||
directiveBkMainService.save(directiveBkMain);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param directiveBkMain
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "指令备份主表-编辑")
|
||||
@ApiOperation(value="指令备份主表-编辑", notes="指令备份主表-编辑")
|
||||
@RequiresPermissions("directivebk:nu_directive_bk_main:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody DirectiveBkMain directiveBkMain) {
|
||||
directiveBkMainService.updateById(directiveBkMain);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "指令备份主表-通过id删除")
|
||||
@ApiOperation(value="指令备份主表-通过id删除", notes="指令备份主表-通过id删除")
|
||||
@RequiresPermissions("directivebk:nu_directive_bk_main:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
directiveBkMainService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "指令备份主表-批量删除")
|
||||
@ApiOperation(value="指令备份主表-批量删除", notes="指令备份主表-批量删除")
|
||||
@RequiresPermissions("directivebk:nu_directive_bk_main:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.directiveBkMainService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "指令备份主表-通过id查询")
|
||||
@ApiOperation(value="指令备份主表-通过id查询", notes="指令备份主表-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<DirectiveBkMain> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
DirectiveBkMain directiveBkMain = directiveBkMainService.getById(id);
|
||||
if(directiveBkMain==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(directiveBkMain);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param directiveBkMain
|
||||
*/
|
||||
@RequiresPermissions("directivebk:nu_directive_bk_main:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, DirectiveBkMain directiveBkMain) {
|
||||
return super.exportXls(request, directiveBkMain, DirectiveBkMain.class, "指令备份主表");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("directivebk:nu_directive_bk_main:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, DirectiveBkMain.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,228 @@
|
|||
package com.nu.modules.directivebk.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-25
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_directive_bk_item")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "nu_directive_bk_item对象", description = "指令备份子表")
|
||||
public class DirectiveBkItem implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.String id;
|
||||
/**
|
||||
* 所属机构
|
||||
*/
|
||||
@Excel(name = "所属机构", width = 50, dictTable = "sys_depart", dicText = "depart_name", dicCode = "org_code")
|
||||
@ApiModelProperty(value = "所属机构")
|
||||
@Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "org_code")
|
||||
private java.lang.String sysOrgCode;
|
||||
/**
|
||||
* 分类标签中文名称
|
||||
*/
|
||||
@Excel(name = "分类标签", width = 20)
|
||||
@ApiModelProperty(value = "分类标签中文名称")
|
||||
private java.lang.String instructionName;
|
||||
/**
|
||||
* 服务类别中文名称
|
||||
*/
|
||||
@Excel(name = "服务类别", width = 20)
|
||||
@ApiModelProperty(value = "服务类别中文名称")
|
||||
private java.lang.String categoryName;
|
||||
/**
|
||||
* 服务类型中文名称
|
||||
*/
|
||||
@Excel(name = "服务类型", width = 20)
|
||||
@ApiModelProperty(value = "服务类型中文名称")
|
||||
private java.lang.String typeName;
|
||||
/**
|
||||
* 服务指令名称
|
||||
*/
|
||||
@Excel(name = "服务指令名称", width = 40)
|
||||
@ApiModelProperty(value = "服务指令名称")
|
||||
private java.lang.String directiveName;
|
||||
/**
|
||||
* 周期类型中文名称
|
||||
*/
|
||||
@Excel(name = "周期类型", width = 20)
|
||||
@ApiModelProperty(value = "周期类型中文名称")
|
||||
private java.lang.String cycleTypeName;
|
||||
/**
|
||||
* 收费价格
|
||||
*/
|
||||
@Excel(name = "收费价格(元)", width = 20)
|
||||
@ApiModelProperty(value = "收费价格")
|
||||
private java.math.BigDecimal tollPrice;
|
||||
/**
|
||||
* 提成价格
|
||||
*/
|
||||
@Excel(name = "提成价格(元)", width = 20)
|
||||
@ApiModelProperty(value = "提成价格")
|
||||
private java.math.BigDecimal comPrice;
|
||||
/**
|
||||
* nu_directive_bk_main.id
|
||||
*/
|
||||
@ApiModelProperty(value = "nu_directive_bk_main.id")
|
||||
private java.lang.String pkid;
|
||||
/**
|
||||
* 服务指令id
|
||||
*/
|
||||
@ApiModelProperty(value = "nu_config_service_directive.id.id")
|
||||
private java.lang.String directiveId;
|
||||
/**
|
||||
* 服务类别id
|
||||
*/
|
||||
@ApiModelProperty(value = "服务类别id")
|
||||
private java.lang.String categoryId;
|
||||
/**
|
||||
* 服务类型id
|
||||
*/
|
||||
@ApiModelProperty(value = "服务类型id")
|
||||
private java.lang.String typeId;
|
||||
/**
|
||||
* 分类标签
|
||||
*/
|
||||
@ApiModelProperty(value = "分类标签")
|
||||
private java.lang.String instructionTagId;
|
||||
/**
|
||||
* 是否参与医保报销 0不报销 1报销
|
||||
*/
|
||||
@ApiModelProperty(value = "是否参与医保报销 0不报销 1报销")
|
||||
private java.lang.String izReimbursement;
|
||||
/**
|
||||
* 是否参与机构优惠 0不参与 1参与
|
||||
*/
|
||||
@ApiModelProperty(value = "是否参与机构优惠 0不参与 1参与")
|
||||
private java.lang.String izPreferential;
|
||||
/**
|
||||
* (废弃)收费频次 1按次收费 2按天收费
|
||||
*/
|
||||
@ApiModelProperty(value = "(废弃)收费频次 1按次收费 2按天收费")
|
||||
private java.lang.String chargingFrequency;
|
||||
/**
|
||||
* 周期类型 1日常护理 2周期护理 3即时护理
|
||||
*/
|
||||
@ApiModelProperty(value = "周期类型 1日常护理 2周期护理 3即时护理")
|
||||
private java.lang.String cycleType;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@ApiModelProperty(value = "排序")
|
||||
private java.lang.Integer sort;
|
||||
/**
|
||||
* 服务说明
|
||||
*/
|
||||
@Excel(name = "服务描述", width = 50)
|
||||
@ApiModelProperty(value = "服务描述")
|
||||
private java.lang.String serviceContent;
|
||||
/**
|
||||
* 服务时长(分钟)
|
||||
*/
|
||||
@Excel(name = "服务时长(分钟)", width = 18)
|
||||
@ApiModelProperty(value = "服务时长(分钟)")
|
||||
private java.lang.String serviceDuration;
|
||||
/**
|
||||
* 是否启用 0启用 1未启用
|
||||
*/
|
||||
@ApiModelProperty(value = "是否启用 0启用 1未启用")
|
||||
private java.lang.String izEnabled;
|
||||
/**
|
||||
* 是否删除 0未删除 1删除
|
||||
*/
|
||||
@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;
|
||||
/**
|
||||
* 语音文件
|
||||
*/
|
||||
@ApiModelProperty(value = "语音文件")
|
||||
private java.lang.String mp3File;
|
||||
/**
|
||||
* 视频文件
|
||||
*/
|
||||
@ApiModelProperty(value = "视频文件")
|
||||
private java.lang.String mp4File;
|
||||
/**
|
||||
* 服务指令图片大图
|
||||
*/
|
||||
@ApiModelProperty(value = "服务指令图片大图")
|
||||
private java.lang.String previewFile;
|
||||
/**
|
||||
* 服务指令图片小图
|
||||
*/
|
||||
@ApiModelProperty(value = "服务指令图片小图")
|
||||
private java.lang.String previewFileSmall;
|
||||
/**
|
||||
* 即时指令图片
|
||||
*/
|
||||
@ApiModelProperty(value = "即时指令图片")
|
||||
private java.lang.String immediateFile;
|
||||
/**
|
||||
* 状态 0正常 1未授权 2审核通过(已授权) 3审核不通过
|
||||
*/
|
||||
@ApiModelProperty(value = "状态 0正常 1未授权 2审核通过(已授权) 3审核不通过")
|
||||
private java.lang.String status;
|
||||
|
||||
//要导出的pkid
|
||||
@TableField(exist = false)
|
||||
private String exportPkId;
|
||||
/**
|
||||
* 导出用创建日期
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private java.util.Date createTime_;
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
package com.nu.modules.directivebk.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-25
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_directive_bk_main")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_directive_bk_main对象", description="指令备份主表")
|
||||
public class DirectiveBkMain implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.String id;
|
||||
/** 机构编码*/
|
||||
@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;
|
||||
/**备份时间*/
|
||||
@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;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.nu.modules.directivebk.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.nu.modules.directivebk.entity.DirectiveBkItem;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 指令备份子表
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-25
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface DirectiveBkItemMapper extends BaseMapper<DirectiveBkItem> {
|
||||
|
||||
void cleanBkByPhysical();
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.nu.modules.directivebk.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.nu.modules.directivebk.entity.DirectiveBkMain;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 指令备份主表
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-25
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface DirectiveBkMainMapper extends BaseMapper<DirectiveBkMain> {
|
||||
|
||||
void cleanBkByPhysical();
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
<?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.directivebk.mapper.DirectiveBkItemMapper">
|
||||
|
||||
<delete id="cleanBkByPhysical">
|
||||
<![CDATA[
|
||||
delete
|
||||
from nu_directive_bk_item
|
||||
where pkid in (select id from nu_directive_bk_main where create_time < NOW() - INTERVAL 8 DAY)
|
||||
]]>
|
||||
</delete>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
<?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.directivebk.mapper.DirectiveBkMainMapper">
|
||||
|
||||
<delete id="cleanBkByPhysical">
|
||||
<![CDATA[
|
||||
DELETE
|
||||
FROM nu_directive_bk_main
|
||||
WHERE create_time < NOW() - INTERVAL 8 DAY
|
||||
]]>
|
||||
</delete>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.nu.modules.directivebk.service;
|
||||
|
||||
import com.nu.modules.directivebk.entity.DirectiveBkItem;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 指令备份子表
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-25
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IDirectiveBkItemService extends IService<DirectiveBkItem> {
|
||||
|
||||
void cleanBkByPhysical();
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.nu.modules.directivebk.service;
|
||||
|
||||
import com.nu.modules.directivebk.entity.DirectiveBkMain;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 指令备份主表
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-25
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IDirectiveBkMainService extends IService<DirectiveBkMain> {
|
||||
|
||||
void cleanBkByPhysical();
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package com.nu.modules.directivebk.service.impl;
|
||||
|
||||
import com.nu.modules.directivebk.entity.DirectiveBkItem;
|
||||
import com.nu.modules.directivebk.mapper.DirectiveBkItemMapper;
|
||||
import com.nu.modules.directivebk.service.IDirectiveBkItemService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 指令备份子表
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-25
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class DirectiveBkItemServiceImpl extends ServiceImpl<DirectiveBkItemMapper, DirectiveBkItem> implements IDirectiveBkItemService {
|
||||
|
||||
/**
|
||||
* 删除一周前备份(真删)
|
||||
*/
|
||||
@Override
|
||||
public void cleanBkByPhysical() {
|
||||
baseMapper.cleanBkByPhysical();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package com.nu.modules.directivebk.service.impl;
|
||||
|
||||
import com.nu.modules.directivebk.entity.DirectiveBkMain;
|
||||
import com.nu.modules.directivebk.mapper.DirectiveBkMainMapper;
|
||||
import com.nu.modules.directivebk.service.IDirectiveBkMainService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 指令备份主表
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-25
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class DirectiveBkMainServiceImpl extends ServiceImpl<DirectiveBkMainMapper, DirectiveBkMain> implements IDirectiveBkMainService {
|
||||
|
||||
/**
|
||||
* 删除一周前备份(真删)
|
||||
*/
|
||||
@Override
|
||||
public void cleanBkByPhysical() {
|
||||
baseMapper.cleanBkByPhysical();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,216 @@
|
|||
package com.nu.modules.directivemedia.controller;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
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.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.directivemedia.entity.DirectiveMedia;
|
||||
import com.nu.modules.directivemedia.service.IDirectiveMediaService;
|
||||
import com.nu.modules.servicedirective.entity.ConfigServiceDirective;
|
||||
import com.nu.modules.sysconfig.ISysConfigApi;
|
||||
import com.nu.utils.RabbitMQUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.compress.utils.Lists;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
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.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令资源管理
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-18
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags = "服务指令资源管理")
|
||||
@RestController
|
||||
@RequestMapping("/services/directiveMedia")
|
||||
@Slf4j
|
||||
public class DirectiveMediaController extends JeecgController<DirectiveMedia, IDirectiveMediaService> {
|
||||
|
||||
@Value("${nu.org.master.code}")
|
||||
private String masterCode;
|
||||
@Autowired
|
||||
private IDirectiveMediaService directiveMediaService;
|
||||
@Autowired
|
||||
private RabbitMQUtil rabbitMQUtil;
|
||||
@Autowired
|
||||
private ISysBaseAPI sysBaseAPI;
|
||||
@Autowired
|
||||
private IAsyncMainService asyncMainService;
|
||||
@Autowired
|
||||
private IAsyncStatusService asyncStatusService;
|
||||
@Autowired
|
||||
private ISysConfigApi sysConfigApi;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param directiveMedia
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "服务指令资源管理-分页列表查询")
|
||||
@ApiOperation(value = "服务指令资源管理-分页列表查询", notes = "服务指令资源管理-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<DirectiveMedia>> queryPageList(DirectiveMedia directiveMedia,
|
||||
@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("instructionTagId", QueryRuleEnum.LIKE_WITH_OR);
|
||||
customeRuleMap.put("categoryId", QueryRuleEnum.LIKE_WITH_OR);
|
||||
customeRuleMap.put("typeId", QueryRuleEnum.LIKE_WITH_OR);
|
||||
customeRuleMap.put("cycleType", QueryRuleEnum.LIKE_WITH_OR);
|
||||
QueryWrapper<DirectiveMedia> queryWrapper = QueryGenerator.initQueryWrapper(directiveMedia, req.getParameterMap(), customeRuleMap);
|
||||
Page<DirectiveMedia> page = new Page<DirectiveMedia>(pageNo, pageSize);
|
||||
IPage<DirectiveMedia> pageList = directiveMediaService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param directiveMedia
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "服务指令资源管理-添加")
|
||||
@ApiOperation(value = "服务指令资源管理-添加", notes = "服务指令资源管理-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody DirectiveMedia directiveMedia) {
|
||||
// directiveMedia.setDirectiveId(masterCode + IdUtil.simpleUUID());
|
||||
directiveMediaService.handleMediaFile(directiveMedia);
|
||||
directiveMediaService.save(directiveMedia);
|
||||
directiveMedia.setDirectiveId("-1");
|
||||
//发送mq同步文件
|
||||
sendMQ(directiveMedia);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param directiveMedia
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "服务指令资源管理-编辑")
|
||||
@ApiOperation(value = "服务指令资源管理-编辑", notes = "服务指令资源管理-编辑")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody DirectiveMedia directiveMedia) {
|
||||
directiveMediaService.handleMediaFile(directiveMedia);
|
||||
directiveMediaService.updateById(directiveMedia);
|
||||
//发送mq同步文件
|
||||
sendMQ(directiveMedia);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "服务指令资源管理-通过id查询")
|
||||
@ApiOperation(value = "服务指令资源管理-通过id查询", notes = "服务指令资源管理-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<DirectiveMedia> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
DirectiveMedia directiveMedia = directiveMediaService.getById(id);
|
||||
if (directiveMedia == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(directiveMedia);
|
||||
}
|
||||
|
||||
private void sendMQ(DirectiveMedia directiveMedia) {
|
||||
JSONObject opeOpenUrl = sysConfigApi.getByKeyByDS("master", "ope_open_url");
|
||||
String opeApiAddress = opeOpenUrl.getString("configValue");
|
||||
if (opeApiAddress.endsWith("/")) {
|
||||
opeApiAddress = opeApiAddress.substring(0, opeApiAddress.length() - 1);
|
||||
}
|
||||
|
||||
DirectiveMQDto upDirectiveMQDto = new DirectiveMQDto();
|
||||
upDirectiveMQDto.setIzDirectiveMedia(true);
|
||||
List<ConfigServiceDirective> directives = Lists.newArrayList();
|
||||
ConfigServiceDirective directive = new ConfigServiceDirective();
|
||||
directive.setId(directiveMedia.getDirectiveId());//服务指令ID
|
||||
directive.setPreviewFile(directiveMedia.getPreviewFile());//服务指令图片大图
|
||||
directive.setPreviewFileMd5(directiveMedia.getPreviewFileMd5());//服务指令图片大图md5
|
||||
directive.setPreviewFileSmall(directiveMedia.getPreviewFileSmall());//服务指令图片小图
|
||||
directive.setPreviewFileSmallMd5(directiveMedia.getPreviewFileSmallMd5());//服务指令图片小图md5
|
||||
directive.setImmediateFile(directiveMedia.getImmediateFile());//即时指令图标
|
||||
directive.setImmediateFileMd5(directiveMedia.getImmediateFileMd5());//即时指令图标md5
|
||||
directive.setMp3File(directiveMedia.getMp3File());//指令音频文件
|
||||
directive.setMp3FileMd5(directiveMedia.getMp3FileMd5());//指令音频文件md5
|
||||
directive.setMp4File(directiveMedia.getMp4File());//指令视频文件
|
||||
directive.setMp4FileMd5(directiveMedia.getMp4FileMd5());//指令视频文件md5
|
||||
// directive.setIzEnabled("0");//启用
|
||||
// directive.setDelFlag("0");//未删除
|
||||
// directive.setTollPrice(new BigDecimal("0"));//收费价格0
|
||||
// directive.setComPrice(new BigDecimal("0"));//提成价格0
|
||||
// directive.setSort(0);//排序0
|
||||
// directive.setServiceContent(directiveMedia.getServiceContent());//服务指令描述
|
||||
// directive.setServiceDuration("0");//服务时长0分钟
|
||||
// directive.setSysOrgCode(masterCode);//所属机构
|
||||
// directive.setStatus("0");//状态正常(没有用也写上了)
|
||||
directives.add(directive);
|
||||
upDirectiveMQDto.setDirectiveList(BeanUtil.copyToList(directives, DirectiveAsyncMQDto.class));
|
||||
List<DirectiveAsyncMQDto> upDirectiveList = upDirectiveMQDto.getDirectiveList();
|
||||
for (int i = 0; i < upDirectiveList.size(); i++) {
|
||||
upDirectiveList.get(i).setApi(opeApiAddress);
|
||||
}
|
||||
new Thread(() -> {
|
||||
try {
|
||||
AsyncMain asyncMain = new AsyncMain();
|
||||
asyncMain.setType("directiveMediaManage");
|
||||
asyncMain.setOrgCode(masterCode);
|
||||
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(masterCode);
|
||||
asyncStatusService.saveData("master", asyncStatus_file);
|
||||
|
||||
rabbitMQUtil.sendToExchange("hldy.directive", masterCode + ".directive.createmedia", upDirectiveMQDto);
|
||||
// 发送完后,休眠 5 分钟
|
||||
// Thread.sleep(TimeUnit.MINUTES.toMillis(5));
|
||||
// } catch (InterruptedException e) {
|
||||
} catch (Exception e) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,147 @@
|
|||
package com.nu.modules.directivemedia.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.beans.factory.annotation.Value;
|
||||
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-18
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_directive_media")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "nu_directive_media对象", description = "服务指令资源管理")
|
||||
public class DirectiveMedia 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 directiveName;
|
||||
/**
|
||||
* 分类标签id
|
||||
*/
|
||||
@Excel(name = "分类标签id", width = 15)
|
||||
@ApiModelProperty(value = "分类标签id")
|
||||
//数据源从配置文件读取 - 实验基地机构编码
|
||||
@Dict(dicCode = "id", dictTable = "nu_config_service_instruction_tag", dicText = "instruction_name", ds = "${nu.org.master.code}")
|
||||
|
||||
private java.lang.String instructionTagId;
|
||||
/**
|
||||
* 服务类别id
|
||||
*/
|
||||
@Excel(name = "服务类别id", width = 15)
|
||||
@ApiModelProperty(value = "服务类别id")
|
||||
@Dict(dicCode = "id", dictTable = "nu_config_service_category", dicText = "category_name", ds = "${nu.org.master.code}")
|
||||
private java.lang.String categoryId;
|
||||
/**
|
||||
* 服务类型id
|
||||
*/
|
||||
@Excel(name = "服务类型id", width = 15)
|
||||
@ApiModelProperty(value = "服务类型id")
|
||||
@Dict(dicCode = "id", dictTable = "nu_config_service_type", dicText = "type_name", ds = "${nu.org.master.code}")
|
||||
private java.lang.String typeId;
|
||||
/**
|
||||
* 周期类型
|
||||
*/
|
||||
@Excel(name = "周期类型", width = 15)
|
||||
@ApiModelProperty(value = "周期类型")
|
||||
@Dict(dicCode = "period_type", ds = "${nu.org.master.code}")
|
||||
private java.lang.String cycleType;
|
||||
/**
|
||||
* 服务指令图片大图
|
||||
*/
|
||||
@Excel(name = "服务指令图片大图", width = 15)
|
||||
@ApiModelProperty(value = "服务指令图片大图")
|
||||
private java.lang.String previewFile;
|
||||
/**
|
||||
* 服务指令图片大图md5
|
||||
*/
|
||||
@ApiModelProperty(value = "服务指令图片大图md5")
|
||||
private java.lang.String previewFileMd5;
|
||||
/**
|
||||
* 服务指令图片小图
|
||||
*/
|
||||
@Excel(name = "服务指令图片小图", width = 15)
|
||||
@ApiModelProperty(value = "服务指令图片小图")
|
||||
private java.lang.String previewFileSmall;
|
||||
/**
|
||||
* 服务指令图片小图md5
|
||||
*/
|
||||
@ApiModelProperty(value = "服务指令图片小图md5")
|
||||
private java.lang.String previewFileSmallMd5;
|
||||
/**
|
||||
* 即时指令图标
|
||||
*/
|
||||
@Excel(name = "即时指令图标", width = 15)
|
||||
@ApiModelProperty(value = "即时指令图标")
|
||||
private java.lang.String immediateFile;
|
||||
/**
|
||||
* 即时指令图标md5
|
||||
*/
|
||||
@ApiModelProperty(value = "即时指令图标md5")
|
||||
private java.lang.String immediateFileMd5;
|
||||
/**
|
||||
* 指令音频文件
|
||||
*/
|
||||
@ApiModelProperty(value = "指令音频文件")
|
||||
private java.lang.String mp3File;
|
||||
/**
|
||||
* 指令音频文件md5
|
||||
*/
|
||||
@ApiModelProperty(value = "指令音频文件md5")
|
||||
private java.lang.String mp3FileMd5;
|
||||
/**
|
||||
* 指令视频文件
|
||||
*/
|
||||
@ApiModelProperty(value = "指令视频文件")
|
||||
private java.lang.String mp4File;
|
||||
/**
|
||||
* 指令视频文件md5
|
||||
*/
|
||||
@ApiModelProperty(value = "指令视频文件md5")
|
||||
private java.lang.String mp4FileMd5;
|
||||
/**
|
||||
* 服务描述
|
||||
*/
|
||||
@Excel(name = "服务描述", width = 15)
|
||||
@ApiModelProperty(value = "服务描述")
|
||||
private java.lang.String serviceContent;
|
||||
|
||||
//媒体资源存储路径名
|
||||
@TableField(exist = false)
|
||||
private String mediaFileSavePath;
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.nu.modules.directivemedia.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.nu.modules.directivemedia.entity.DirectiveMedia;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令资源管理
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-18
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface DirectiveMediaMapper extends BaseMapper<DirectiveMedia> {
|
||||
|
||||
}
|
||||
|
|
@ -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.directivemedia.mapper.DirectiveMediaMapper">
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.nu.modules.directivemedia.service;
|
||||
|
||||
import com.nu.modules.directivemedia.entity.DirectiveMedia;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.nu.modules.servicedirective.entity.ConfigServiceDirective;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令资源管理
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-18
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IDirectiveMediaService extends IService<DirectiveMedia> {
|
||||
|
||||
void handleMediaFile(DirectiveMedia directiveMedia);
|
||||
}
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
package com.nu.modules.directivemedia.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.modules.directivemedia.entity.DirectiveMedia;
|
||||
import com.nu.modules.directivemedia.mapper.DirectiveMediaMapper;
|
||||
import com.nu.modules.directivemedia.service.IDirectiveMediaService;
|
||||
import com.nu.utils.NuFileUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令资源管理
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-18
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class DirectiveMediaServiceImpl extends ServiceImpl<DirectiveMediaMapper, DirectiveMedia> implements IDirectiveMediaService {
|
||||
|
||||
/**
|
||||
* 处理资源文件
|
||||
* 1、检测各资源文件的存储路径是否跟路径字段的值一致
|
||||
* 2、如果不一致1)检测缺少的路径新建目录 2)然后把资源挪到新路径中 3)修改媒体资源对应字段的值的路径名
|
||||
*
|
||||
* @param directiveMedia
|
||||
*/
|
||||
@Override
|
||||
public void handleMediaFile(DirectiveMedia directiveMedia) {
|
||||
//需要存储的路径
|
||||
String mediaFileSavePath = directiveMedia.getMediaFileSavePath() ;
|
||||
//服务指令图片大图
|
||||
String previewFile = directiveMedia.getPreviewFile();
|
||||
//服务指令图片小图
|
||||
String previewFileSmall = directiveMedia.getPreviewFileSmall();
|
||||
//即时指令图标
|
||||
String immediateFile = directiveMedia.getImmediateFile();
|
||||
//指令音频文件
|
||||
String mp3File = directiveMedia.getMp3File();
|
||||
//指令视频文件
|
||||
String mp4File = directiveMedia.getMp4File();
|
||||
|
||||
// 处理每个文件并获取更新后的路径
|
||||
Map<String, String> newPreviewFileMap = NuFileUtils.processFile(mediaFileSavePath, previewFile);
|
||||
Map<String, String> newPreviewFileSmallMap = NuFileUtils.processFile(mediaFileSavePath, previewFileSmall);
|
||||
Map<String, String> newImmediateFileMap = NuFileUtils.processFile(mediaFileSavePath, immediateFile);
|
||||
Map<String, String> newMp3FileMap = NuFileUtils.processFile(mediaFileSavePath, mp3File);
|
||||
Map<String, String> newMp4FileMap = NuFileUtils.processFile(mediaFileSavePath, mp4File);
|
||||
|
||||
// 如果有变化,更新directiveMedia对象
|
||||
if (newPreviewFileMap != null) {
|
||||
directiveMedia.setPreviewFile(newPreviewFileMap.get("path"));
|
||||
directiveMedia.setPreviewFileMd5(newPreviewFileMap.get("md5"));
|
||||
}
|
||||
if (newPreviewFileSmallMap != null) {
|
||||
directiveMedia.setPreviewFileSmall(newPreviewFileSmallMap.get("path"));
|
||||
directiveMedia.setPreviewFileSmallMd5(newPreviewFileSmallMap.get("md5"));
|
||||
}
|
||||
if (newImmediateFileMap != null) {
|
||||
directiveMedia.setImmediateFile(newImmediateFileMap.get("path"));
|
||||
directiveMedia.setImmediateFileMd5(newImmediateFileMap.get("md5"));
|
||||
}
|
||||
if (newMp3FileMap != null) {
|
||||
directiveMedia.setMp3File(newMp3FileMap.get("path"));
|
||||
directiveMedia.setMp3FileMd5(newMp3FileMap.get("md5"));
|
||||
}
|
||||
if (newMp4FileMap != null) {
|
||||
directiveMedia.setMp4File(newMp4FileMap.get("path"));
|
||||
directiveMedia.setMp4FileMd5(newMp4FileMap.get("md5"));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -140,6 +140,10 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
|||
@GetMapping(value = "/listByDS")
|
||||
@DS("#dataSourceCode")
|
||||
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) {
|
||||
if(StringUtils.isNotBlank(configServiceDirective.getQueryIds())){
|
||||
//按id查询时去除启用/停用
|
||||
configServiceDirective.setIzEnabled(null);
|
||||
}
|
||||
if (StringUtils.isBlank(dataSourceCode)) {
|
||||
return Result.ok(new Page<ConfigServiceDirective>());
|
||||
}
|
||||
|
|
@ -184,6 +188,9 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
|||
if (StringUtils.isNotBlank(configServiceDirective.getExcludeIds())) {
|
||||
queryWrapper.notIn("id", configServiceDirective.getExcludeIds().split(","));
|
||||
}
|
||||
if(StringUtils.isNotBlank(configServiceDirective.getQueryIds())){
|
||||
queryWrapper.in("id",configServiceDirective.getQueryIds().split(","));
|
||||
}
|
||||
Page<ConfigServiceDirective> page = new Page<ConfigServiceDirective>(pageNo, pageSize);
|
||||
IPage<ConfigServiceDirective> list = configServiceDirectiveService.page(page, queryWrapper);
|
||||
List<ConfigServiceDirective> pageList = service.pageList(configServiceDirective, list);
|
||||
|
|
|
|||
|
|
@ -19,151 +19,222 @@ import java.util.List;
|
|||
/**
|
||||
* @Description: 服务指令
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-03-13
|
||||
* @Date: 2025-03-13
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_config_service_directive")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_config_service_directive对象", description="服务指令")
|
||||
@ApiModel(value = "nu_config_service_directive对象", description = "服务指令")
|
||||
public class ConfigServiceDirective implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.String id;
|
||||
/**服务类别id*/
|
||||
@Excel(name = "服务类别", width = 15)
|
||||
/**
|
||||
* 服务类别id
|
||||
*/
|
||||
@Excel(name = "服务类别", width = 15)
|
||||
@ApiModelProperty(value = "服务类别")
|
||||
@Dict(dicCode = "id" , dictTable = "nu_config_service_category" , dicText = "category_name")
|
||||
@Dict(dicCode = "id", dictTable = "nu_config_service_category", dicText = "category_name")
|
||||
private java.lang.String categoryId;
|
||||
/**服务类型id*/
|
||||
@Excel(name = "服务类型", width = 15)
|
||||
/**
|
||||
* 服务类型id
|
||||
*/
|
||||
@Excel(name = "服务类型", width = 15)
|
||||
@ApiModelProperty(value = "服务类型")
|
||||
@Dict(dicCode = "id" , dictTable = "nu_config_service_type" , dicText = "type_name")
|
||||
@Dict(dicCode = "id", dictTable = "nu_config_service_type", dicText = "type_name")
|
||||
private java.lang.String typeId;
|
||||
/**分类标签*/
|
||||
@Excel(name = "分类标签", width = 15)
|
||||
/**
|
||||
* 分类标签
|
||||
*/
|
||||
@Excel(name = "分类标签", width = 15)
|
||||
@ApiModelProperty(value = "分类标签")
|
||||
@Dict(dicCode = "id" , dictTable = "nu_config_service_instruction_tag" , dicText = "instruction_name")
|
||||
@Dict(dicCode = "id", dictTable = "nu_config_service_instruction_tag", dicText = "instruction_name")
|
||||
private java.lang.String instructionTagId;
|
||||
/**服务指令名称*/
|
||||
@Excel(name = "服务指令名称", width = 15)
|
||||
/**
|
||||
* 服务指令名称
|
||||
*/
|
||||
@Excel(name = "服务指令名称", width = 15)
|
||||
@ApiModelProperty(value = "服务指令名称")
|
||||
private java.lang.String directiveName;
|
||||
/**收费价格*/
|
||||
@Excel(name = "收费价格", width = 15)
|
||||
/**
|
||||
* 收费价格
|
||||
*/
|
||||
@Excel(name = "收费价格", width = 15)
|
||||
@ApiModelProperty(value = "收费价格")
|
||||
private java.math.BigDecimal tollPrice;
|
||||
/**提成价格*/
|
||||
@Excel(name = "提成价格", width = 15)
|
||||
/**
|
||||
* 提成价格
|
||||
*/
|
||||
@Excel(name = "提成价格", width = 15)
|
||||
@ApiModelProperty(value = "提成价格")
|
||||
private java.math.BigDecimal comPrice;
|
||||
/**是否参与医保报销 0不报销 1报销*/
|
||||
@Excel(name = "医保报销", width = 15)
|
||||
/**
|
||||
* 是否参与医保报销 0不报销 1报销
|
||||
*/
|
||||
@Excel(name = "医保报销", width = 15)
|
||||
@ApiModelProperty(value = "医保报销")
|
||||
@Dict(dicCode = "med_ins_reimb" )
|
||||
@Dict(dicCode = "med_ins_reimb")
|
||||
private java.lang.String izReimbursement;
|
||||
/**是否参与机构优惠 0不参与 1参与*/
|
||||
@Excel(name = "机构优惠", width = 15)
|
||||
/**
|
||||
* 是否参与机构优惠 0不参与 1参与
|
||||
*/
|
||||
@Excel(name = "机构优惠", width = 15)
|
||||
@ApiModelProperty(value = "机构优惠")
|
||||
@Dict(dicCode = "institutional_discount" )
|
||||
@Dict(dicCode = "institutional_discount")
|
||||
private java.lang.String izPreferential;
|
||||
/**收费频次 1按次收费 2按天收费*/
|
||||
@Excel(name = "收费频次", width = 15)
|
||||
/**
|
||||
* 收费频次 1按次收费 2按天收费
|
||||
*/
|
||||
@Excel(name = "收费频次", width = 15)
|
||||
@ApiModelProperty(value = "收费频次")
|
||||
@Dict(dicCode = "billing_frequency" )
|
||||
@Dict(dicCode = "billing_frequency")
|
||||
private java.lang.String chargingFrequency;
|
||||
/**周期类型 1日常护理 2周期护理 3即时护理*/
|
||||
@Excel(name = "周期类型", width = 15)
|
||||
/**
|
||||
* 周期类型 1日常护理 2周期护理 3即时护理
|
||||
*/
|
||||
@Excel(name = "周期类型", width = 15)
|
||||
@ApiModelProperty(value = "周期类型")
|
||||
@Dict(dicCode = "period_type" )
|
||||
@Dict(dicCode = "period_type")
|
||||
private java.lang.String cycleType;
|
||||
/**排序*/
|
||||
@Excel(name = "排序", width = 15)
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@Excel(name = "排序", width = 15)
|
||||
@ApiModelProperty(value = "排序")
|
||||
private java.lang.Integer sort;
|
||||
/**服务描述*/
|
||||
@Excel(name = "服务描述", width = 15)
|
||||
/**
|
||||
* 服务描述
|
||||
*/
|
||||
@Excel(name = "服务描述", width = 15)
|
||||
@ApiModelProperty(value = "服务描述")
|
||||
private java.lang.String serviceContent;
|
||||
/**服务时长(分钟)*/
|
||||
@Excel(name = "服务时长(分钟)", width = 15)
|
||||
/**
|
||||
* 服务时长(分钟)
|
||||
*/
|
||||
@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)
|
||||
/**
|
||||
* 是否启用 0启用 1未启用
|
||||
*/
|
||||
@Excel(name = "是否启用", width = 15)
|
||||
@ApiModelProperty(value = "是否启用")
|
||||
@Dict(dicCode = "iz_enabled")
|
||||
private java.lang.String izEnabled;
|
||||
/**是否删除*/
|
||||
@Excel(name = "是否删除", width = 15)
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
@Excel(name = "是否删除", width = 15)
|
||||
@ApiModelProperty(value = "是否删除")
|
||||
@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")
|
||||
/**
|
||||
* 创建日期
|
||||
*/
|
||||
@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")
|
||||
/**
|
||||
* 更新日期
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private java.util.Date updateTime;
|
||||
/**所属部门*/
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
@Dict(dicCode = "org_code" , dictTable = "sys_depart" , dicText = "depart_name")
|
||||
@Dict(dicCode = "org_code", dictTable = "sys_depart", dicText = "depart_name")
|
||||
private java.lang.String sysOrgCode;
|
||||
/**指令音频文件*/
|
||||
/**
|
||||
* 指令音频文件
|
||||
*/
|
||||
@ApiModelProperty(value = "指令音频文件")
|
||||
private java.lang.String mp3File;
|
||||
//语音文件是否变更
|
||||
@TableField(exist = false)
|
||||
private boolean mp3FileChanged;
|
||||
/**指令视频文件*/
|
||||
/**
|
||||
* 指令视频文件
|
||||
*/
|
||||
@ApiModelProperty(value = "指令视频文件")
|
||||
private java.lang.String mp4File;
|
||||
//视频文件是否变更
|
||||
@TableField(exist = false)
|
||||
private boolean mp4FileChanged;
|
||||
/**服务指令图片*/
|
||||
@ApiModelProperty(value = "服务指令图片")
|
||||
/**
|
||||
* 服务指令图片
|
||||
*/
|
||||
@ApiModelProperty(value = "服务指令图片大图")
|
||||
private java.lang.String previewFile;
|
||||
/**指令音频文件md5*/
|
||||
/**
|
||||
* 服务指令图片小图
|
||||
*/
|
||||
@Excel(name = "服务指令图片小图", width = 15)
|
||||
@ApiModelProperty(value = "服务指令图片小图")
|
||||
private java.lang.String previewFileSmall;
|
||||
/**
|
||||
* 服务指令图片小图md5
|
||||
*/
|
||||
@ApiModelProperty(value = "服务指令图片小图md5")
|
||||
private java.lang.String previewFileSmallMd5;
|
||||
/**
|
||||
* 指令音频文件md5
|
||||
*/
|
||||
@ApiModelProperty(value = "指令音频文件md5")
|
||||
private java.lang.String mp3FileMd5;
|
||||
/**指令视频文件md5*/
|
||||
/**
|
||||
* 指令视频文件md5
|
||||
*/
|
||||
@ApiModelProperty(value = "指令视频文件md5")
|
||||
private java.lang.String mp4FileMd5;
|
||||
/**服务指令图片md5*/
|
||||
@ApiModelProperty(value = "服务指令图片md5")
|
||||
/**
|
||||
* 服务指令图片md5
|
||||
*/
|
||||
@ApiModelProperty(value = "服务指令图片大图md5")
|
||||
private java.lang.String previewFileMd5;
|
||||
/**即时指令图标md5*/
|
||||
/**
|
||||
* 即时指令图标md5
|
||||
*/
|
||||
@ApiModelProperty(value = "即时指令图标md5")
|
||||
private java.lang.String immediateFileMd5;
|
||||
|
||||
//服务指令图片是否变更
|
||||
@TableField(exist = false)
|
||||
private boolean previewFileChanged;
|
||||
/**即时指令图标*/
|
||||
/**
|
||||
* 即时指令图标
|
||||
*/
|
||||
@ApiModelProperty(value = "即时指令图标")
|
||||
private java.lang.String immediateFile;
|
||||
//即时指令图标是否变更
|
||||
@TableField(exist = false)
|
||||
@TableField(exist = false)
|
||||
private boolean immediateFileChanged;
|
||||
|
||||
//合并单元格用:类别合并的行数
|
||||
|
|
@ -216,9 +287,13 @@ public class ConfigServiceDirective implements Serializable {
|
|||
@TableField(exist = false)
|
||||
private String instructionTagName;
|
||||
@TableField(exist = false)
|
||||
private String queryIds;//需要查询的ids
|
||||
@TableField(exist = false)
|
||||
private String excludeIds;//需要排除的ids
|
||||
@TableField(exist = false)
|
||||
private String syncIds;//需要同步的的指令id,逗号拼接
|
||||
@TableField(exist = false)
|
||||
private String syncOrgCodes;//需要同步的指令的机构编码,逗号拼接
|
||||
@TableField(exist = false)
|
||||
private String compareOrgCode;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,4 +63,7 @@ public interface ConfigServiceDirectiveMapper extends BaseMapper<ConfigServiceDi
|
|||
int queryCountByEmotionTagIds(@Param("tagIds") List<String> tagIds);
|
||||
|
||||
int removeAll();
|
||||
|
||||
//字典翻译成中文
|
||||
List<ConfigServiceDirective> queryAndTranslate(@Param("existIds") String[] existIds);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,14 +98,16 @@
|
|||
ORDER BY c.category_id ASC, c.type_id ASC, c.instruction_tag_id ASC,c.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="queryDirectiveIdByBodyTagIds" resultType="com.nu.modules.servicedirective.entity.ConfigServiceDirective">
|
||||
<select id="queryDirectiveIdByBodyTagIds"
|
||||
resultType="com.nu.modules.servicedirective.entity.ConfigServiceDirective">
|
||||
SELECT distinct directive_id as id FROM nu_directive_body_tag WHERE tag_id IN
|
||||
<foreach collection="tagIds.split(',')" item="tagId" open="(" separator="," close=")">
|
||||
#{tagId}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="queryDirectiveIdByEmotionTagIds" resultType="com.nu.modules.servicedirective.entity.ConfigServiceDirective">
|
||||
<select id="queryDirectiveIdByEmotionTagIds"
|
||||
resultType="com.nu.modules.servicedirective.entity.ConfigServiceDirective">
|
||||
SELECT distinct directive_id as id FROM nu_directive_emotion_tag WHERE tag_id IN
|
||||
<foreach collection="tagIds.split(',')" item="tagId" open="(" separator="," close=")">
|
||||
#{tagId}
|
||||
|
|
@ -153,6 +155,54 @@
|
|||
</insert>
|
||||
|
||||
<delete id="removeAll">
|
||||
delete from nu_config_service_directive
|
||||
delete
|
||||
from nu_config_service_directive
|
||||
</delete>
|
||||
|
||||
<select id="queryAndTranslate" resultType="com.nu.modules.servicedirective.entity.ConfigServiceDirective">
|
||||
select
|
||||
m.id,
|
||||
m.instruction_tag_id,
|
||||
m.category_id,
|
||||
m.type_id,
|
||||
m.toll_price,
|
||||
m.com_price,
|
||||
m.cycle_type,
|
||||
m.service_duration,
|
||||
m.service_content,
|
||||
m.iz_enabled,
|
||||
m.del_flag,
|
||||
m.create_time,
|
||||
m.create_by,
|
||||
m.preview_file,
|
||||
m.preview_file_small,
|
||||
m.immediate_file,
|
||||
m.mp3_file,
|
||||
m.mp4_file,
|
||||
m.sys_org_code,
|
||||
m.status,
|
||||
i.instruction_name as instructionName,
|
||||
c.category_name as categoryName,
|
||||
t.type_name as typeName,
|
||||
m.directive_name,
|
||||
dic.dit as cycleTypeName
|
||||
from nu_config_service_directive m
|
||||
left join nu_config_service_instruction_tag i on m.instruction_tag_id = i.id
|
||||
left join nu_config_service_category c on m.category_id = c.id
|
||||
left join nu_config_service_type t on m.type_id = t.id
|
||||
left join (select di.item_value as diva, di.item_text as dit
|
||||
from sys_dict d
|
||||
left join sys_dict_item di on d.id = di.dict_id where d.dict_code = 'period_type') dic
|
||||
on m.cycle_type = dic.diva
|
||||
<where>
|
||||
m.iz_enabled = '0'
|
||||
<if test="existIds != null and existIds.length > 0">
|
||||
AND m.id NOT IN
|
||||
<foreach collection="existIds" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
order by m.create_time desc
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.nu.dto.DirectiveMQDto;
|
||||
import com.nu.modules.servicedirective.entity.ConfigServiceDirective;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -68,4 +69,6 @@ public interface IConfigServiceDirectiveService extends IService<ConfigServiceDi
|
|||
JSONObject getDeptInfo(String dataSourceCode,String orgCode);
|
||||
|
||||
List<ConfigServiceDirective> pageList(List<ConfigServiceDirective> param);
|
||||
|
||||
List<ConfigServiceDirective> queryAndTranslate(@Param("existIds") String[] existIds);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,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.directive.api.DirectiveApi;
|
||||
import com.nu.modules.directive.entity.DirectiveExportApiEntity;
|
||||
import com.nu.modules.directivetag.body.entity.DirectiveBodyTag;
|
||||
import com.nu.modules.directivetag.body.service.IDirectiveBodyTagService;
|
||||
import com.nu.modules.directivetag.emotion.entity.DirectiveEmotionTag;
|
||||
|
|
@ -49,7 +51,7 @@ import java.util.stream.Collectors;
|
|||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigServiceDirectiveMapper, ConfigServiceDirective> implements IConfigServiceDirectiveService {
|
||||
public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigServiceDirectiveMapper, ConfigServiceDirective> implements IConfigServiceDirectiveService, DirectiveApi {
|
||||
|
||||
@Value(value = "${jeecg.path.upload}")
|
||||
private String uploadpath;
|
||||
|
|
@ -415,6 +417,11 @@ public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigService
|
|||
return baseMapper.pageList(null, param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ConfigServiceDirective> queryAndTranslate(String[] existIds) {
|
||||
return baseMapper.queryAndTranslate(existIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param syncIds 需要同步的指令ID
|
||||
* @param syncOrgCodes 需要同步的目标平台orgCode
|
||||
|
|
@ -504,9 +511,10 @@ public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigService
|
|||
Arrays.stream(syncOrgCodes.split(",")).forEach(orgCode -> {
|
||||
AsyncMain asyncMain = new AsyncMain();
|
||||
asyncMain.setType("directive");
|
||||
asyncMain.setOrgCode(dataSourceCode);
|
||||
asyncMain.setOrgCode(dataSourceCode);//源机构
|
||||
asyncMain.setSyncIds(syncIds);//同步内容id(逗号分隔)
|
||||
asyncMain.setDescr("服务指令同步");
|
||||
asyncMainService.saveData("master",asyncMain);
|
||||
asyncMainService.saveData("master", asyncMain);
|
||||
directiveMQDto.setAsyncId(asyncMain.getId());
|
||||
|
||||
AsyncStatus asyncStatus_data = new AsyncStatus();
|
||||
|
|
@ -516,7 +524,7 @@ public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigService
|
|||
asyncStatus_data.setStatus(MQStatus.LOADING.getCode() + "");
|
||||
asyncStatus_data.setMsg("同步中");
|
||||
asyncStatus_data.setTargetOrgCode(orgCode);
|
||||
asyncStatusService.saveData("master",asyncStatus_data);
|
||||
asyncStatusService.saveData("master", asyncStatus_data);
|
||||
|
||||
if ("all".equals(syncOption) || "media".equals(syncOption)) {
|
||||
AsyncStatus asyncStatus_file = new AsyncStatus();
|
||||
|
|
@ -526,7 +534,7 @@ public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigService
|
|||
asyncStatus_file.setStatus(MQStatus.LOADING.getCode() + "");
|
||||
asyncStatus_file.setMsg("同步中");
|
||||
asyncStatus_file.setTargetOrgCode(orgCode);
|
||||
asyncStatusService.saveData("master",asyncStatus_file);
|
||||
asyncStatusService.saveData("master", asyncStatus_file);
|
||||
}
|
||||
rabbitMQUtil.sendToExchange("hldy.directive", orgCode + ".directive.syncDirective", directiveMQDto);
|
||||
});
|
||||
|
|
@ -535,7 +543,13 @@ public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigService
|
|||
|
||||
@DS("dataSourceCode")
|
||||
@Override
|
||||
public JSONObject getDeptInfo(String dataSourceCode,String orgCode) {
|
||||
public JSONObject getDeptInfo(String dataSourceCode, String orgCode) {
|
||||
return sysBaseAPI.getOrgInfo(orgCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DirectiveExportApiEntity> queryCompareDirectives() {
|
||||
List<ConfigServiceDirective> ownList = baseMapper.queryAndTranslate(null);
|
||||
return BeanUtil.copyToList(ownList, DirectiveExportApiEntity.class);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,10 +68,16 @@ public class DirectiveMQListener {
|
|||
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) {
|
||||
QueryWrapper<CanAddDirective> qw = new QueryWrapper<>();
|
||||
qw.eq("directive_id", dto.getId());
|
||||
CanAddDirective cd = canAddDirectiveService.getOne(qw);
|
||||
if (cd != null) {
|
||||
return;
|
||||
}
|
||||
|
||||
CanAddDirective canAddDirective = new CanAddDirective();
|
||||
canAddDirective.setDirectiveId(dto.getId());
|
||||
|
|
@ -82,6 +88,10 @@ public class DirectiveMQListener {
|
|||
canAddDirective.setCycleType(dto.getCycleTypeName());
|
||||
canAddDirective.setBodyTags(dto.getBodyTags());
|
||||
canAddDirective.setEmotionTags(dto.getEmotionTags());
|
||||
canAddDirective.setTollPrice(dto.getTollPrice());
|
||||
canAddDirective.setComPrice(dto.getComPrice());
|
||||
canAddDirective.setServiceContent(dto.getServiceContent());
|
||||
canAddDirective.setServiceDuration(dto.getServiceDuration());
|
||||
canAddDirective.setOrgCode(dto.getSysOrgCode());
|
||||
canAddDirective.setDelFlag("0");
|
||||
canAddDirectiveService.save(canAddDirective);
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ import org.jeecg.modules.system.model.DuplicateCheckVo;
|
|||
import org.jeecg.modules.system.model.TreeSelectModel;
|
||||
import org.jeecg.modules.system.service.ISysDepartService;
|
||||
import org.jeecg.modules.system.service.ISysDictService;
|
||||
import org.jeecg.modules.system.util.DictDsResolver;
|
||||
import org.jeecg.modules.system.vo.lowapp.SysDictVo;
|
||||
import org.mybatis.spring.MyBatisSystemException;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
|
@ -82,6 +83,8 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
|||
private IAsyncMainService asyncMainService;
|
||||
@Autowired
|
||||
private ISysDepartService departService;
|
||||
@Autowired
|
||||
private DictDsResolver dictDsResolver;
|
||||
|
||||
@Lazy
|
||||
@Autowired
|
||||
|
|
@ -405,6 +408,7 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
|||
//update-begin---author:chenrui ---date:20231221 for:[issues/#5643]解决分布式下表字典跨库无法查询问题------------
|
||||
// 切换为字典表的数据源
|
||||
if (isCustomDataSource) {
|
||||
dataSource = dictDsResolver.resolve(dataSource);
|
||||
DynamicDataSourceContextHolder.push(dataSource);
|
||||
}
|
||||
List<DictModel> restData = sysDictMapper.queryTableDictByKeysAndFilterSql(table, text, code, filterSql, codeValues);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,53 @@
|
|||
package org.jeecg.modules.system.util;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.expression.ExpressionParser;
|
||||
import org.springframework.expression.common.TemplateParserContext;
|
||||
import org.springframework.expression.spel.standard.SpelExpressionParser;
|
||||
import org.springframework.expression.spel.support.StandardEvaluationContext;
|
||||
import org.springframework.context.expression.BeanFactoryResolver;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
@Component
|
||||
public class DictDsResolver {
|
||||
@Autowired
|
||||
private Environment environment;
|
||||
@Autowired
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
private final ExpressionParser parser = new SpelExpressionParser();
|
||||
|
||||
/**
|
||||
* 解析 ds 原始值:
|
||||
* - 支持 ${...} 占位符(Environment.resolvePlaceholders)
|
||||
* - 支持 SpEL "#{...}"(可以访问 Spring Bean,如 @environment)
|
||||
* - 其它直接返回原字符串
|
||||
*/
|
||||
public String resolve(String dsRaw) {
|
||||
if (!StringUtils.hasText(dsRaw)) return null;
|
||||
|
||||
// 1. ${...} 占位符
|
||||
if (dsRaw.contains("${")) {
|
||||
try {
|
||||
String resolved = environment.resolvePlaceholders(dsRaw);
|
||||
if (StringUtils.hasText(resolved)) return resolved;
|
||||
} catch (Exception ignored) { }
|
||||
}
|
||||
|
||||
// 2. SpEL "#{...}"
|
||||
if (dsRaw.contains("#{")) {
|
||||
try {
|
||||
StandardEvaluationContext ctx = new StandardEvaluationContext();
|
||||
ctx.setBeanResolver(new BeanFactoryResolver(applicationContext.getAutowireCapableBeanFactory()));
|
||||
// template parser 可以解析包含 #{...} 的字符串
|
||||
return parser.parseExpression(dsRaw, new TemplateParserContext()).getValue(ctx, String.class);
|
||||
} catch (Exception ignored) { }
|
||||
}
|
||||
|
||||
// 3. 原样返回
|
||||
return dsRaw;
|
||||
}
|
||||
}
|
||||
|
|
@ -394,3 +394,9 @@ wxpay:
|
|||
notify-domain: https://www.focusnu.com/nursing-unit_0010507/weiXinPay/wx/callback
|
||||
# 商户私钥文件路径
|
||||
private-key-path: c://apiclient_key.pem
|
||||
|
||||
nu:
|
||||
org:
|
||||
#试验机构信息
|
||||
master:
|
||||
code: 101
|
||||
|
|
|
|||
|
|
@ -393,3 +393,9 @@ wxpay:
|
|||
notify-domain: https://www.focusnu.com/nursing-unit_0010507/weiXinPay/wx/callback
|
||||
# 商户私钥文件路径
|
||||
private-key-path: c://apiclient_key.pem
|
||||
|
||||
nu:
|
||||
org:
|
||||
#试验机构信息
|
||||
master:
|
||||
code: 101
|
||||
|
|
|
|||
Loading…
Reference in New Issue