Compare commits
3 Commits
1fdb860d1d
...
1c2c70d077
Author | SHA1 | Date |
---|---|---|
|
1c2c70d077 | |
|
9c5a150cbe | |
|
9ce21a8470 |
|
@ -1,20 +0,0 @@
|
|||
package com.nu.modules.mediamanage;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.nu.dto.MediaManageMQDto;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface IMediaManageApi {
|
||||
|
||||
/**
|
||||
* 根据ids查询数据
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
List<JSONObject> queryByIds(List<String> ids);
|
||||
|
||||
void saveOrUpdate(MediaManageMQDto m, boolean isSave);
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package com.nu.modules.mediamanage.api;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.nu.modules.mediamanage.entity.MediaManageDto;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface IMediaManageApi {
|
||||
|
||||
/**
|
||||
* 根据ids查询数据
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
List<JSONObject> queryByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 根据ids查询数据
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
List<JSONObject> queryByIdsHandlePath(List<String> ids);
|
||||
|
||||
/**
|
||||
* 新增数据:将新上传的资源存储到媒体资源中
|
||||
* @param filePath 文件相对路径
|
||||
* @return
|
||||
*/
|
||||
String saveByPath(String filePath, Map<String,String> params);
|
||||
|
||||
List<JSONObject> selectByDirectiveIds(String dataSourceCode, List<String> idList);
|
||||
|
||||
void saveOrUpdate(MediaManageDto m, boolean isSave);
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
package com.nu.modules.mediamanage.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description: 媒体资源管理
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-05-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
public class MediaManageDto implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
private String id;
|
||||
/**名称*/
|
||||
private String name;
|
||||
/**备注*/
|
||||
private String descr;
|
||||
/**文件类型*/
|
||||
private String fileType;
|
||||
/**系统功能*/
|
||||
private String sysFunc;
|
||||
/**文件路径*/
|
||||
private String filePath;
|
||||
/**是否网络资源*/
|
||||
private String izNetUrl;
|
||||
/**是否删除*/
|
||||
private String delFlag;
|
||||
/**创建人*/
|
||||
private String createBy;
|
||||
/**创建日期*/
|
||||
private Date createTime;
|
||||
/**更新人*/
|
||||
private String updateBy;
|
||||
/**更新日期*/
|
||||
private Date updateTime;
|
||||
|
||||
private String netFilePath;
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package com.nu.modules.mediamanage.service;
|
||||
package com.nu.modules.mediamanage.api;
|
||||
|
||||
import com.nu.modules.mediamanage.entity.MediaManage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
@ -0,0 +1,19 @@
|
|||
package com.nu.modules.mediamanage.api.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.modules.mediamanage.api.IMediaManageService;
|
||||
import com.nu.modules.mediamanage.entity.MediaManage;
|
||||
import com.nu.modules.mediamanage.mapper.MediaManageMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @Description: 媒体资源管理
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-05-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class MediaManageServiceImpl extends ServiceImpl<MediaManageMapper, MediaManage> implements IMediaManageService {
|
||||
|
||||
|
||||
}
|
|
@ -1,42 +1,24 @@
|
|||
package com.nu.modules.mediamanage.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 com.alibaba.fastjson.JSONObject;
|
||||
import com.nu.modules.sysconfig.ISysConfigApi;
|
||||
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.mediamanage.entity.MediaManage;
|
||||
import com.nu.modules.mediamanage.service.IMediaManageService;
|
||||
import com.nu.modules.mediamanage.api.IMediaManageService;
|
||||
|
||||
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;
|
||||
|
|
|
@ -1,70 +0,0 @@
|
|||
package com.nu.modules.mediamanage.service.impl;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.nu.dto.MediaManageMQDto;
|
||||
import com.nu.modules.mediamanage.IMediaManageApi;
|
||||
import com.nu.modules.mediamanage.entity.MediaManage;
|
||||
import com.nu.modules.mediamanage.mapper.MediaManageMapper;
|
||||
import com.nu.modules.mediamanage.service.IMediaManageService;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 媒体资源管理
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-05-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class MediaManageServiceImpl extends ServiceImpl<MediaManageMapper, MediaManage> implements IMediaManageService, IMediaManageApi {
|
||||
@Autowired
|
||||
private ISysBaseAPI sysBaseAPI;
|
||||
|
||||
@Override
|
||||
public List<JSONObject> queryByIds(List<String> ids) {
|
||||
QueryWrapper<MediaManage> qw = new QueryWrapper<>();
|
||||
qw.in("id", ids);
|
||||
List<MediaManage> mediaManages = baseMapper.selectList(qw);
|
||||
|
||||
List<JSONObject> result = new ArrayList<>();
|
||||
for (MediaManage media : mediaManages) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("id", media.getId());
|
||||
json.put("name", media.getName());
|
||||
json.put("descr", media.getDescr());
|
||||
json.put("sysFunc", media.getSysFunc());
|
||||
json.put("fileType", media.getFileType());
|
||||
json.put("filePath", media.getFilePath());
|
||||
json.put("izNetUrl", media.getIzNetUrl());
|
||||
json.put("delFlag", media.getDelFlag());
|
||||
json.put("createBy", media.getCreateBy());
|
||||
json.put("createTime", media.getCreateTime());
|
||||
json.put("updateBy", media.getUpdateBy());
|
||||
json.put("updateTime", media.getUpdateTime());
|
||||
result.add(json);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveOrUpdate(MediaManageMQDto m, boolean isSave) {
|
||||
MediaManage mediaManage = new MediaManage();
|
||||
BeanUtils.copyProperties(m, mediaManage);
|
||||
|
||||
if (isSave) {
|
||||
baseMapper.insert(mediaManage);
|
||||
} else {
|
||||
baseMapper.updateById(mediaManage);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -206,30 +206,22 @@ public class OrgApplyInfoServiceImpl extends ServiceImpl<OrgApplyInfoMapper, Org
|
|||
baseMapper.updateById(orgApplyInfo);
|
||||
|
||||
} else {
|
||||
//buildStatus == ‘2’时才是审批流程
|
||||
if ("2".equals(orgApplyInfo.getBuildStatus())) {
|
||||
//buildStatus == ‘approvalPass’时代表加盟审批通过
|
||||
if ("approvalPass".equals(orgApplyInfo.getBuildStatus())) {
|
||||
if ("2".equals(orgApplyInfo.getStatus()) && orgApplyInfo.getFranchiseTime() == null) {
|
||||
//记录机构加盟时间
|
||||
orgApplyInfo.setFranchiseTime(new Date());
|
||||
}
|
||||
if ("2".equals(orgApplyInfo.getStatus())) {
|
||||
//机构信息是否可修改状态置为“可修改”
|
||||
orgApplyInfo.setModifyStatus("0");
|
||||
//将机构的构建状态置为“加盟合同”
|
||||
orgApplyInfo.setBuildStatus("3");
|
||||
|
||||
}
|
||||
//机构信息是否可修改状态置为“可修改”
|
||||
orgApplyInfo.setModifyStatus("0");
|
||||
//将机构的构建状态置为“加盟合同”
|
||||
orgApplyInfo.setBuildStatus("3");
|
||||
}
|
||||
//审批完成后的平台搭建流程
|
||||
else {
|
||||
if ("contractSave".equals(orgApplyInfo.getBuildStatusVal())) {
|
||||
//合同上传步骤 - 保存为草稿 暂无特殊处理
|
||||
}
|
||||
if ("contractSubmit".equals(orgApplyInfo.getBuildStatusVal())) {
|
||||
//合同上传步骤 - 保存并提交
|
||||
//将buildStatus置为“平台搭建”状态
|
||||
orgApplyInfo.setBuildStatus("4");
|
||||
}
|
||||
//审批完成后的平台搭建流程(合同上传并提交状态)
|
||||
if ("contractSubmit".equals(orgApplyInfo.getBuildStatus())) {
|
||||
//合同上传步骤 - 保存并提交
|
||||
//将buildStatus置为“平台搭建”状态
|
||||
orgApplyInfo.setBuildStatus("4");
|
||||
}
|
||||
//机构加盟审批流程
|
||||
baseMapper.updateById(orgApplyInfo);
|
||||
|
|
|
@ -1,184 +1,13 @@
|
|||
package com.nu.mq.mediamanage.listener;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.nu.dto.MediaManageMQDto;
|
||||
import com.nu.dto.StatusMQDto;
|
||||
import com.nu.modules.async.entity.AsyncMain;
|
||||
import com.nu.modules.async.service.IAsyncMainService;
|
||||
import com.nu.modules.mediaasyncerrorlog.entity.MediaAsyncErrorLog;
|
||||
import com.nu.modules.mediaasyncerrorlog.service.IMediaAsyncErrorLogService;
|
||||
import com.nu.modules.mediamanage.IMediaManageApi;
|
||||
import com.nu.modules.mediamanage.entity.MediaManage;
|
||||
import com.nu.modules.sysconfig.entity.SysConfig;
|
||||
import com.nu.modules.sysconfig.service.ISysConfigService;
|
||||
import com.nu.utils.FileDownloader;
|
||||
import com.nu.utils.SafetyUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.compress.utils.Lists;
|
||||
import org.springframework.amqp.core.ExchangeTypes;
|
||||
import org.springframework.amqp.rabbit.annotation.Exchange;
|
||||
import org.springframework.amqp.rabbit.annotation.Queue;
|
||||
import org.springframework.amqp.rabbit.annotation.QueueBinding;
|
||||
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.File;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class MediaManageMQListener {
|
||||
|
||||
@Value("${jeecg.path.upload}")
|
||||
private String upLoadPath;
|
||||
@Value("${jeecg.path.directivepath}")
|
||||
private String directiveUpLoadPath;
|
||||
|
||||
@Autowired
|
||||
private IMediaManageApi mediaManageApi;
|
||||
@Autowired
|
||||
private ISysConfigService sysConfigService;
|
||||
@Autowired
|
||||
private IMediaAsyncErrorLogService mediaAsyncErrorLogService;
|
||||
|
||||
@RabbitListener(bindings = @QueueBinding(value = @Queue(name = "mediamanage.async", durable = "true"), exchange = @Exchange(name = "hldy.mediamanage", type = ExchangeTypes.DIRECT), key = "mediamanage.async"), errorHandler = "mediaManageMQErrorHandler")
|
||||
public void handleMessage(List<Map<String, Object>> mediaMaps) {
|
||||
//转下对象,不然要改的代码太多
|
||||
List<MediaManageMQDto> list = mediaMaps.stream().map(this::convertToMediaManageMQDto).collect(Collectors.toList());
|
||||
|
||||
List<String> mediaIds = Lists.newArrayList();
|
||||
mediaMaps.stream().forEach(m -> {
|
||||
mediaIds.add((String) m.get("id"));
|
||||
});
|
||||
// 运维系统中的数据
|
||||
List<JSONObject> jsonObjects = mediaManageApi.queryByIds(mediaIds);
|
||||
Map<String, JSONObject> map = Maps.newHashMap();
|
||||
if (jsonObjects != null && !jsonObjects.isEmpty()) {
|
||||
jsonObjects.stream().forEach(j -> {
|
||||
map.put(j.getStr("id"), j);
|
||||
});
|
||||
}
|
||||
//map是运维系统媒体资源数据 m是试验田传过来的媒体资源数据
|
||||
list.stream().forEach(m -> {
|
||||
if (map.get(m.getId()) != null) {
|
||||
//处理同一条数据
|
||||
JSONObject enty = map.get(m.getId());
|
||||
MediaManage yewu = new MediaManage();//业务
|
||||
BeanUtils.copyProperties(m, yewu);
|
||||
MediaManage yunwei = new MediaManage();//运维
|
||||
yunwei.setId(enty.getStr("id"));
|
||||
yunwei.setName(enty.getStr("name"));
|
||||
yunwei.setDescr(enty.getStr("descr"));
|
||||
yunwei.setFileType(enty.getStr("fileType"));
|
||||
yunwei.setSysFunc(enty.getStr("sysFunc"));
|
||||
yunwei.setFilePath(enty.getStr("filePath"));
|
||||
yunwei.setIzNetUrl(enty.getStr("izNetUrl"));
|
||||
yunwei.setDelFlag(enty.getStr("delFlag"));
|
||||
yunwei.setCreateBy(enty.getStr("createBy"));
|
||||
yunwei.setCreateTime(enty.getDate("createTime"));
|
||||
yunwei.setUpdateBy(enty.getStr("updateBy"));
|
||||
yunwei.setUpdateTime(enty.getDate("updateTime"));
|
||||
//存储数据
|
||||
if (!yewu.equals(yunwei)) {
|
||||
mediaManageApi.saveOrUpdate(m, false);
|
||||
}
|
||||
//存储文件
|
||||
if (!yunwei.getFilePath().equals(m.getFilePath())) {
|
||||
handleSaveFile(m);
|
||||
}
|
||||
} else {
|
||||
//新增数据
|
||||
mediaManageApi.saveOrUpdate(m, true);
|
||||
handleSaveFile(m);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private MediaManageMQDto convertToMediaManageMQDto(Map<String, Object> map) {
|
||||
MediaManageMQDto dto = new MediaManageMQDto();
|
||||
dto.setId((String) map.get("id"));
|
||||
dto.setName((String) map.get("name"));
|
||||
dto.setDescr((String) map.get("descr"));
|
||||
dto.setFileType((String) map.get("fileType"));
|
||||
dto.setSysFunc((String) map.get("sysFunc"));
|
||||
dto.setFilePath((String) map.get("filePath"));
|
||||
dto.setIzNetUrl((String) map.get("izNetUrl"));
|
||||
dto.setDelFlag((String) map.get("delFlag"));
|
||||
dto.setCreateBy((String) map.get("createBy"));
|
||||
dto.setUpdateBy((String) map.get("updateBy"));
|
||||
dto.setNetFilePath((String) map.get("netFilePath"));
|
||||
return dto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理文件存储
|
||||
*
|
||||
* @param media
|
||||
*/
|
||||
private void handleSaveFile(MediaManageMQDto media) {
|
||||
try {
|
||||
LambdaQueryWrapper<SysConfig> qw = new LambdaQueryWrapper<>();
|
||||
qw.eq(SysConfig::getDelFlag, "0");
|
||||
qw.eq(SysConfig::getConfigKey, "directive_source_url");
|
||||
SysConfig urlObj = sysConfigService.getOne(qw);
|
||||
//试验田协议+域名(/ip+端口)
|
||||
String baseUrl = urlObj.getConfigValue();
|
||||
if (baseUrl.endsWith("/")) {
|
||||
baseUrl = baseUrl.substring(0, baseUrl.length() - 1); // 移除末尾斜杠
|
||||
}
|
||||
//通过系统上传的文件
|
||||
if ("local".equals(media.getIzNetUrl())) {
|
||||
qw = new LambdaQueryWrapper<>();
|
||||
qw.eq(SysConfig::getDelFlag, "0");
|
||||
qw.eq(SysConfig::getConfigKey, "directive_source_name");
|
||||
SysConfig nameObj = sysConfigService.getOne(qw);
|
||||
//获取到对应试验田的服务名 用于通过接口获取对应媒体资源文件
|
||||
String servName = nameObj.getConfigValue();
|
||||
if (servName.startsWith("/")) {
|
||||
servName = servName.substring(1);
|
||||
}
|
||||
//协议域名服务名
|
||||
String url = baseUrl + "/" + servName + "/sys/common/open/static/" + media.getFilePath() + "?name=" + SafetyUtil.getSecureKey();
|
||||
if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) {
|
||||
upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1);
|
||||
}
|
||||
String filePath = media.getFilePath();
|
||||
if (filePath.startsWith("/") || filePath.startsWith("\\")) {
|
||||
filePath = filePath.substring(1);
|
||||
}
|
||||
FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath.substring(0, filePath.lastIndexOf("/")), media.getFilePath().substring(media.getFilePath().lastIndexOf("/") + 1));
|
||||
}
|
||||
//存储到媒体资源公共目录中的媒体资源 通过nginx可以访问的静态资源
|
||||
if ("net".equals(media.getIzNetUrl())) {
|
||||
String filePath = media.getFilePath();
|
||||
if (filePath.startsWith("/")) {
|
||||
filePath = filePath.substring(1);
|
||||
}
|
||||
String url = baseUrl + "/" + filePath;
|
||||
if (directiveUpLoadPath.endsWith("/") || directiveUpLoadPath.endsWith("\\")) {
|
||||
directiveUpLoadPath = directiveUpLoadPath.substring(0, directiveUpLoadPath.length() - 1);
|
||||
}
|
||||
FileDownloader.downloadFile(url, directiveUpLoadPath, media.getFilePath().substring(media.getFilePath().lastIndexOf("/") + 1));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog();
|
||||
mediaAsyncErrorLog.setMediaid(media.getId());
|
||||
mediaAsyncErrorLogService.save(mediaAsyncErrorLog);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
package com.nu.modules.common;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.common.collect.Maps;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 获取常用信息(不涉及安全信息)
|
||||
* @author zmy
|
||||
* @date 2025-5-22 08:43:05
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/baseInfo")
|
||||
public class SysBaseInfoApi {
|
||||
|
||||
@Lazy
|
||||
@Autowired
|
||||
private ISysBaseAPI sysBaseAPI;
|
||||
|
||||
/**
|
||||
* 返回机构信息配置的"协议域名"
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sysUrl")
|
||||
public Result<?> sysUrl(){
|
||||
JSONObject deptInfo = sysBaseAPI.getDeptInfo();
|
||||
Map<String,Object> result = Maps.newHashMap();
|
||||
result.put("url",deptInfo.getString("url"));
|
||||
return Result.ok(result);
|
||||
}
|
||||
}
|
|
@ -124,6 +124,7 @@ public class ShiroConfig {
|
|||
filterChainDefinitionMap.put("/nuIpadApi/versionManage/versionUpdate", "anon");//pad端版本检测接口
|
||||
filterChainDefinitionMap.put("/api/ocr/**", "anon");//阿里云证件识别
|
||||
filterChainDefinitionMap.put("/api/proxy/**", "anon");//代理请求
|
||||
filterChainDefinitionMap.put("/api/baseInfo/**", "anon");//获取系统中信息
|
||||
|
||||
//update-begin--Author:scott Date:20221116 for:排除静态资源后缀
|
||||
filterChainDefinitionMap.put("/", "anon");
|
||||
|
|
|
@ -1,48 +1,48 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nursing-unit-services</artifactId>
|
||||
<version>2.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nursing-unit-services</artifactId>
|
||||
<version>2.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>nu-services-biz</artifactId>
|
||||
<artifactId>nu-services-biz</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nu-services-local-api</artifactId>
|
||||
<version>${nursingunit.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<artifactId>hibernate-re</artifactId>
|
||||
</dependency>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nu-services-local-api</artifactId>
|
||||
<version>${nursingunit.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<artifactId>hibernate-re</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 企业微信/钉钉 api -->
|
||||
<dependency>
|
||||
<groupId>org.jeecgframework</groupId>
|
||||
<artifactId>weixin4j</artifactId>
|
||||
</dependency>
|
||||
<!-- 企业微信/钉钉 api -->
|
||||
<dependency>
|
||||
<groupId>org.jeecgframework</groupId>
|
||||
<artifactId>weixin4j</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 添加汉字转拼音依赖-->
|
||||
<dependency>
|
||||
<groupId>com.belerweb</groupId>
|
||||
<artifactId>pinyin4j</artifactId>
|
||||
<version>2.5.0</version>
|
||||
</dependency>
|
||||
<!-- COMMON 通用工具模块 -->
|
||||
<dependency>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nursing-unit-common</artifactId>
|
||||
<version>${nursingunit.version}</version>
|
||||
</dependency>
|
||||
<!-- 添加汉字转拼音依赖-->
|
||||
<dependency>
|
||||
<groupId>com.belerweb</groupId>
|
||||
<artifactId>pinyin4j</artifactId>
|
||||
<version>2.5.0</version>
|
||||
</dependency>
|
||||
<!-- COMMON 通用工具模块 -->
|
||||
<dependency>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nursing-unit-common</artifactId>
|
||||
<version>${nursingunit.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nu-system-local-api</artifactId>
|
||||
|
@ -55,6 +55,7 @@
|
|||
<version>2.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -2,6 +2,10 @@ package com.nu.modules.directivetag.body.mapper;
|
|||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nu.modules.directivetag.body.entity.DirectiveBodyTag;
|
||||
import com.nu.modules.directivetag.body.entity.DirectiveBodyTagRelation;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 体型标签
|
||||
|
@ -11,4 +15,6 @@ import com.nu.modules.directivetag.body.entity.DirectiveBodyTag;
|
|||
*/
|
||||
public interface DirectiveBodyTagMapper extends BaseMapper<DirectiveBodyTag> {
|
||||
|
||||
List<DirectiveBodyTag> selectAll(@Param("ids") List<String> ids,@Param("excludeIds") List<String> excludeIds);
|
||||
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.nu.modules.directivetag.body.mapper;
|
|||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nu.modules.directivetag.body.entity.DirectiveBodyTagRelation;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -12,7 +13,9 @@ import java.util.List;
|
|||
* @Version: V1.0
|
||||
*/
|
||||
public interface DirectiveBodyTagRelationMapper extends BaseMapper<DirectiveBodyTagRelation> {
|
||||
void removeAll();
|
||||
|
||||
void removeAllRelation();
|
||||
|
||||
List<DirectiveBodyTagRelation> selectAllRelation(List<String> ids);
|
||||
List<DirectiveBodyTagRelation> selectAllRelation(@Param("ids") List<String> ids,@Param("excludeIds") List<String> excludeIds);
|
||||
}
|
||||
|
|
|
@ -2,4 +2,19 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nu.modules.directivetag.body.mapper.DirectiveBodyTagMapper">
|
||||
|
||||
<select id="selectAll" resultType="com.nu.modules.directivetag.body.entity.DirectiveBodyTag">
|
||||
select distinct b.* from nu_config_body_tag b left join nu_directive_body_tag d on b.id = d.tag_id
|
||||
<where>
|
||||
d.directive_id in
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
<if test="excludeIds != null and excludeIds.size() > 0">
|
||||
AND b.id not in
|
||||
<foreach collection="excludeIds" item="excludeId" open="(" separator="," close=")">
|
||||
#{excludeId}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
@ -1,9 +1,14 @@
|
|||
<?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.directivetag.body.mapper.DirectiveBodyTagRelationMapper">
|
||||
<delete id="removeAll">
|
||||
delete from nu_config_body_tag
|
||||
</delete>
|
||||
|
||||
<delete id="removeAllRelation">
|
||||
delete from nu_directive_body_tag
|
||||
</delete>
|
||||
|
||||
<select id="selectAllRelation" resultType="com.nu.modules.directivetag.body.entity.DirectiveBodyTagRelation">
|
||||
select * from nu_directive_body_tag
|
||||
<where>
|
||||
|
@ -11,6 +16,12 @@
|
|||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
<if test="excludeIds != null and excludeIds.size() > 0">
|
||||
AND tag_id not in
|
||||
<foreach collection="excludeIds" item="excludeId" open="(" separator="," close=")">
|
||||
#{excludeId}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
@ -23,7 +23,11 @@ public interface IDirectiveBodyTagService extends IService<DirectiveBodyTag> {
|
|||
|
||||
public void removeAllRelation();
|
||||
|
||||
public List<DirectiveBodyTagRelation> selectAllRelation(String dataSourceCode, List<String> ids);
|
||||
public List<DirectiveBodyTagRelation> selectAllRelation(String dataSourceCode, List<String> ids,List<String> excludeIds);
|
||||
|
||||
void insertAllRelation(List<DirectiveBodyTagRelation> relations);
|
||||
|
||||
List<DirectiveBodyTag> selectAll(String dataSourceCode, List<String> ids,List<String> excludeIds);
|
||||
|
||||
void insertAll(List<DirectiveBodyTag> bodyAll);
|
||||
}
|
||||
|
|
|
@ -45,13 +45,14 @@ public class DirectiveBodyTagServiceImpl extends ServiceImpl<DirectiveBodyTagMap
|
|||
|
||||
@Override
|
||||
public void removeAllRelation() {
|
||||
tagRelationMapper.removeAll();
|
||||
tagRelationMapper.removeAllRelation();
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("#dataSourceCode")
|
||||
public List<DirectiveBodyTagRelation> selectAllRelation(String dataSourceCode, List<String> ids) {
|
||||
return tagRelationMapper.selectAllRelation(ids);
|
||||
public List<DirectiveBodyTagRelation> selectAllRelation(String dataSourceCode, List<String> ids,List<String> excludeIds) {
|
||||
return tagRelationMapper.selectAllRelation(ids,excludeIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -60,4 +61,17 @@ public class DirectiveBodyTagServiceImpl extends ServiceImpl<DirectiveBodyTagMap
|
|||
tagRelationMapper.insert(ir);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("#dataSourceCode")
|
||||
public List<DirectiveBodyTag> selectAll(String dataSourceCode, List<String> ids,List<String> excludeIds) {
|
||||
return baseMapper.selectAll(ids,excludeIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertAll(List<DirectiveBodyTag> bodyAll) {
|
||||
bodyAll.forEach(b -> {
|
||||
baseMapper.insert(b);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,28 +33,28 @@ public class DirectiveEmotionTag implements Serializable {
|
|||
/**id*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private String id;
|
||||
private java.lang.String id;
|
||||
/**标签名称*/
|
||||
@Excel(name = "标签名称", width = 15)
|
||||
@ApiModelProperty(value = "标签名称")
|
||||
private String tagName;
|
||||
private java.lang.String tagName;
|
||||
/**排序*/
|
||||
@Excel(name = "排序", width = 15)
|
||||
@ApiModelProperty(value = "排序")
|
||||
private Integer sort;
|
||||
private java.lang.Integer sort;
|
||||
/**是否启用 0启用 1未启用*/
|
||||
@Excel(name = "是否启用", width = 15, dicCode = "iz_enabled")
|
||||
@Dict(dicCode = "iz_enabled")
|
||||
@ApiModelProperty(value = "是否启用")
|
||||
private String izEnabled;
|
||||
private java.lang.String izEnabled;
|
||||
/**是否删除 0未删除 1删除*/
|
||||
@Excel(name = "是否删除", width = 15)
|
||||
@ApiModelProperty(value = "是否删除")
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
private java.lang.String delFlag;
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
private java.lang.String createBy;
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
|
@ -62,7 +62,7 @@ public class DirectiveEmotionTag implements Serializable {
|
|||
private java.util.Date createTime;
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateBy;
|
||||
private java.lang.String updateBy;
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
|
@ -70,5 +70,5 @@ public class DirectiveEmotionTag implements Serializable {
|
|||
private java.util.Date updateTime;
|
||||
/**所属部门*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private String sysOrgCode;
|
||||
private java.lang.String sysOrgCode;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
package com.nu.modules.directivetag.emotion.mapper;
|
||||
|
||||
import com.nu.modules.directivetag.emotion.entity.DirectiveEmotionTag;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nu.modules.directivetag.emotion.entity.DirectiveEmotionTag;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 情绪标签
|
||||
|
@ -11,4 +14,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
*/
|
||||
public interface DirectiveEmotionTagMapper extends BaseMapper<DirectiveEmotionTag> {
|
||||
|
||||
List<DirectiveEmotionTag> selectAll(@Param("ids") List<String> ids, @Param("excludeIds") List<String> excludeIds);
|
||||
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.nu.modules.directivetag.emotion.mapper;
|
|||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nu.modules.directivetag.emotion.entity.DirectiveEmotionTagRelation;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -12,7 +13,10 @@ import java.util.List;
|
|||
* @Version: V1.0
|
||||
*/
|
||||
public interface DirectiveEmotionTagRelationMapper extends BaseMapper<DirectiveEmotionTagRelation> {
|
||||
|
||||
void removeAll();
|
||||
|
||||
void removeAllRelation();
|
||||
|
||||
List<DirectiveEmotionTagRelation> selectAllRelation(List<String> ids);
|
||||
List<DirectiveEmotionTagRelation> selectAllRelation(@Param("ids") List<String> ids, @Param("excludeIds") List<String> excludeIds);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,19 @@
|
|||
<?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.directivetag.emotion.mapper.DirectiveEmotionTagMapper">
|
||||
|
||||
<select id="selectAll" resultType="com.nu.modules.directivetag.emotion.entity.DirectiveEmotionTag">
|
||||
select distinct e.* from nu_config_emotion_tag e left join nu_directive_emotion_tag d on e.id = d.tag_id
|
||||
<where>
|
||||
directive_id in
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
<if test="excludeIds != null and excludeIds.size() > 0">
|
||||
AND e.id not in
|
||||
<foreach collection="excludeIds" item="excludeId" open="(" separator="," close=")">
|
||||
#{excludeId}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
<?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.directivetag.emotion.mapper.DirectiveEmotionTagRelationMapper">
|
||||
<delete id="removeAll">
|
||||
delete
|
||||
from nu_config_emotion_tag
|
||||
</delete>
|
||||
<delete id="removeAllRelation">
|
||||
delete from nu_directive_emotion_tag
|
||||
delete
|
||||
from nu_directive_emotion_tag
|
||||
</delete>
|
||||
<select id="selectAllRelation" resultType="com.nu.modules.directivetag.emotion.entity.DirectiveEmotionTagRelation">
|
||||
select * from nu_directive_emotion_tag
|
||||
|
@ -11,6 +16,12 @@
|
|||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
<if test="excludeIds != null and excludeIds.size() > 0">
|
||||
AND tag_id not in
|
||||
<foreach collection="excludeIds" item="excludeId" open="(" separator="," close=")">
|
||||
#{excludeId}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.nu.modules.directivetag.emotion.service;
|
||||
|
||||
import com.nu.modules.directivetag.emotion.entity.DirectiveEmotionTag;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.nu.modules.directivetag.emotion.entity.DirectiveEmotionTag;
|
||||
import com.nu.modules.directivetag.emotion.entity.DirectiveEmotionTagRelation;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -23,7 +23,11 @@ public interface IDirectiveEmotionTagService extends IService<DirectiveEmotionTa
|
|||
|
||||
public void removeAllRelation();
|
||||
|
||||
public List<DirectiveEmotionTagRelation> selectAllRelation(String dataSourceCode, List<String> ids);
|
||||
public List<DirectiveEmotionTagRelation> selectAllRelation(String dataSourceCode, List<String> ids,List<String> excludeIds);
|
||||
|
||||
void insertAllRelation(List<DirectiveEmotionTagRelation> relations);
|
||||
|
||||
List<DirectiveEmotionTag> selectAll(String dataSourceCode, List<String> ids,List<String> excludeIds);
|
||||
|
||||
void insertAll(List<DirectiveEmotionTag> emoRelations);
|
||||
}
|
||||
|
|
|
@ -45,13 +45,14 @@ public class DirectiveEmotionTagServiceImpl extends ServiceImpl<DirectiveEmotion
|
|||
|
||||
@Override
|
||||
public void removeAllRelation() {
|
||||
tagRelationMapper.removeAll();
|
||||
tagRelationMapper.removeAllRelation();
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("#dataSourceCode")
|
||||
public List<DirectiveEmotionTagRelation> selectAllRelation(String dataSourceCode, List<String> ids) {
|
||||
return tagRelationMapper.selectAllRelation(ids);
|
||||
public List<DirectiveEmotionTagRelation> selectAllRelation(String dataSourceCode, List<String> ids, List<String> excludeIds) {
|
||||
return tagRelationMapper.selectAllRelation(ids, excludeIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -60,4 +61,17 @@ public class DirectiveEmotionTagServiceImpl extends ServiceImpl<DirectiveEmotion
|
|||
tagRelationMapper.insert(ir);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("#dataSourceCode")
|
||||
public List<DirectiveEmotionTag> selectAll(String dataSourceCode, List<String> ids, List<String> excludeIds) {
|
||||
return baseMapper.selectAll(ids, excludeIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertAll(List<DirectiveEmotionTag> emoRelations) {
|
||||
emoRelations.forEach(e -> {
|
||||
baseMapper.insert(e);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,174 @@
|
|||
package com.nu.modules.instructiontag.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.instructiontag.entity.InstructionTag;
|
||||
import com.nu.modules.instructiontag.service.IInstructionTagService;
|
||||
|
||||
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-07-10
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="服务指令-分类标签")
|
||||
@RestController
|
||||
@RequestMapping("/services/instructionTag")
|
||||
@Slf4j
|
||||
public class InstructionTagController extends JeecgController<InstructionTag, IInstructionTagService> {
|
||||
@Autowired
|
||||
private IInstructionTagService instructionTagService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param instructionTag
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "服务指令-分类标签-分页列表查询")
|
||||
@ApiOperation(value="服务指令-分类标签-分页列表查询", notes="服务指令-分类标签-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<InstructionTag>> queryPageList(InstructionTag instructionTag,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<InstructionTag> queryWrapper = QueryGenerator.initQueryWrapper(instructionTag, req.getParameterMap());
|
||||
Page<InstructionTag> page = new Page<InstructionTag>(pageNo, pageSize);
|
||||
IPage<InstructionTag> pageList = instructionTagService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param instructionTag
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "服务指令-分类标签-添加")
|
||||
@ApiOperation(value="服务指令-分类标签-添加", notes="服务指令-分类标签-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody InstructionTag instructionTag) {
|
||||
instructionTagService.save(instructionTag);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param instructionTag
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "服务指令-分类标签-编辑")
|
||||
@ApiOperation(value="服务指令-分类标签-编辑", notes="服务指令-分类标签-编辑")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody InstructionTag instructionTag) {
|
||||
instructionTagService.updateById(instructionTag);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "服务指令-分类标签-通过id删除")
|
||||
@ApiOperation(value="服务指令-分类标签-通过id删除", notes="服务指令-分类标签-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
instructionTagService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "服务指令-分类标签-批量删除")
|
||||
@ApiOperation(value="服务指令-分类标签-批量删除", notes="服务指令-分类标签-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.instructionTagService.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<InstructionTag> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
InstructionTag instructionTag = instructionTagService.getById(id);
|
||||
if(instructionTag==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(instructionTag);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param instructionTag
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, InstructionTag instructionTag) {
|
||||
return super.exportXls(request, instructionTag, InstructionTag.class, "服务指令-分类标签");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, InstructionTag.class);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,78 @@
|
|||
package com.nu.modules.instructiontag.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
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-07-10
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_config_service_instruction_tag")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_config_service_instruction_tag对象", description="服务指令-分类标签")
|
||||
public class InstructionTag 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)
|
||||
@ApiModelProperty(value = "分类标签名称")
|
||||
private java.lang.String instructionName;
|
||||
/**排序*/
|
||||
@Excel(name = "排序", width = 15)
|
||||
@ApiModelProperty(value = "排序")
|
||||
private java.lang.Integer sort;
|
||||
/**是否启用 0启用 1未启用*/
|
||||
@Excel(name = "是否启用", width = 15)
|
||||
@ApiModelProperty(value = "是否启用")
|
||||
@Dict(dicCode = "iz_enabled")
|
||||
private java.lang.String izEnabled;
|
||||
/**是否删除 0未删除 1删除*/
|
||||
@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")
|
||||
@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 sysOrgCode;
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.nu.modules.instructiontag.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.nu.modules.instructiontag.entity.InstructionTag;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令-分类标签
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-07-10
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface InstructionTagMapper extends BaseMapper<InstructionTag> {
|
||||
|
||||
}
|
|
@ -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.instructiontag.mapper.InstructionTagMapper">
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,14 @@
|
|||
package com.nu.modules.instructiontag.service;
|
||||
|
||||
import com.nu.modules.instructiontag.entity.InstructionTag;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令-分类标签
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-07-10
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IInstructionTagService extends IService<InstructionTag> {
|
||||
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package com.nu.modules.instructiontag.service.impl;
|
||||
|
||||
import com.nu.modules.instructiontag.entity.InstructionTag;
|
||||
import com.nu.modules.instructiontag.mapper.InstructionTagMapper;
|
||||
import com.nu.modules.instructiontag.service.IInstructionTagService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令-分类标签
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-07-10
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class InstructionTagServiceImpl extends ServiceImpl<InstructionTagMapper, InstructionTag> implements IInstructionTagService {
|
||||
|
||||
}
|
|
@ -34,6 +34,11 @@ public class ConfigServiceCategory implements Serializable {
|
|||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.String id;
|
||||
/**分类标签id*/
|
||||
@Excel(name = "分类标签id", width = 15)
|
||||
@ApiModelProperty(value = "分类标签id")
|
||||
@Dict(dicCode = "id" , dictTable = "nu_config_service_instruction_tag" , dicText = "instruction_name")
|
||||
private java.lang.String instructionId;
|
||||
/**服务类别名称*/
|
||||
@Excel(name = "服务类别名称", width = 15)
|
||||
@ApiModelProperty(value = "服务类别名称")
|
||||
|
|
|
@ -2,6 +2,9 @@ package com.nu.modules.servicecategory.mapper;
|
|||
|
||||
import com.nu.modules.servicecategory.entity.ConfigServiceCategory;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 服务类别
|
||||
|
@ -11,4 +14,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
*/
|
||||
public interface ConfigServiceCategoryMapper extends BaseMapper<ConfigServiceCategory> {
|
||||
|
||||
void removeAll();
|
||||
|
||||
List<ConfigServiceCategory> selectAll(@Param("ids") List<String> ids, @Param("excludeIds") List<String> excludeIds);
|
||||
}
|
||||
|
|
|
@ -2,4 +2,22 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nu.modules.servicecategory.mapper.ConfigServiceCategoryMapper">
|
||||
|
||||
<delete id="removeAll">
|
||||
delete from nu_config_service_category
|
||||
</delete>
|
||||
<select id="selectAll" resultType="com.nu.modules.servicecategory.entity.ConfigServiceCategory">
|
||||
select distinct c.* from nu_config_service_category c left join nu_config_service_directive d on c.id = d.category_id
|
||||
<where>
|
||||
d.id in
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
<if test="excludeIds != null and excludeIds.size() > 0">
|
||||
AND c.id not in
|
||||
<foreach collection="excludeIds" item="excludeId" open="(" separator="," close=")">
|
||||
#{excludeId}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
@ -3,18 +3,27 @@ package com.nu.modules.servicecategory.service;
|
|||
import com.nu.modules.servicecategory.entity.ConfigServiceCategory;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 服务类别
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-03-13
|
||||
* @Date: 2025-03-13
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IConfigServiceCategoryService extends IService<ConfigServiceCategory> {
|
||||
|
||||
/**
|
||||
* 查询数据是否已被使用
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
boolean isUsed(String ids);
|
||||
|
||||
void removeAll();
|
||||
|
||||
List<ConfigServiceCategory> selectAll(String dataSourceCode, List<String> ids, List<String> excludeSubIds);
|
||||
|
||||
void insertAll(List<ConfigServiceCategory> categoryList);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.nu.modules.servicecategory.service.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.nu.modules.servicetype.entity.ConfigServiceType;
|
||||
import com.nu.modules.servicetype.service.IConfigServiceTypeService;
|
||||
|
@ -57,4 +58,22 @@ public class ConfigServiceCategoryServiceImpl extends ServiceImpl<ConfigServiceC
|
|||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeAll() {
|
||||
baseMapper.removeAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("#dataSourceCode")
|
||||
public List<ConfigServiceCategory> selectAll(String dataSourceCode, List<String> ids, List<String> excludeSubIds) {
|
||||
return baseMapper.selectAll(ids, excludeSubIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertAll(List<ConfigServiceCategory> categoryList) {
|
||||
categoryList.forEach(c -> {
|
||||
baseMapper.insert(c);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,33 +1,30 @@
|
|||
package com.nu.modules.servicedirective.controller;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
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.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.servicedirective.entity.ConfigServiceDirective;
|
||||
import com.nu.modules.servicedirective.service.IConfigServiceDirectiveService;
|
||||
import com.nu.utils.RabbitMQUtil;
|
||||
import com.nu.modules.sysconfig.ISysConfigApi;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||
import org.jeecg.common.system.vo.DictModel;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -46,14 +43,6 @@ import java.util.stream.Collectors;
|
|||
public class ConfigServiceDirectiveController extends JeecgController<ConfigServiceDirective, IConfigServiceDirectiveService> {
|
||||
@Autowired
|
||||
private IConfigServiceDirectiveService configServiceDirectiveService;
|
||||
@Autowired
|
||||
private RabbitMQUtil rabbitMQUtil;
|
||||
@Autowired
|
||||
private ISysBaseAPI sysBaseAPI;
|
||||
@Autowired
|
||||
private IAsyncMainService asyncMainService;
|
||||
@Autowired
|
||||
private IAsyncStatusService asyncStatusService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
|
@ -67,8 +56,7 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
|||
//@AutoLog(value = "服务指令-分页列表查询")
|
||||
@ApiOperation(value = "服务指令-分页列表查询", notes = "服务指令-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
@DS("#dataSourceCode")
|
||||
public Result<IPage<ConfigServiceDirective>> queryPageList(String dataSourceCode, ConfigServiceDirective configServiceDirective,
|
||||
public Result<IPage<ConfigServiceDirective>> queryPageList(ConfigServiceDirective configServiceDirective,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
|
@ -90,34 +78,18 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
|||
directiveIds = configServiceDirectiveService.queryDirectiveIdByBodyTagIds(configServiceDirective.getBodyTags());
|
||||
if (directiveIds != null && !directiveIds.isEmpty()) {
|
||||
queryWrapper.in("id", directiveIds.stream().map(ConfigServiceDirective::getId).collect(Collectors.toList()));
|
||||
} else {
|
||||
}else{
|
||||
//体重标签下没有数据
|
||||
queryWrapper.eq("id", "null");
|
||||
queryWrapper.eq("id","null");
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(configServiceDirective.getEmotionTags())) {
|
||||
directiveIds = configServiceDirectiveService.queryDirectiveIdByEmotionTagIds(configServiceDirective.getEmotionTags());
|
||||
if (directiveIds != null && !directiveIds.isEmpty()) {
|
||||
if (directiveIds != null && !directiveIds.isEmpty() && StringUtils.isNotBlank(configServiceDirective.getEmotionTags())) {
|
||||
queryWrapper.in("id", directiveIds.stream().map(ConfigServiceDirective::getId).collect(Collectors.toList()));
|
||||
} else {
|
||||
}else{
|
||||
//情绪标签下没有数据
|
||||
queryWrapper.eq("id", "null");
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(configServiceDirective.getViewType())) {
|
||||
if ("selected".equals(configServiceDirective.getViewType())) {
|
||||
if (CollectionUtils.isEmpty(configServiceDirective.getSelectedRowIds())) {
|
||||
queryWrapper.eq("id", "jh11J8");
|
||||
} else {
|
||||
queryWrapper.in("id", configServiceDirective.getSelectedRowIds());
|
||||
}
|
||||
}
|
||||
if ("unselected".equals(configServiceDirective.getViewType())) {
|
||||
if (CollectionUtils.isEmpty(configServiceDirective.getSelectedRowIds())) {
|
||||
queryWrapper.eq("id", "jh11J8");
|
||||
} else {
|
||||
queryWrapper.notIn("id", configServiceDirective.getSelectedRowIds());
|
||||
}
|
||||
queryWrapper.eq("id","null");
|
||||
}
|
||||
}
|
||||
Page<ConfigServiceDirective> page = new Page<ConfigServiceDirective>(pageNo, pageSize);
|
||||
|
@ -128,50 +100,88 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
|||
}
|
||||
|
||||
/**
|
||||
* 服务指令数据同步
|
||||
* 未到运营时间时为全量 否则只能增量
|
||||
* 添加
|
||||
*
|
||||
* @param dto
|
||||
* @param configServiceDirective
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/async")
|
||||
public Result<String> async(@RequestBody DirectiveMQDto dto) {
|
||||
// List<DictModel> dicts = sysBaseAPI.getDictItems("mq_org_queue");
|
||||
// String queue = dicts.stream().filter(d -> d.getValue().equals(dto.getOrgCode())).findFirst().map(DictModel::getText).orElse(null);
|
||||
String queue = dto.getOrgCode() + ".fwzl.async";
|
||||
if (StringUtils.isNotBlank(queue)) {
|
||||
//先在数据同步表中插入数据
|
||||
AsyncMain asyncMain = new AsyncMain();
|
||||
asyncMain.setType("directive");
|
||||
asyncMain.setOrgCode(dto.getOrgCode());
|
||||
asyncMain.setDescr("服务指令同步:" + (dto.isIzInc() ? "增量同步" : "全量同步"));
|
||||
asyncMainService.save(asyncMain);
|
||||
dto.setAsyncId(asyncMain.getId());
|
||||
|
||||
AsyncStatus asyncStatus_data = new AsyncStatus();
|
||||
asyncStatus_data.setPkid(asyncMain.getId());
|
||||
asyncStatus_data.setCode("data");
|
||||
asyncStatus_data.setName("数据");
|
||||
asyncStatus_data.setStatus(MQStatus.LOADING.getCode() + "");
|
||||
asyncStatus_data.setMsg("同步中");
|
||||
asyncStatusService.save(asyncStatus_data);
|
||||
|
||||
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("同步中");
|
||||
asyncStatusService.save(asyncStatus_file);
|
||||
|
||||
//通过mq通知业务系统同步数据
|
||||
rabbitMQUtil.sendToExchange("hldy.fwzl", queue, dto);
|
||||
@AutoLog(value = "服务指令-添加")
|
||||
@ApiOperation(value = "服务指令-添加", notes = "服务指令-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody ConfigServiceDirective configServiceDirective) {
|
||||
//处理媒体资源
|
||||
configServiceDirectiveService.handleMedia(configServiceDirective);
|
||||
configServiceDirectiveService.save(configServiceDirective);
|
||||
if (StringUtils.isNotBlank(configServiceDirective.getBodyTags())) {
|
||||
configServiceDirectiveService.saveBodyTags(configServiceDirective);
|
||||
} else {
|
||||
return Result.error("机构未配置MQ映射关系,需先在数据字典(mq_org_queue)中添加相应对应数据!");
|
||||
configServiceDirectiveService.removeBodyTags(configServiceDirective);
|
||||
}
|
||||
return Result.ok("");
|
||||
|
||||
if (StringUtils.isNotBlank(configServiceDirective.getEmotionTags())) {
|
||||
configServiceDirectiveService.saveEmotionTags(configServiceDirective);
|
||||
} else {
|
||||
configServiceDirectiveService.removeEmotionTags(configServiceDirective);
|
||||
}
|
||||
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param configServiceDirective
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "服务指令-编辑")
|
||||
@ApiOperation(value = "服务指令-编辑", notes = "服务指令-编辑")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody ConfigServiceDirective configServiceDirective) {
|
||||
//处理媒体资源
|
||||
configServiceDirectiveService.handleMedia(configServiceDirective);
|
||||
configServiceDirectiveService.updateById(configServiceDirective);
|
||||
if (StringUtils.isNotBlank(configServiceDirective.getBodyTags())) {
|
||||
configServiceDirectiveService.saveBodyTags(configServiceDirective);
|
||||
} else {
|
||||
configServiceDirectiveService.removeBodyTags(configServiceDirective);
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(configServiceDirective.getEmotionTags())) {
|
||||
configServiceDirectiveService.saveEmotionTags(configServiceDirective);
|
||||
} else {
|
||||
configServiceDirectiveService.removeEmotionTags(configServiceDirective);
|
||||
}
|
||||
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "服务指令-通过id删除")
|
||||
@ApiOperation(value = "服务指令-通过id删除", notes = "服务指令-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
configServiceDirectiveService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "服务指令-批量删除")
|
||||
@ApiOperation(value = "服务指令-批量删除", notes = "服务指令-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
this.configServiceDirectiveService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
|
@ -190,5 +200,27 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
|||
return Result.OK(configServiceDirective);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param configServiceDirective
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, ConfigServiceDirective configServiceDirective) {
|
||||
return super.exportXls(request, configServiceDirective, ConfigServiceDirective.class, "服务指令");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, ConfigServiceDirective.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ public class ConfigServiceDirective implements Serializable {
|
|||
/**分类标签*/
|
||||
@Excel(name = "分类标签", width = 15)
|
||||
@ApiModelProperty(value = "分类标签")
|
||||
@Dict(dicCode = "instruction_tag" )
|
||||
@Dict(dicCode = "id" , dictTable = "nu_config_service_instruction_tag" , dicText = "instruction_name")
|
||||
private java.lang.String instructionTagId;
|
||||
/**服务指令名称*/
|
||||
@Excel(name = "服务指令名称", width = 15)
|
||||
|
@ -123,46 +123,65 @@ public class ConfigServiceDirective implements Serializable {
|
|||
@ApiModelProperty(value = "所属部门")
|
||||
private java.lang.String sysOrgCode;
|
||||
/**语音文件*/
|
||||
@Excel(name = "语音文件", width = 15)
|
||||
@ApiModelProperty(value = "语音文件")
|
||||
private java.lang.String mp3File;
|
||||
//语音文件是否变更
|
||||
@TableField(exist = false)
|
||||
private boolean mp3FileChanged;
|
||||
//语音文件路径
|
||||
@TableField(exist = false)
|
||||
private java.lang.String mp3FileMedia;
|
||||
/**视频文件*/
|
||||
@Excel(name = "视频文件", width = 15)
|
||||
@ApiModelProperty(value = "视频文件")
|
||||
private java.lang.String mp4File;
|
||||
//视频文件是否变更
|
||||
@TableField(exist = false)
|
||||
private boolean mp4FileChanged;
|
||||
//视频文件路径
|
||||
@TableField(exist = false)
|
||||
private java.lang.String mp4FileMedia;
|
||||
/**预览图片*/
|
||||
@ApiModelProperty(value = "预览图片")
|
||||
private java.lang.String previewFile;
|
||||
//预览图片是否变更
|
||||
@TableField(exist = false)
|
||||
private boolean previewFileChanged;
|
||||
//预览图片路径
|
||||
@TableField(exist = false)
|
||||
private java.lang.String previewFileMedia;
|
||||
/**即时指令图片*/
|
||||
@ApiModelProperty(value = "即时指令图片")
|
||||
private java.lang.String immediateFile;
|
||||
//即时指令图片是否变更
|
||||
@TableField(exist = false)
|
||||
private boolean immediateFileChanged;
|
||||
//即时指令图片路径
|
||||
@TableField(exist = false)
|
||||
private java.lang.String immediateFileMedia;
|
||||
|
||||
//合并单元格用:类别合并的行数
|
||||
@TableField(exist = false)
|
||||
private Integer categoryRowSpan;
|
||||
//合并单元格用:类型合并的行数
|
||||
@TableField(exist = false)
|
||||
private Integer typeRowSpan;
|
||||
//合并单元格用:分类标签合并的行数
|
||||
@TableField(exist = false)
|
||||
private Integer instructionRowSpan;
|
||||
|
||||
|
||||
//体型标签id,id,id
|
||||
@TableField(exist = false)
|
||||
private String bodyTags;
|
||||
//情绪标签id,id,id
|
||||
@TableField(exist = false)
|
||||
private String emotionTags;
|
||||
@TableField(exist = false)
|
||||
//服务类别名称
|
||||
private String categoryName;
|
||||
//服务类型名称
|
||||
@TableField(exist = false)
|
||||
private String typeName;
|
||||
|
||||
|
||||
//体型标签
|
||||
@TableField(exist = false)
|
||||
List<DirectiveBodyTag> bodyTagList;
|
||||
|
@ -176,14 +195,4 @@ public class ConfigServiceDirective implements Serializable {
|
|||
//情绪标签字符串
|
||||
@TableField(exist = false)
|
||||
private String emotionTagsName;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String orgCode;
|
||||
|
||||
//如果是selected/unselecte 需要查询所有id in selectedRowIds的数据 / not in selectedRowIds的数据
|
||||
@TableField(exist = false)
|
||||
private String viewType;
|
||||
@TableField(exist = false)
|
||||
private List<String> selectedRowIds;
|
||||
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import java.util.List;
|
|||
import org.apache.ibatis.annotations.Param;
|
||||
import com.nu.modules.servicedirective.entity.ConfigServiceDirective;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import retrofit2.http.DELETE;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令
|
||||
|
@ -24,18 +25,18 @@ public interface ConfigServiceDirectiveMapper extends BaseMapper<ConfigServiceDi
|
|||
@Param("directive") ConfigServiceDirective directive,
|
||||
@Param("ids") List<ConfigServiceDirective> records
|
||||
);
|
||||
// IPage<ConfigServiceDirective> pageList(
|
||||
// @Param("page") Page<ConfigServiceDirective> page,
|
||||
// @Param("directive") ConfigServiceDirective directive
|
||||
// );
|
||||
|
||||
/**
|
||||
* 根据指令标签查询对应的服务指令id
|
||||
* @return
|
||||
*/
|
||||
List<ConfigServiceDirective> queryDirectiveIdByTagIds(@Param("tagIds") String tagIds);
|
||||
int deleteBodyTags(@Param("directive") ConfigServiceDirective configServiceDirective);
|
||||
|
||||
/**
|
||||
* 查询指令标签是否被使用
|
||||
* @return
|
||||
*/
|
||||
int queryCountByTagIds(@Param("tagIds") List<String> tagIds);
|
||||
int saveBodyTags(@Param("directive") ConfigServiceDirective configServiceDirective);
|
||||
|
||||
int deleteEmotionTags(@Param("directive") ConfigServiceDirective configServiceDirective);
|
||||
|
||||
int saveEmotionTags(@Param("directive") ConfigServiceDirective configServiceDirective);
|
||||
|
||||
/**
|
||||
* 根据体型标签查询对应的服务指令id
|
||||
|
@ -60,4 +61,6 @@ public interface ConfigServiceDirectiveMapper extends BaseMapper<ConfigServiceDi
|
|||
* @return
|
||||
*/
|
||||
int queryCountByEmotionTagIds(@Param("tagIds") List<String> tagIds);
|
||||
|
||||
int removeAll();
|
||||
}
|
||||
|
|
|
@ -43,7 +43,6 @@
|
|||
</resultMap>
|
||||
|
||||
|
||||
<!-- 分页查询SQL -->
|
||||
<select id="pageList" resultMap="ConfigServiceDirectiveResultMap" parameterType="map">
|
||||
SELECT
|
||||
c.id,
|
||||
|
@ -89,20 +88,6 @@
|
|||
ORDER BY c.category_id ASC, c.type_id ASC, c.instruction_tag_id ASC,c.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="queryDirectiveIdByTagIds" resultType="com.nu.modules.servicedirective.entity.ConfigServiceDirective">
|
||||
SELECT distinct directive_id as id FROM nu_directive_tag WHERE tag_id IN
|
||||
<foreach collection="tagIds.split(',')" item="tagId" open="(" separator="," close=")">
|
||||
#{tagId}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="queryCountByTagIds" resultType="java.lang.Integer">
|
||||
SELECT COUNT(*) FROM nu_directive_tag WHERE tag_id IN
|
||||
<foreach collection="tagIds" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<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=")">
|
||||
|
@ -130,4 +115,34 @@
|
|||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<delete id="deleteBodyTags">
|
||||
delete
|
||||
from nu_directive_body_tag
|
||||
where directive_id = #{directive.id}
|
||||
</delete>
|
||||
|
||||
<insert id="saveBodyTags">
|
||||
insert into nu_directive_body_tag (directive_id,tag_id) values
|
||||
<foreach collection="directive.bodyTags.split(',')" item="tagId" separator=",">
|
||||
(#{directive.id}, #{tagId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<delete id="deleteEmotionTags">
|
||||
delete
|
||||
from nu_directive_emotion_tag
|
||||
where directive_id = #{directive.id}
|
||||
</delete>
|
||||
|
||||
<insert id="saveEmotionTags">
|
||||
insert into nu_directive_emotion_tag (directive_id,tag_id) values
|
||||
<foreach collection="directive.emotionTags.split(',')" item="tagId" separator=",">
|
||||
(#{directive.id}, #{tagId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<delete id="removeAll">
|
||||
delete from nu_config_service_directive
|
||||
</delete>
|
||||
</mapper>
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
package com.nu.modules.servicedirective.service;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.nu.modules.servicedirective.entity.ConfigServiceDirective;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.nu.modules.servicedirective.entity.ConfigServiceDirective;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -18,7 +19,41 @@ public interface IConfigServiceDirectiveService extends IService<ConfigServiceDi
|
|||
|
||||
List<ConfigServiceDirective> pageList(ConfigServiceDirective configServiceDirective,IPage<ConfigServiceDirective> list);
|
||||
|
||||
/**
|
||||
* 存储体型标签数据
|
||||
* @param configServiceDirective
|
||||
*/
|
||||
void saveBodyTags(ConfigServiceDirective configServiceDirective);
|
||||
|
||||
/**
|
||||
* 存储情绪标签数据
|
||||
* @param configServiceDirective
|
||||
*/
|
||||
void saveEmotionTags(ConfigServiceDirective configServiceDirective);
|
||||
|
||||
/**
|
||||
* 移除改服务指令下体型标签
|
||||
* @param configServiceDirective
|
||||
*/
|
||||
void removeBodyTags(ConfigServiceDirective configServiceDirective);
|
||||
|
||||
/**
|
||||
* 移除改服务指令下情绪标签
|
||||
* @param configServiceDirective
|
||||
*/
|
||||
void removeEmotionTags(ConfigServiceDirective configServiceDirective);
|
||||
|
||||
List<ConfigServiceDirective> queryDirectiveIdByBodyTagIds(String tags);
|
||||
|
||||
List<ConfigServiceDirective> queryDirectiveIdByEmotionTagIds(String tags);
|
||||
|
||||
void removeAll();
|
||||
|
||||
List<ConfigServiceDirective> selectAllByIds(String dataSourceCode, List<String> idList);
|
||||
|
||||
void insertAllDirectives(List<ConfigServiceDirective> directives);
|
||||
|
||||
void handleMedia(ConfigServiceDirective configServiceDirective);
|
||||
|
||||
// List<JSONObject> selectMediaList(String dataSourceCode, List<String> idList);
|
||||
}
|
||||
|
|
|
@ -1,14 +1,18 @@
|
|||
package com.nu.modules.servicedirective.service.impl;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.modules.directivetag.body.entity.DirectiveBodyTag;
|
||||
import com.nu.modules.directivetag.emotion.entity.DirectiveEmotionTag;
|
||||
import com.nu.modules.mediamanage.IMediaManageApi;
|
||||
import com.nu.modules.servicedirective.entity.ConfigServiceDirective;
|
||||
import com.nu.modules.servicedirective.mapper.ConfigServiceDirectiveMapper;
|
||||
import com.nu.modules.servicedirective.service.IConfigServiceDirectiveService;
|
||||
import com.nu.modules.sysconfig.ISysConfigApi;
|
||||
import com.nu.utils.RabbitMQUtil;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
@ -28,8 +32,14 @@ import java.util.stream.Stream;
|
|||
@Service
|
||||
public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigServiceDirectiveMapper, ConfigServiceDirective> implements IConfigServiceDirectiveService {
|
||||
|
||||
// @Autowired
|
||||
// private IMediaManageApi mediaManageApi;
|
||||
@Autowired
|
||||
private IMediaManageApi mediaManageApi;
|
||||
private ISysConfigApi sysConfigApi;
|
||||
@Autowired
|
||||
private ISysBaseAPI sysBaseAPI;
|
||||
@Autowired
|
||||
private RabbitMQUtil rabbitMQUtil;
|
||||
|
||||
@Override
|
||||
public List<ConfigServiceDirective> pageList(ConfigServiceDirective configServiceDirective, IPage<ConfigServiceDirective> list_) {
|
||||
|
@ -46,26 +56,28 @@ public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigService
|
|||
List<DirectiveEmotionTag> emotionTagList = record.getEmotionTagList();
|
||||
record.setEmotionTags(emotionTagList.stream().map(DirectiveEmotionTag::getId).collect(Collectors.joining(",")));
|
||||
});
|
||||
}
|
||||
//处理媒体资源转换
|
||||
{
|
||||
List<String> meidsIds = list.stream().flatMap(directive -> Stream.of(directive.getMp3File(), directive.getMp4File(), directive.getPreviewFile(), directive.getImmediateFile())).filter(Objects::nonNull).distinct().collect(Collectors.toList());
|
||||
//处理媒体资源转换
|
||||
{
|
||||
List<String> meidsIds = list.stream().flatMap(directive -> Stream.of(directive.getMp3File(), directive.getMp4File(), directive.getPreviewFile(), directive.getImmediateFile())).filter(Objects::nonNull).distinct().collect(Collectors.toList());
|
||||
|
||||
if (!CollectionUtils.isEmpty(meidsIds)) {
|
||||
List<JSONObject> mediaObjs = mediaManageApi.queryByIds(meidsIds);
|
||||
|
||||
Map<String, String> idToFilePathMap = mediaObjs.stream().collect(Collectors.toMap(media -> media.getStr("id"), media -> media.getStr("filePath")));
|
||||
|
||||
list.stream().forEach(record -> {
|
||||
record.setPreviewFileMedia(idToFilePathMap.get(record.getPreviewFile()));
|
||||
record.setImmediateFileMedia(idToFilePathMap.get(record.getImmediateFile()));
|
||||
record.setMp3FileMedia(idToFilePathMap.get(record.getMp3File()));
|
||||
record.setMp4FileMedia(idToFilePathMap.get(record.getMp4File()));
|
||||
});
|
||||
// if (!CollectionUtils.isEmpty(meidsIds)) {
|
||||
// List<JSONObject> mediaObjs = mediaManageApi.queryByIds(meidsIds);
|
||||
//
|
||||
// Map<String, String> idToFilePathMap = mediaObjs.stream().collect(Collectors.toMap(media -> media.getStr("id"), media -> media.getStr("filePath")));
|
||||
//
|
||||
// list.stream().forEach(record -> {
|
||||
// record.setPreviewFileMedia(idToFilePathMap.get(record.getPreviewFile()));
|
||||
// record.setImmediateFileMedia(idToFilePathMap.get(record.getImmediateFile()));
|
||||
// record.setMp3FileMedia(idToFilePathMap.get(record.getMp3File()));
|
||||
// record.setMp4FileMedia(idToFilePathMap.get(record.getMp4File()));
|
||||
// });
|
||||
// }
|
||||
}
|
||||
}
|
||||
//处理单元格合并所需数据
|
||||
merge(list);
|
||||
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
@ -158,6 +170,48 @@ public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigService
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 存储体型标签数据
|
||||
*
|
||||
* @param configServiceDirective
|
||||
*/
|
||||
@Override
|
||||
public void saveBodyTags(ConfigServiceDirective configServiceDirective) {
|
||||
baseMapper.deleteBodyTags(configServiceDirective);
|
||||
baseMapper.saveBodyTags(configServiceDirective);
|
||||
}
|
||||
|
||||
/**
|
||||
* 存储情绪标签数据
|
||||
*
|
||||
* @param configServiceDirective
|
||||
*/
|
||||
@Override
|
||||
public void saveEmotionTags(ConfigServiceDirective configServiceDirective) {
|
||||
baseMapper.deleteEmotionTags(configServiceDirective);
|
||||
baseMapper.saveEmotionTags(configServiceDirective);
|
||||
}
|
||||
|
||||
/**
|
||||
* 移除改服务指令下体型标签
|
||||
*
|
||||
* @param configServiceDirective
|
||||
*/
|
||||
@Override
|
||||
public void removeBodyTags(ConfigServiceDirective configServiceDirective) {
|
||||
baseMapper.deleteBodyTags(configServiceDirective);
|
||||
}
|
||||
|
||||
/**
|
||||
* 移除改服务指令下情绪标签
|
||||
*
|
||||
* @param configServiceDirective
|
||||
*/
|
||||
@Override
|
||||
public void removeEmotionTags(ConfigServiceDirective configServiceDirective) {
|
||||
baseMapper.deleteEmotionTags(configServiceDirective);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ConfigServiceDirective> queryDirectiveIdByBodyTagIds(String tags) {
|
||||
return baseMapper.queryDirectiveIdByBodyTagIds(tags);
|
||||
|
@ -168,4 +222,55 @@ public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigService
|
|||
return baseMapper.queryDirectiveIdByEmotionTagIds(tags);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeAll() {
|
||||
baseMapper.removeAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("#dataSourceCode")
|
||||
public List<ConfigServiceDirective> selectAllByIds(String dataSourceCode, List<String> idList) {
|
||||
QueryWrapper<ConfigServiceDirective> qw = new QueryWrapper<>();
|
||||
qw.in("id", idList);
|
||||
return baseMapper.selectList(qw);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertAllDirectives(List<ConfigServiceDirective> directives) {
|
||||
directives.forEach(d -> {
|
||||
baseMapper.insert(d);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleMedia(ConfigServiceDirective configServiceDirective) {
|
||||
// Map<String, String> params = Maps.newHashMap();
|
||||
// params.put("sysFunc", "directive");
|
||||
// if (configServiceDirective.isImmediateFileChanged()) {
|
||||
// params.put("fileName", configServiceDirective.getDirectiveName() + "预览图片");
|
||||
// params.put("descr", "服务指令用户上传图片:" + configServiceDirective.getDirectiveName() + "预览图片");
|
||||
// configServiceDirective.setImmediateFile((mediaManageApi.saveByPath(configServiceDirective.getImmediateFileMedia(), params)));
|
||||
// }
|
||||
// if (configServiceDirective.isPreviewFileChanged()) {
|
||||
// params.put("fileName", configServiceDirective.getDirectiveName() + "即时指令图片");
|
||||
// params.put("descr", "服务指令用户上传图片:" + configServiceDirective.getDirectiveName() + "即时指令图片");
|
||||
// configServiceDirective.setPreviewFile(mediaManageApi.saveByPath(configServiceDirective.getPreviewFileMedia(), params));
|
||||
// }
|
||||
// if (configServiceDirective.isMp3FileChanged()) {
|
||||
// params.put("fileName", configServiceDirective.getDirectiveName() + "音频文件");
|
||||
// params.put("descr", "服务指令用户上传音频:" + configServiceDirective.getDirectiveName() + "音频文件");
|
||||
// configServiceDirective.setMp3File(mediaManageApi.saveByPath(configServiceDirective.getMp3FileMedia(), params));
|
||||
// }
|
||||
// if (configServiceDirective.isMp4FileChanged()) {
|
||||
// params.put("fileName", configServiceDirective.getDirectiveName() + "视频文件");
|
||||
// params.put("descr", "服务指令用户上传视频:" + configServiceDirective.getDirectiveName() + "视频文件");
|
||||
// configServiceDirective.setMp4File(mediaManageApi.saveByPath(configServiceDirective.getMp4FileMedia(), params));
|
||||
// }
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public List<JSONObject> selectMediaList(String dataSourceCode, List<String> idList) {
|
||||
// return mediaManageApi.selectByDirectiveIds(dataSourceCode, idList);
|
||||
// }
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,215 @@
|
|||
package com.nu.modules.servicetag.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nu.modules.servicetag.entity.ServiceTag;
|
||||
import com.nu.modules.servicetag.service.IServiceTagService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.system.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.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 服务标签
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-03-31
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags = "服务标签")
|
||||
@RestController
|
||||
@RequestMapping("/services/serviceTag/serviceTag")
|
||||
@Slf4j
|
||||
public class ServiceTagController extends JeecgController<ServiceTag, IServiceTagService> {
|
||||
@Autowired
|
||||
private IServiceTagService serviceTagService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param serviceTag
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "服务标签-分页列表查询")
|
||||
@ApiOperation(value = "服务标签-分页列表查询", notes = "服务标签-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<ServiceTag>> queryPageList(ServiceTag serviceTag,
|
||||
@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("tagName", QueryRuleEnum.LIKE_WITH_OR);
|
||||
QueryWrapper<ServiceTag> queryWrapper = QueryGenerator.initQueryWrapper(serviceTag, req.getParameterMap(),customeRuleMap);
|
||||
Page<ServiceTag> page = new Page<ServiceTag>(pageNo, pageSize);
|
||||
queryWrapper.select("id");
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
IPage<ServiceTag> pageList = serviceTagService.page(page, queryWrapper);
|
||||
if (pageList.getRecords() != null && !pageList.getRecords().isEmpty()) {
|
||||
serviceTagService.queryList(serviceTag, pageList);
|
||||
}
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param serviceTag
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "服务标签-添加")
|
||||
@ApiOperation(value = "服务标签-添加", notes = "服务标签-添加")
|
||||
@RequiresPermissions("serviceTag:servtag_directive:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody ServiceTag serviceTag) {
|
||||
serviceTagService.save(serviceTag);
|
||||
if (serviceTag.getDirectives() != null && !serviceTag.getDirectives().isEmpty()) {
|
||||
serviceTagService.saveDirectives(serviceTag);
|
||||
}
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param serviceTag
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "服务标签-编辑")
|
||||
@ApiOperation(value = "服务标签-编辑", notes = "服务标签-编辑")
|
||||
@RequiresPermissions("serviceTag:servtag_directive:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody ServiceTag serviceTag) {
|
||||
serviceTagService.updateById(serviceTag);
|
||||
if (serviceTag.getDirectives() != null && !serviceTag.getDirectives().isEmpty()) {
|
||||
serviceTagService.saveDirectives(serviceTag);
|
||||
}
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "服务标签-通过id删除")
|
||||
@ApiOperation(value = "服务标签-通过id删除", notes = "服务标签-通过id删除")
|
||||
@RequiresPermissions("serviceTag:servtag_directive:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
serviceTagService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "服务标签-批量删除")
|
||||
@ApiOperation(value = "服务标签-批量删除", notes = "服务标签-批量删除")
|
||||
@RequiresPermissions("serviceTag:servtag_directive:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
this.serviceTagService.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<ServiceTag> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
ServiceTag serviceTag = serviceTagService.queryById(id);
|
||||
if (serviceTag == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(serviceTag);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param serviceTag
|
||||
*/
|
||||
@RequiresPermissions("serviceTag:servtag_directive:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, ServiceTag serviceTag) {
|
||||
return super.exportXls(request, serviceTag, ServiceTag.class, "服务标签");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("serviceTag:servtag_directive:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, ServiceTag.class);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取服务标签列表根据员工id
|
||||
*
|
||||
* @param serviceTag
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/getEmployeesList")
|
||||
public Result<IPage<ServiceTag>> getEmployeesList(ServiceTag serviceTag,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
if(StringUtils.isEmpty(serviceTag.getEmployeesId())){
|
||||
return Result.error("员工id不能为空");
|
||||
}
|
||||
Page<ServiceTag> page = new Page<ServiceTag>(pageNo, pageSize);
|
||||
IPage<ServiceTag> pageList = serviceTagService.getEmployeesList(page, serviceTag);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = "/getEmployessServiceTags")
|
||||
public Result<List<ServiceTag>> getEmployessServiceTags(ServiceTag serviceTag) {
|
||||
if(StringUtils.isEmpty(serviceTag.getEmployeesId())){
|
||||
return Result.error("员工id不能为空");
|
||||
}
|
||||
List<ServiceTag> pageList = serviceTagService.getEmployessServiceTags(serviceTag);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,84 @@
|
|||
package com.nu.modules.servicetag.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.nu.modules.servicedirective.entity.ConfigServiceDirective;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 服务标签
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-03-31
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_service_tag")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_service_tag对象", description="服务标签")
|
||||
public class ServiceTag implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private String id;
|
||||
/**服务标签名称*/
|
||||
@Excel(name = "服务标签名称", width = 15)
|
||||
@ApiModelProperty(value = "服务标签名称")
|
||||
private String tagName;
|
||||
/**备注*/
|
||||
@Excel(name = "备注", width = 15)
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String description;
|
||||
/**排序*/
|
||||
@Excel(name = "排序", width = 15)
|
||||
@ApiModelProperty(value = "排序")
|
||||
private Integer sort;
|
||||
/**是否启用 0启用 1未启用*/
|
||||
@Excel(name = "是否启用", width = 15, dicCode = "iz_enabled")
|
||||
@Dict(dicCode = "iz_enabled")
|
||||
@ApiModelProperty(value = "是否启用")
|
||||
private String izEnabled;
|
||||
/**是否删除 0未删除 1删除*/
|
||||
@Excel(name = "是否删除", width = 15)
|
||||
@ApiModelProperty(value = "是否删除")
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
@Dict(dictTable = "sys_user",dicCode = "username",dicText = "realname")
|
||||
private 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 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;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<ConfigServiceDirective> directives;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String employeesTagsId;
|
||||
@TableField(exist = false)
|
||||
private String employeesId;
|
||||
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package com.nu.modules.servicetag.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nu.modules.servicetag.entity.ServiceTag;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 服务标签
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-03-31
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ServiceTagMapper extends BaseMapper<ServiceTag> {
|
||||
|
||||
int deleteDirectives(@Param("tag") ServiceTag serviceTag);
|
||||
|
||||
int saveDirectives(@Param("tag") ServiceTag serviceTag);
|
||||
|
||||
List<ServiceTag> queryList( @Param("serviceTag") ServiceTag serviceTag,@Param("ids") List<ServiceTag> ids);
|
||||
|
||||
Long queryTotal(@Param("serviceTag") ServiceTag serviceTag);
|
||||
|
||||
IPage<ServiceTag> getEmployeesList(Page<ServiceTag> page, ServiceTag serviceTag);
|
||||
|
||||
List<ServiceTag> getEmployessServiceTags(ServiceTag serviceTag);
|
||||
}
|
|
@ -0,0 +1,208 @@
|
|||
<?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.servicetag.mapper.ServiceTagMapper">
|
||||
|
||||
<!-- 定义 resultMap -->
|
||||
<resultMap id="ServiceTagResultMap" type="com.nu.modules.servicetag.entity.ServiceTag">
|
||||
<id property="id" column="id"/>
|
||||
<result property="tagName" column="tag_name"/>
|
||||
<result property="description" column="description"/>
|
||||
<result property="sort" column="sort"/>
|
||||
<result property="izEnabled" column="iz_enabled"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<!-- 关联的指令列表 -->
|
||||
<collection property="directives" ofType="com.nu.modules.servicedirective.entity.ConfigServiceDirective">
|
||||
<id property="id" column="directive_id"/>
|
||||
<result property="directiveName" column="directive_name"/>
|
||||
<result property="categoryId" column="category_id"/>
|
||||
<result property="typeId" column="type_id"/>
|
||||
<result property="instructionTagId" column="instruction_tag_id"/>
|
||||
<result property="tollPrice" column="toll_price"/>
|
||||
<result property="comPrice" column="com_price"/>
|
||||
<result property="izReimbursement" column="iz_reimbursement"/>
|
||||
<result property="izPreferential" column="iz_preferential"/>
|
||||
<result property="chargingFrequency" column="charging_frequency"/>
|
||||
<result property="cycleType" column="cycle_type"/>
|
||||
<result property="serviceContent" column="service_content"/>
|
||||
<result property="serviceDuration" column="service_duration"/>
|
||||
<result property="izEnabled" column="directive_iz_enabled"/>
|
||||
<result property="delFlag" column="directive_del_flag"/>
|
||||
<result property="createBy" column="directive_create_by"/>
|
||||
<result property="createTime" column="directive_create_time"/>
|
||||
<result property="updateBy" column="directive_update_by"/>
|
||||
<result property="updateTime" column="directive_update_time"/>
|
||||
<result property="sysOrgCode" column="directive_sys_org_code"/>
|
||||
<result property="mp3File" column="mp3_file"/>
|
||||
<result property="mp4File" column="mp4_file"/>
|
||||
<result property="categoryName" column="csc_category_name"/>
|
||||
<result property="typeName" column="cst_type_name"/>
|
||||
<result property="previewFile" column="preview_file"/>
|
||||
<result property="immediateFile" column="immediate_file"/>
|
||||
<!-- 关联的体型标签列表 -->
|
||||
<collection property="bodyTagList" ofType="com.nu.modules.directivetag.body.entity.DirectiveBodyTag">
|
||||
<id property="id" column="bodytag_id"/>
|
||||
<result property="tagName" column="bodytag_name"/>
|
||||
<result property="sort" column="bodytag_sort"/>
|
||||
<result property="izEnabled" column="bodytag_iz_enabled"/>
|
||||
<result property="delFlag" column="bodytag_del_flag"/>
|
||||
<result property="createBy" column="bodytag_create_by"/>
|
||||
<result property="createTime" column="bodytag_create_time"/>
|
||||
<result property="updateBy" column="bodytag_update_by"/>
|
||||
<result property="updateTime" column="bodytag_update_time"/>
|
||||
<result property="sysOrgCode" column="bodytag_sys_org_code"/>
|
||||
</collection>
|
||||
<!-- 关联的情绪标签列表 -->
|
||||
<collection property="emotionTagList" ofType="com.nu.modules.directivetag.emotion.entity.DirectiveEmotionTag">
|
||||
<id property="id" column="emotag_id"/>
|
||||
<result property="tagName" column="emotag_name"/>
|
||||
<result property="sort" column="emotag_sort"/>
|
||||
<result property="izEnabled" column="emotag_iz_enabled"/>
|
||||
<result property="delFlag" column="emotag_del_flag"/>
|
||||
<result property="createBy" column="emotag_create_by"/>
|
||||
<result property="createTime" column="emotag_create_time"/>
|
||||
<result property="updateBy" column="emotag_update_by"/>
|
||||
<result property="updateTime" column="emotag_update_time"/>
|
||||
<result property="sysOrgCode" column="emotag_sys_org_code"/>
|
||||
</collection>
|
||||
</collection>
|
||||
</resultMap>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="queryList" resultMap="ServiceTagResultMap">
|
||||
SELECT
|
||||
dp.id,
|
||||
dp.tag_name,
|
||||
dp.description,
|
||||
dp.sort,
|
||||
dp.iz_enabled,
|
||||
dp.del_flag,
|
||||
dp.create_by,
|
||||
dp.create_time,
|
||||
dp.update_by,
|
||||
dp.update_time,
|
||||
csd.id AS directive_id,
|
||||
csd.directive_name,
|
||||
csd.category_id,
|
||||
csd.type_id,
|
||||
csd.instruction_tag_id,
|
||||
csd.toll_price,
|
||||
csd.com_price,
|
||||
csd.iz_reimbursement,
|
||||
csd.iz_preferential,
|
||||
csd.charging_frequency,
|
||||
csd.cycle_type,
|
||||
csd.service_content,
|
||||
csd.service_duration,
|
||||
csd.iz_enabled AS directive_iz_enabled,
|
||||
csd.del_flag AS directive_del_flag,
|
||||
csd.create_by AS directive_create_by,
|
||||
csd.create_time AS directive_create_time,
|
||||
csd.update_by AS directive_update_by,
|
||||
csd.update_time AS directive_update_time,
|
||||
csd.sys_org_code AS directive_sys_org_code,
|
||||
csd.mp3_file,
|
||||
csd.mp4_file,
|
||||
csd.preview_file,
|
||||
csd.immediate_file,
|
||||
cdbt.id AS bodytag_id,
|
||||
cdbt.tag_name as bodytag_name,
|
||||
cdbt.sort AS bodytag_sort,
|
||||
cdbt.iz_enabled AS bodytag_iz_enabled,
|
||||
cdbt.del_flag AS bodytag_del_flag,
|
||||
cdbt.create_by AS bodytag_create_by,
|
||||
cdbt.create_time AS bodytag_create_time,
|
||||
cdbt.update_by AS bodytag_update_by,
|
||||
cdbt.update_time AS bodytag_update_time,
|
||||
cdbt.sys_org_code AS bodytag_sys_org_code,
|
||||
cdet.id AS emotag_id,
|
||||
cdet.tag_name as emotag_name,
|
||||
cdet.sort AS emotag_sort,
|
||||
cdet.iz_enabled AS emotag_iz_enabled,
|
||||
cdet.del_flag AS emotag_del_flag,
|
||||
cdet.create_by AS emotag_create_by,
|
||||
cdet.create_time AS emotag_create_time,
|
||||
cdet.update_by AS emotag_update_by,
|
||||
cdet.update_time AS emotag_update_time,
|
||||
cdet.sys_org_code AS emotag_sys_org_code,
|
||||
csc.category_name AS csc_category_name,
|
||||
cst.type_name AS cst_type_name
|
||||
FROM
|
||||
(SELECT * FROM nu_service_tag
|
||||
<where>
|
||||
del_flag = '0' and id in
|
||||
<foreach collection="ids" item="item" open="(" separator="," close=")">
|
||||
#{item.id}
|
||||
</foreach>
|
||||
</where>
|
||||
) dp
|
||||
LEFT JOIN nu_servtag_directive sd ON dp.id = sd.tag_id
|
||||
LEFT JOIN nu_config_service_directive csd ON sd.directive_id = csd.id
|
||||
LEFT JOIN nu_directive_body_tag dbt ON csd.id = dbt.directive_id
|
||||
LEFT JOIN nu_config_body_tag cdbt ON dbt.tag_id = cdbt.id
|
||||
LEFT JOIN nu_directive_emotion_tag det ON csd.id = det.directive_id
|
||||
LEFT JOIN nu_config_emotion_tag cdet ON det.tag_id = cdet.id
|
||||
LEFT JOIN nu_config_service_category csc ON csd.category_id = csc.id
|
||||
LEFT JOIN nu_config_service_type cst ON csd.type_id = cst.id
|
||||
order by dp.create_time desc
|
||||
</select>
|
||||
|
||||
<!-- 查询总记录数 -->
|
||||
<select id="queryTotal" resultType="java.lang.Long">
|
||||
SELECT COUNT(*)
|
||||
FROM nu_service_tag
|
||||
<where>
|
||||
del_flag = '0'
|
||||
<if test="serviceTag.tagName != null and serviceTag.tagName != ''">
|
||||
AND tag_name LIKE CONCAT('%', #{serviceTag.tagName}, '%')
|
||||
</if>
|
||||
<if test="serviceTag.izEnabled != null and serviceTag.izEnabled != ''">
|
||||
AND iz_enabled = #{serviceTag.izEnabled}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<delete id="deleteDirectives">
|
||||
delete
|
||||
from nu_servtag_directive
|
||||
where tag_id = #{tag.id}
|
||||
</delete>
|
||||
|
||||
<insert id="saveDirectives">
|
||||
INSERT INTO nu_servtag_directive (tag_id, directive_id, sort)
|
||||
VALUES
|
||||
<foreach collection="tag.getDirectives()" item="directive" separator=",">
|
||||
(#{tag.id}, #{directive.id}, #{directive.sort})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="getEmployeesList" resultType="com.nu.modules.servicetag.entity.ServiceTag">
|
||||
select nst.id,
|
||||
nst.tag_name,
|
||||
nst.description,
|
||||
nst.sort,
|
||||
ifnull(est.id, '0') as employeesTagsId,
|
||||
nst.iz_enabled,
|
||||
nst.del_flag,
|
||||
nst.create_time,
|
||||
est.employees_id
|
||||
from nu_service_tag nst
|
||||
LEFT JOIN nu_biz_employees_servcie_tags est
|
||||
on nst.id = est.tags_id and est.employees_id = #{serviceTag.employeesId}
|
||||
where nst.del_flag = '0'
|
||||
and nst.iz_enabled = '0'
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getEmployessServiceTags" resultType="com.nu.modules.servicetag.entity.ServiceTag">
|
||||
select a.id, b.tag_name, b.description, a.create_time, b.id as employeesTagsId
|
||||
from nu_biz_employees_servcie_tags a
|
||||
LEFT JOIN nu_service_tag b on a.tags_id = b.id
|
||||
where a.employees_id = #{employeesId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,32 @@
|
|||
package com.nu.modules.servicetag.service;
|
||||
|
||||
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.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.nu.modules.servicetag.entity.ServiceTag;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 服务标签
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-03-31
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IServiceTagService extends IService<ServiceTag> {
|
||||
|
||||
/**
|
||||
* 存储服务标签对应的服务指令
|
||||
* @param serviceTag
|
||||
*/
|
||||
void saveDirectives(ServiceTag serviceTag);
|
||||
|
||||
void queryList(ServiceTag serviceTag, IPage<ServiceTag> pageList);
|
||||
|
||||
ServiceTag queryById(String id);
|
||||
|
||||
IPage<ServiceTag> getEmployeesList(Page<ServiceTag> page, ServiceTag queryWrapper);
|
||||
|
||||
List<ServiceTag> getEmployessServiceTags(ServiceTag serviceTag);
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
package com.nu.modules.servicetag.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.nu.modules.directivetag.body.entity.DirectiveBodyTag;
|
||||
import com.nu.modules.directivetag.emotion.entity.DirectiveEmotionTag;
|
||||
import com.nu.modules.servicedirective.entity.ConfigServiceDirective;
|
||||
import com.nu.modules.servicetag.entity.ServiceTag;
|
||||
import com.nu.modules.servicetag.mapper.ServiceTagMapper;
|
||||
import com.nu.modules.servicetag.service.IServiceTagService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 服务标签
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-03-31
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class ServiceTagServiceImpl extends ServiceImpl<ServiceTagMapper, ServiceTag> implements IServiceTagService {
|
||||
|
||||
@Override
|
||||
public void saveDirectives(ServiceTag serviceTag) {
|
||||
baseMapper.deleteDirectives(serviceTag);
|
||||
baseMapper.saveDirectives(serviceTag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void queryList(ServiceTag serviceTag, IPage<ServiceTag> pageList) {
|
||||
List<ServiceTag> record = baseMapper.queryList(serviceTag,pageList.getRecords());
|
||||
//将指令标签名使用逗号拼接成字符串设置到指令对象的tagsName变量中
|
||||
if(record != null && !record.isEmpty()){
|
||||
record.stream().forEach(l -> {
|
||||
if(l.getDirectives()!=null && !l.getDirectives().isEmpty()){
|
||||
List<ConfigServiceDirective> sd = l.getDirectives();
|
||||
for (int i = 0; i < sd.size(); i++) {
|
||||
List<DirectiveBodyTag> bodyTagList = sd.get(i).getBodyTagList();
|
||||
List<String> bodyTags = bodyTagList.stream().map(t -> t.getTagName()).collect(Collectors.toList());
|
||||
sd.get(i).setBodyTagsName(String.join(",",bodyTags));
|
||||
|
||||
List<DirectiveEmotionTag> emoTagList = sd.get(i).getEmotionTagList();
|
||||
List<String> emoTags = emoTagList.stream().map(t -> t.getTagName()).collect(Collectors.toList());
|
||||
sd.get(i).setEmotionTagsName(String.join(",",emoTags));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
pageList.setRecords(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServiceTag queryById(String id) {
|
||||
List<ServiceTag> query = Lists.newArrayList();
|
||||
ServiceTag queryDto = new ServiceTag().setId(id);
|
||||
query.add(queryDto);
|
||||
List<ServiceTag> serviceTags = baseMapper.queryList(null, query);
|
||||
return serviceTags.stream().findFirst().orElse(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<ServiceTag> getEmployeesList(Page<ServiceTag> page, ServiceTag queryWrapper) {
|
||||
return baseMapper.getEmployeesList(page,queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ServiceTag> getEmployessServiceTags(ServiceTag serviceTag) {
|
||||
return baseMapper.getEmployessServiceTags(serviceTag);
|
||||
}
|
||||
|
||||
}
|
|
@ -34,6 +34,11 @@ public class ConfigServiceType implements Serializable {
|
|||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.String id;
|
||||
/**分类标签id*/
|
||||
@Excel(name = "分类标签id", width = 15)
|
||||
@ApiModelProperty(value = "分类标签id")
|
||||
@Dict(dicCode = "id" , dictTable = "nu_config_service_instruction_tag" , dicText = "instruction_name")
|
||||
private java.lang.String instructionId;
|
||||
/**服务类别id*/
|
||||
@Excel(name = "服务类别", width = 15)
|
||||
@ApiModelProperty(value = "服务类别")
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
package com.nu.modules.servicetype.mapper;
|
||||
|
||||
import com.nu.modules.servicetype.entity.ConfigServiceType;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nu.modules.servicetype.entity.ConfigServiceType;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 服务类型
|
||||
|
@ -11,4 +14,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
*/
|
||||
public interface ConfigServiceTypeMapper extends BaseMapper<ConfigServiceType> {
|
||||
|
||||
void removeAll();
|
||||
|
||||
List<ConfigServiceType> selectAll(@Param("ids") List<String> ids, @Param("excludeIds") List<String> excludeIds);
|
||||
}
|
||||
|
|
|
@ -2,4 +2,23 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nu.modules.servicetype.mapper.ConfigServiceTypeMapper">
|
||||
|
||||
<delete id="removeAll">
|
||||
delete from nu_config_service_type
|
||||
</delete>
|
||||
|
||||
<select id="selectAll" resultType="com.nu.modules.servicetype.entity.ConfigServiceType">
|
||||
select distinct t.* from nu_config_service_type t left join nu_config_service_directive d on t.id = d.type_id
|
||||
<where>
|
||||
d.id in
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
<if test="excludeIds != null and excludeIds.size() > 0">
|
||||
AND t.id not in
|
||||
<foreach collection="excludeIds" item="excludeId" open="(" separator="," close=")">
|
||||
#{excludeId}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
@ -1,20 +1,29 @@
|
|||
package com.nu.modules.servicetype.service;
|
||||
|
||||
import com.nu.modules.servicetype.entity.ConfigServiceType;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.nu.modules.servicetype.entity.ConfigServiceType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 服务类型
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-03-13
|
||||
* @Date: 2025-03-13
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IConfigServiceTypeService extends IService<ConfigServiceType> {
|
||||
|
||||
/**
|
||||
* 查询数据是否已被使用
|
||||
* @param ids
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
boolean isUsed(String id);
|
||||
|
||||
void removeAll();
|
||||
|
||||
List<ConfigServiceType> selectAll(String dataSourceCode, List<String> ids, List<String> excludeSubIds);
|
||||
|
||||
void insertAll(List<ConfigServiceType> categoryList);
|
||||
}
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
package com.nu.modules.servicetype.service.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.modules.servicedirective.entity.ConfigServiceDirective;
|
||||
import com.nu.modules.servicedirective.service.IConfigServiceDirectiveService;
|
||||
import com.nu.modules.servicetype.entity.ConfigServiceType;
|
||||
import com.nu.modules.servicetype.mapper.ConfigServiceTypeMapper;
|
||||
import com.nu.modules.servicetype.service.IConfigServiceTypeService;
|
||||
import com.nu.modules.servicedirective.entity.ConfigServiceDirective;
|
||||
import com.nu.modules.servicedirective.service.IConfigServiceDirectiveService;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -44,4 +44,22 @@ public class ConfigServiceTypeServiceImpl extends ServiceImpl<ConfigServiceTypeM
|
|||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeAll() {
|
||||
baseMapper.removeAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("#dataSourceCode")
|
||||
public List<ConfigServiceType> selectAll(String dataSourceCode, List<String> ids, List<String> excludeSubIds) {
|
||||
return baseMapper.selectAll(ids, excludeSubIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertAll(List<ConfigServiceType> categoryList) {
|
||||
categoryList.forEach(c -> {
|
||||
baseMapper.insert(c);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -625,4 +625,6 @@ public interface ISysBaseAPI extends CommonAPI {
|
|||
JSONObject getOrgInfoByNuId(String nuId);
|
||||
|
||||
JSONObject getOrgInfo(String orgCode);
|
||||
|
||||
JSONObject getDeptInfo();
|
||||
}
|
||||
|
|
|
@ -1903,6 +1903,23 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
|||
return queryOrgInfo(orgCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getDeptInfo() {
|
||||
Map<String,Object> map = Maps.newHashMap();
|
||||
|
||||
QueryWrapper<SysDepart> qw = new QueryWrapper<>();
|
||||
qw.eq("org_category","1");
|
||||
qw.eq("del_flag","0");
|
||||
qw.eq("org_code","100");
|
||||
List<SysDepart> list = sysDepartService.list(qw);
|
||||
if(list!=null && !list.isEmpty()){
|
||||
map.put("code",list.get(0).getOrgCode());
|
||||
map.put("name",list.get(0).getDepartName());
|
||||
map.put("url",list.get(0).getUrl());
|
||||
}
|
||||
return new JSONObject(map);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private JSONObject queryOrgInfo(String orgCode) {
|
||||
QueryWrapper<SysDepart> qw = new QueryWrapper<>();
|
||||
|
|
|
@ -260,6 +260,7 @@ jeecg:
|
|||
upload: /cache/ope/opt/upFiles
|
||||
#webapp文件路径
|
||||
webapp: /cache/ope/opt/webapp
|
||||
webapp1: /abc
|
||||
shiro:
|
||||
excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/bigscreen/category/**,/bigscreen/visual/**,/bigscreen/map/**,/jmreport/bigscreen2/**
|
||||
#阿里云oss存储和大鱼短信秘钥配置
|
||||
|
|
Loading…
Reference in New Issue