服务指令功能
This commit is contained in:
parent
1227fbbdd7
commit
8efe4f112f
|
|
@ -0,0 +1,88 @@
|
|||
package com.nu.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令审核
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-07-14
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
public class DirectiveAsyncMQDto implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
private String id;
|
||||
/**服务类别id*/
|
||||
private String categoryId;
|
||||
/**服务类型id*/
|
||||
private String typeId;
|
||||
/**分类标签*/
|
||||
private String instructionTagId;
|
||||
/**服务指令名称*/
|
||||
private String directiveName;
|
||||
/**收费价格*/
|
||||
private java.math.BigDecimal tollPrice;
|
||||
/**提成价格*/
|
||||
private java.math.BigDecimal comPrice;
|
||||
/**是否参与医保报销 0不报销 1报销*/
|
||||
private String izReimbursement;
|
||||
/**是否参与机构优惠 0不参与 1参与*/
|
||||
private String izPreferential;
|
||||
/**收费频次 1按次收费 2按天收费*/
|
||||
private String chargingFrequency;
|
||||
/**周期类型 1日常护理 2周期护理 3即时护理*/
|
||||
private String cycleType;
|
||||
/**排序*/
|
||||
private Integer sort;
|
||||
/**服务描述*/
|
||||
private String serviceContent;
|
||||
/**服务时长(分钟)*/
|
||||
private String serviceDuration;
|
||||
/**是否启用 0启用 1未启用*/
|
||||
private String izEnabled;
|
||||
/**是否删除*/
|
||||
private String delFlag;
|
||||
/**创建人*/
|
||||
private String createBy;
|
||||
/**创建日期*/
|
||||
private java.util.Date createTime;
|
||||
/**更新人*/
|
||||
private String updateBy;
|
||||
/**更新日期*/
|
||||
private java.util.Date updateTime;
|
||||
/**所属部门*/
|
||||
private String sysOrgCode;
|
||||
/**指令音频文件*/
|
||||
private String mp3File;
|
||||
/**指令视频文件*/
|
||||
private String mp4File;
|
||||
/**服务指令图片*/
|
||||
private String previewFile;
|
||||
/**即时指令图标*/
|
||||
private String immediateFile;
|
||||
|
||||
//体型标签
|
||||
List<Map<String,String>> bodyTagList;
|
||||
//情绪标签
|
||||
List<Map<String,String>> emotionTagList;
|
||||
|
||||
//分类标签中文名称
|
||||
@TableField(exist = false)
|
||||
private String instructionName;
|
||||
//服务类别中文名称
|
||||
@TableField(exist = false)
|
||||
private String categoryName;
|
||||
//服务类型中文名称
|
||||
@TableField(exist = false)
|
||||
private String typeName;
|
||||
//周期类型中文名称
|
||||
@TableField(exist = false)
|
||||
private String cycleTypeName;
|
||||
}
|
||||
|
|
@ -18,14 +18,6 @@
|
|||
ftp_uploadpath as ftpUploadpath,
|
||||
org_code as orgCode
|
||||
from nu_iot_tplink_tums_base
|
||||
<where>
|
||||
<if test="orgCode != null and orgCode != ''">
|
||||
AND org_code = #{orgCode}
|
||||
</if>
|
||||
<if test="orgCode == null or orgCode == ''">
|
||||
AND ifnull(org_code,'') = ''
|
||||
</if>
|
||||
</where>
|
||||
order by id desc
|
||||
limit 1
|
||||
</select>
|
||||
|
|
@ -161,4 +153,4 @@
|
|||
where org_code = #{orgCode}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -1,23 +1,16 @@
|
|||
package com.nu.modules.directivepackage.service.impl;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.nu.modules.directivepackage.entity.DirectivePackage;
|
||||
import com.nu.modules.directivepackage.mapper.DirectivePackageMapper;
|
||||
import com.nu.modules.directivepackage.service.IDirectivePackageService;
|
||||
import com.nu.modules.mediamanage.service.IMediaManageApi;
|
||||
import com.nu.modules.servicedirective.entity.ConfigServiceDirective;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令包
|
||||
|
|
@ -28,9 +21,6 @@ import java.util.stream.Stream;
|
|||
@Service
|
||||
public class DirectivePackageServiceImpl extends ServiceImpl<DirectivePackageMapper, DirectivePackage> implements IDirectivePackageService {
|
||||
|
||||
@Autowired
|
||||
private IMediaManageApi mediaManageApi;
|
||||
|
||||
@Override
|
||||
public void saveDirectives(DirectivePackage directivePackage) {
|
||||
baseMapper.deleteDirectives(directivePackage);
|
||||
|
|
@ -57,41 +47,6 @@ public class DirectivePackageServiceImpl extends ServiceImpl<DirectivePackageMap
|
|||
DirectivePackage queryDto = new DirectivePackage().setId(id);
|
||||
query.add(queryDto);
|
||||
List<DirectivePackage> directivePackages = baseMapper.queryList(null, query);
|
||||
//处理媒体资源路径
|
||||
{
|
||||
if(directivePackages!=null && !directivePackages.isEmpty()){
|
||||
List<ConfigServiceDirective> directives = directivePackages.get(0).getDirectives();
|
||||
if(directives!=null && !directives.isEmpty()){
|
||||
//拿到所有媒体资源的id
|
||||
List<String> meidsIds = directives.stream()
|
||||
.flatMap(directive -> Stream.of(
|
||||
directive.getMp3File(),
|
||||
directive.getMp4File(),
|
||||
directive.getPreviewFile(),
|
||||
directive.getImmediateFile()
|
||||
))
|
||||
.filter(Objects::nonNull)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
|
||||
List<JSONObject> mediaObjs = mediaManageApi.queryByIds(meidsIds);
|
||||
|
||||
Map<String, String> idToFilePathMap = mediaObjs.stream()
|
||||
.collect(Collectors.toMap(
|
||||
media -> media.getStr("id"),
|
||||
media -> media.getStr("filePath")
|
||||
));
|
||||
|
||||
directives.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()));
|
||||
});
|
||||
directivePackages.get(0).setDirectives(directives);
|
||||
}
|
||||
}
|
||||
}
|
||||
return directivePackages.stream().findFirst().orElse(null);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,168 +0,0 @@
|
|||
package com.nu.modules.directivetag.body.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.directivetag.body.entity.DirectiveBodyTag;
|
||||
import com.nu.modules.directivetag.body.service.IDirectiveBodyTagService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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.Map;
|
||||
|
||||
/**
|
||||
* @Description: 体型标签
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-03-17
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="体型标签")
|
||||
@RestController
|
||||
@RequestMapping("/services/directiveTag/bodyTag")
|
||||
@Slf4j
|
||||
public class DirectiveBodyTagController extends JeecgController<DirectiveBodyTag, IDirectiveBodyTagService> {
|
||||
@Autowired
|
||||
private IDirectiveBodyTagService directiveTagService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param directiveTag
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "体型标签-分页列表查询")
|
||||
@ApiOperation(value="体型标签-分页列表查询", notes="体型标签-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<DirectiveBodyTag>> queryPageList(DirectiveBodyTag directiveTag,
|
||||
@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("izEnabled", QueryRuleEnum.LIKE_WITH_OR);
|
||||
QueryWrapper<DirectiveBodyTag> queryWrapper = QueryGenerator.initQueryWrapper(directiveTag, req.getParameterMap(),customeRuleMap);
|
||||
Page<DirectiveBodyTag> page = new Page<DirectiveBodyTag>(pageNo, pageSize);
|
||||
IPage<DirectiveBodyTag> pageList = directiveTagService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param directiveTag
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "体型标签-添加")
|
||||
@ApiOperation(value="体型标签-添加", notes="体型标签-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody DirectiveBodyTag directiveTag) {
|
||||
directiveTagService.save(directiveTag);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param directiveTag
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "体型标签-编辑")
|
||||
@ApiOperation(value="体型标签-编辑", notes="体型标签-编辑")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody DirectiveBodyTag directiveTag) {
|
||||
directiveTagService.updateById(directiveTag);
|
||||
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) {
|
||||
if(directiveTagService.isUsed(id)){
|
||||
return Result.error("已被使用,无法删除!");
|
||||
}
|
||||
directiveTagService.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) {
|
||||
if(directiveTagService.isUsed(ids)){
|
||||
return Result.error("已被使用,无法删除!");
|
||||
}
|
||||
this.directiveTagService.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<DirectiveBodyTag> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
DirectiveBodyTag directiveTag = directiveTagService.getById(id);
|
||||
if(directiveTag==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(directiveTag);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param directiveTag
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, DirectiveBodyTag directiveTag) {
|
||||
return super.exportXls(request, directiveTag, DirectiveBodyTag.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, DirectiveBodyTag.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
package com.nu.modules.directivetag.body.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
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 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: 张明远
|
||||
* @Date: 2025-03-17
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_config_body_tag")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_config_body_tag对象", description="体型标签")
|
||||
public class DirectiveBodyTag 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 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 = "创建人")
|
||||
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;
|
||||
/**所属部门*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private String sysOrgCode;
|
||||
}
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
package com.nu.modules.directivetag.body.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令-体型标签中间表
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-4-23 09:26:04
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_directive_body_tag")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_directive_body_tag对象", description="服务指令-体型标签中间表")
|
||||
public class DirectiveBodyTagRelation implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String directiveId;
|
||||
private String tagId;
|
||||
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
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: 体型标签
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-03-17
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface DirectiveBodyTagMapper extends BaseMapper<DirectiveBodyTag> {
|
||||
|
||||
List<DirectiveBodyTag> selectAll(@Param("ids") List<String> ids,@Param("excludeIds") List<String> excludeIds);
|
||||
|
||||
}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
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;
|
||||
|
||||
/**
|
||||
* @Description: 体型标签
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-03-17
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface DirectiveBodyTagRelationMapper extends BaseMapper<DirectiveBodyTagRelation> {
|
||||
void removeAll();
|
||||
|
||||
void removeAllRelation();
|
||||
|
||||
List<DirectiveBodyTagRelation> selectAllRelation(@Param("ids") List<String> ids,@Param("excludeIds") List<String> excludeIds);
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
<?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.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,27 +0,0 @@
|
|||
<?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>
|
||||
directive_id in
|
||||
<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,33 +0,0 @@
|
|||
package com.nu.modules.directivetag.body.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.nu.modules.directivetag.body.entity.DirectiveBodyTag;
|
||||
import com.nu.modules.directivetag.body.entity.DirectiveBodyTagRelation;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 体型标签
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-03-17
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IDirectiveBodyTagService extends IService<DirectiveBodyTag> {
|
||||
|
||||
/**
|
||||
* 查询数据是否已被使用
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
boolean isUsed(String id);
|
||||
|
||||
public void removeAllRelation();
|
||||
|
||||
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);
|
||||
}
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
package com.nu.modules.directivetag.body.service.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.modules.directivetag.body.entity.DirectiveBodyTag;
|
||||
import com.nu.modules.directivetag.body.entity.DirectiveBodyTagRelation;
|
||||
import com.nu.modules.directivetag.body.mapper.DirectiveBodyTagMapper;
|
||||
import com.nu.modules.directivetag.body.mapper.DirectiveBodyTagRelationMapper;
|
||||
import com.nu.modules.directivetag.body.service.IDirectiveBodyTagService;
|
||||
import com.nu.modules.servicedirective.mapper.ConfigServiceDirectiveMapper;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 体型标签
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-03-17
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class DirectiveBodyTagServiceImpl extends ServiceImpl<DirectiveBodyTagMapper, DirectiveBodyTag> implements IDirectiveBodyTagService {
|
||||
|
||||
@Autowired
|
||||
private ConfigServiceDirectiveMapper serviceDirectiveMapper;
|
||||
@Autowired
|
||||
private DirectiveBodyTagRelationMapper tagRelationMapper;
|
||||
|
||||
@Override
|
||||
public boolean isUsed(String ids) {
|
||||
if (StringUtils.isBlank(ids)) {
|
||||
return false;
|
||||
}
|
||||
boolean result = false;
|
||||
//是否已被服务指令使用
|
||||
int i = serviceDirectiveMapper.queryCountByBodyTagIds(Arrays.asList(ids.split(",")));
|
||||
if (i > 0) {
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeAllRelation() {
|
||||
tagRelationMapper.removeAll();
|
||||
tagRelationMapper.removeAllRelation();
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("#dataSourceCode")
|
||||
public List<DirectiveBodyTagRelation> selectAllRelation(String dataSourceCode, List<String> ids,List<String> excludeIds) {
|
||||
return tagRelationMapper.selectAllRelation(ids,excludeIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertAllRelation(List<DirectiveBodyTagRelation> idRelations) {
|
||||
idRelations.forEach(ir -> {
|
||||
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);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -1,168 +0,0 @@
|
|||
package com.nu.modules.directivetag.emotion.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.directivetag.emotion.entity.DirectiveEmotionTag;
|
||||
import com.nu.modules.directivetag.emotion.service.IDirectiveEmotionTagService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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.Map;
|
||||
|
||||
/**
|
||||
* @Description: 情绪标签
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-03-17
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="情绪标签")
|
||||
@RestController
|
||||
@RequestMapping("/services/directiveTag/emotionTag")
|
||||
@Slf4j
|
||||
public class DirectiveEmotionTagController extends JeecgController<DirectiveEmotionTag, IDirectiveEmotionTagService> {
|
||||
@Autowired
|
||||
private IDirectiveEmotionTagService directiveTagService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param directiveTag
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "情绪标签-分页列表查询")
|
||||
@ApiOperation(value="情绪标签-分页列表查询", notes="情绪标签-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<DirectiveEmotionTag>> queryPageList(DirectiveEmotionTag directiveTag,
|
||||
@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("izEnabled", QueryRuleEnum.LIKE_WITH_OR);
|
||||
QueryWrapper<DirectiveEmotionTag> queryWrapper = QueryGenerator.initQueryWrapper(directiveTag, req.getParameterMap(),customeRuleMap);
|
||||
Page<DirectiveEmotionTag> page = new Page<DirectiveEmotionTag>(pageNo, pageSize);
|
||||
IPage<DirectiveEmotionTag> pageList = directiveTagService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param directiveTag
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "情绪标签-添加")
|
||||
@ApiOperation(value="情绪标签-添加", notes="情绪标签-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody DirectiveEmotionTag directiveTag) {
|
||||
directiveTagService.save(directiveTag);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param directiveTag
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "情绪标签-编辑")
|
||||
@ApiOperation(value="情绪标签-编辑", notes="情绪标签-编辑")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody DirectiveEmotionTag directiveTag) {
|
||||
directiveTagService.updateById(directiveTag);
|
||||
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) {
|
||||
if(directiveTagService.isUsed(id)){
|
||||
return Result.error("已被使用,无法删除!");
|
||||
}
|
||||
directiveTagService.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) {
|
||||
if(directiveTagService.isUsed(ids)){
|
||||
return Result.error("已被使用,无法删除!");
|
||||
}
|
||||
this.directiveTagService.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<DirectiveEmotionTag> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
DirectiveEmotionTag directiveTag = directiveTagService.getById(id);
|
||||
if(directiveTag==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(directiveTag);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param directiveTag
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, DirectiveEmotionTag directiveTag) {
|
||||
return super.exportXls(request, directiveTag, DirectiveEmotionTag.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, DirectiveEmotionTag.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
package com.nu.modules.directivetag.emotion.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
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 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: 张明远
|
||||
* @Date: 2025-03-17
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_config_emotion_tag")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_config_emotion_tag对象", description="情绪标签")
|
||||
public class DirectiveEmotionTag 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 tagName;
|
||||
/**排序*/
|
||||
@Excel(name = "排序", width = 15)
|
||||
@ApiModelProperty(value = "排序")
|
||||
private java.lang.Integer sort;
|
||||
/**是否启用 0启用 1未启用*/
|
||||
@Excel(name = "是否启用", width = 15, dicCode = "iz_enabled")
|
||||
@Dict(dicCode = "iz_enabled")
|
||||
@ApiModelProperty(value = "是否启用")
|
||||
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;
|
||||
}
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
package com.nu.modules.directivetag.emotion.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令-情绪标签中间表
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-4-23 09:26:04
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_directive_emotion_tag")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_directive_emotion_tag对象", description="服务指令-情绪标签中间表")
|
||||
public class DirectiveEmotionTagRelation implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String directiveId;
|
||||
private String tagId;
|
||||
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
package com.nu.modules.directivetag.emotion.mapper;
|
||||
|
||||
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: 情绪标签
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-03-17
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface DirectiveEmotionTagMapper extends BaseMapper<DirectiveEmotionTag> {
|
||||
|
||||
List<DirectiveEmotionTag> selectAll(@Param("ids") List<String> ids, @Param("excludeIds") List<String> excludeIds);
|
||||
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
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;
|
||||
|
||||
/**
|
||||
* @Description: 情绪标签
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-03-17
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface DirectiveEmotionTagRelationMapper extends BaseMapper<DirectiveEmotionTagRelation> {
|
||||
|
||||
void removeAll();
|
||||
|
||||
void removeAllRelation();
|
||||
|
||||
List<DirectiveEmotionTagRelation> selectAllRelation(@Param("ids") List<String> ids, @Param("excludeIds") List<String> excludeIds);
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
<?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,27 +0,0 @@
|
|||
<?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>
|
||||
<select id="selectAllRelation" resultType="com.nu.modules.directivetag.emotion.entity.DirectiveEmotionTagRelation">
|
||||
select * from nu_directive_emotion_tag
|
||||
<where>
|
||||
directive_id in
|
||||
<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,33 +0,0 @@
|
|||
package com.nu.modules.directivetag.emotion.service;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* @Description: 情绪标签
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-03-17
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IDirectiveEmotionTagService extends IService<DirectiveEmotionTag> {
|
||||
|
||||
/**
|
||||
* 查询数据是否已被使用
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
boolean isUsed(String id);
|
||||
|
||||
public void removeAllRelation();
|
||||
|
||||
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);
|
||||
}
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
package com.nu.modules.directivetag.emotion.service.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.modules.directivetag.emotion.entity.DirectiveEmotionTag;
|
||||
import com.nu.modules.directivetag.emotion.entity.DirectiveEmotionTagRelation;
|
||||
import com.nu.modules.directivetag.emotion.mapper.DirectiveEmotionTagMapper;
|
||||
import com.nu.modules.directivetag.emotion.mapper.DirectiveEmotionTagRelationMapper;
|
||||
import com.nu.modules.directivetag.emotion.service.IDirectiveEmotionTagService;
|
||||
import com.nu.modules.servicedirective.mapper.ConfigServiceDirectiveMapper;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 情绪标签
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-03-17
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class DirectiveEmotionTagServiceImpl extends ServiceImpl<DirectiveEmotionTagMapper, DirectiveEmotionTag> implements IDirectiveEmotionTagService {
|
||||
|
||||
@Autowired
|
||||
private ConfigServiceDirectiveMapper serviceDirectiveMapper;
|
||||
@Autowired
|
||||
private DirectiveEmotionTagRelationMapper tagRelationMapper;
|
||||
|
||||
@Override
|
||||
public boolean isUsed(String ids) {
|
||||
if (StringUtils.isBlank(ids)) {
|
||||
return false;
|
||||
}
|
||||
boolean result = false;
|
||||
//是否已被服务指令使用
|
||||
int i = serviceDirectiveMapper.queryCountByEmotionTagIds(Arrays.asList(ids.split(",")));
|
||||
if (i > 0) {
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeAllRelation() {
|
||||
tagRelationMapper.removeAll();
|
||||
tagRelationMapper.removeAllRelation();
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("#dataSourceCode")
|
||||
public List<DirectiveEmotionTagRelation> selectAllRelation(String dataSourceCode, List<String> ids, List<String> excludeIds) {
|
||||
return tagRelationMapper.selectAllRelation(ids, excludeIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertAllRelation(List<DirectiveEmotionTagRelation> idRelations) {
|
||||
idRelations.forEach(ir -> {
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,11 +1,15 @@
|
|||
package com.nu.modules.servicecategory.entity;
|
||||
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;
|
||||
|
|
@ -17,27 +21,27 @@ import lombok.EqualsAndHashCode;
|
|||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @Description: 服务类别
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-03-13
|
||||
* @Description: 服务指令-分类标签
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-07-10
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_config_service_category")
|
||||
@TableName("nu_config_service_instruction_tag")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_config_service_category对象", description="服务类别")
|
||||
public class ConfigServiceCategory implements Serializable {
|
||||
@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 categoryName;
|
||||
/**分类标签名称*/
|
||||
@Excel(name = "分类标签名称", width = 15)
|
||||
@ApiModelProperty(value = "分类标签名称")
|
||||
private java.lang.String instructionName;
|
||||
/**排序*/
|
||||
@Excel(name = "排序", width = 15)
|
||||
@ApiModelProperty(value = "排序")
|
||||
|
|
@ -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 {
|
||||
|
||||
}
|
||||
|
|
@ -1,168 +0,0 @@
|
|||
package com.nu.modules.servicecategory.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.servicecategory.entity.ConfigServiceCategory;
|
||||
import com.nu.modules.servicecategory.service.IConfigServiceCategoryService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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.Map;
|
||||
|
||||
/**
|
||||
* @Description: 服务类别
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-03-13
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="服务类别")
|
||||
@RestController
|
||||
@RequestMapping("/services/serviceCategory/configServiceCategory")
|
||||
@Slf4j
|
||||
public class ConfigServiceCategoryController extends JeecgController<ConfigServiceCategory, IConfigServiceCategoryService> {
|
||||
@Autowired
|
||||
private IConfigServiceCategoryService configServiceCategoryService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param configServiceCategory
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "服务类别-分页列表查询")
|
||||
@ApiOperation(value="服务类别-分页列表查询", notes="服务类别-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<ConfigServiceCategory>> queryPageList(ConfigServiceCategory configServiceCategory,
|
||||
@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("izEnabled", QueryRuleEnum.LIKE_WITH_OR);
|
||||
QueryWrapper<ConfigServiceCategory> queryWrapper = QueryGenerator.initQueryWrapper(configServiceCategory, req.getParameterMap(),customeRuleMap);
|
||||
Page<ConfigServiceCategory> page = new Page<ConfigServiceCategory>(pageNo, pageSize);
|
||||
IPage<ConfigServiceCategory> pageList = configServiceCategoryService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param configServiceCategory
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "服务类别-添加")
|
||||
@ApiOperation(value="服务类别-添加", notes="服务类别-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody ConfigServiceCategory configServiceCategory) {
|
||||
configServiceCategoryService.save(configServiceCategory);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param configServiceCategory
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "服务类别-编辑")
|
||||
@ApiOperation(value="服务类别-编辑", notes="服务类别-编辑")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody ConfigServiceCategory configServiceCategory) {
|
||||
configServiceCategoryService.updateById(configServiceCategory);
|
||||
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) {
|
||||
if(configServiceCategoryService.isUsed(id)){
|
||||
return Result.error("已被使用,无法删除!");
|
||||
}
|
||||
configServiceCategoryService.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) {
|
||||
if(configServiceCategoryService.isUsed(ids)){
|
||||
return Result.error("已被使用,无法删除!");
|
||||
}
|
||||
this.configServiceCategoryService.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<ConfigServiceCategory> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
ConfigServiceCategory configServiceCategory = configServiceCategoryService.getById(id);
|
||||
if(configServiceCategory==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(configServiceCategory);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param configServiceCategory
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, ConfigServiceCategory configServiceCategory) {
|
||||
return super.exportXls(request, configServiceCategory, ConfigServiceCategory.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, ConfigServiceCategory.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
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: 服务类别
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-03-13
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ConfigServiceCategoryMapper extends BaseMapper<ConfigServiceCategory> {
|
||||
|
||||
void removeAll();
|
||||
|
||||
List<ConfigServiceCategory> selectAll(@Param("ids") List<String> ids, @Param("excludeIds") List<String> excludeIds);
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
<?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.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>
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
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
|
||||
* @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,79 +0,0 @@
|
|||
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;
|
||||
import com.nu.modules.servicecategory.entity.ConfigServiceCategory;
|
||||
import com.nu.modules.servicecategory.mapper.ConfigServiceCategoryMapper;
|
||||
import com.nu.modules.servicecategory.service.IConfigServiceCategoryService;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @Description: 服务类别
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-03-13
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class ConfigServiceCategoryServiceImpl extends ServiceImpl<ConfigServiceCategoryMapper, ConfigServiceCategory> implements IConfigServiceCategoryService {
|
||||
|
||||
@Autowired
|
||||
private IConfigServiceTypeService configServiceTypeService;
|
||||
@Autowired
|
||||
private IConfigServiceDirectiveService configServiceDirectiveService;
|
||||
|
||||
@Override
|
||||
public boolean isUsed(String ids) {
|
||||
if (StringUtils.isBlank(ids)) {
|
||||
return false;
|
||||
}
|
||||
boolean result = false;
|
||||
//是否已被服务类型使用
|
||||
LambdaQueryWrapper<ConfigServiceType> configServiceTypeLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
configServiceTypeLambdaQueryWrapper.in(ConfigServiceType::getCategoryId, Arrays.asList(ids.split(",")));
|
||||
configServiceTypeLambdaQueryWrapper.eq(ConfigServiceType::getDelFlag, "0");
|
||||
List<ConfigServiceType> configServiceTypes = configServiceTypeService.list(configServiceTypeLambdaQueryWrapper);
|
||||
if (configServiceTypes == null || configServiceTypes.isEmpty()) {
|
||||
//是否已被服务指令使用
|
||||
LambdaQueryWrapper<ConfigServiceDirective> configServiceDirectiveLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
configServiceDirectiveLambdaQueryWrapper.in(ConfigServiceDirective::getCategoryId, Arrays.asList(ids.split(",")));
|
||||
configServiceDirectiveLambdaQueryWrapper.eq(ConfigServiceDirective::getDelFlag, "0");
|
||||
List<ConfigServiceDirective> configServiceDirectives = configServiceDirectiveService.list(configServiceDirectiveLambdaQueryWrapper);
|
||||
if (!(configServiceDirectives == null || configServiceDirectives.isEmpty())) {
|
||||
result = true;
|
||||
}
|
||||
} else {
|
||||
result = true;
|
||||
}
|
||||
|
||||
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,237 +0,0 @@
|
|||
package com.nu.modules.servicedirective.controller;
|
||||
|
||||
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.modules.servicedirective.entity.ConfigServiceDirective;
|
||||
import com.nu.modules.servicedirective.service.IConfigServiceDirectiveService;
|
||||
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.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;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-03-13
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags = "服务指令")
|
||||
@RestController
|
||||
@RequestMapping("/services/serviceDirective/configServiceDirective")
|
||||
@Slf4j
|
||||
public class ConfigServiceDirectiveController extends JeecgController<ConfigServiceDirective, IConfigServiceDirectiveService> {
|
||||
@Autowired
|
||||
private IConfigServiceDirectiveService configServiceDirectiveService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param configServiceDirective
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "服务指令-分页列表查询")
|
||||
@ApiOperation(value = "服务指令-分页列表查询", notes = "服务指令-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<ConfigServiceDirective>> queryPageList(ConfigServiceDirective configServiceDirective,
|
||||
@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("categoryId", QueryRuleEnum.LIKE_WITH_OR);
|
||||
customeRuleMap.put("typeId", QueryRuleEnum.LIKE_WITH_OR);
|
||||
customeRuleMap.put("instructionTagId", QueryRuleEnum.LIKE_WITH_OR);
|
||||
customeRuleMap.put("izReimbursement", QueryRuleEnum.LIKE_WITH_OR);
|
||||
customeRuleMap.put("izPreferential", QueryRuleEnum.LIKE_WITH_OR);
|
||||
customeRuleMap.put("chargingFrequency", QueryRuleEnum.LIKE_WITH_OR);
|
||||
customeRuleMap.put("cycleType", QueryRuleEnum.LIKE_WITH_OR);
|
||||
customeRuleMap.put("izEnabled", QueryRuleEnum.LIKE_WITH_OR);
|
||||
QueryWrapper<ConfigServiceDirective> queryWrapper = QueryGenerator.initQueryWrapper(configServiceDirective, req.getParameterMap(), customeRuleMap);
|
||||
queryWrapper.select("id");
|
||||
//如果有服务指令需要提前查询下对应的服务指令id
|
||||
List<ConfigServiceDirective> directiveIds = null;
|
||||
if (StringUtils.isNotBlank(configServiceDirective.getBodyTags())) {
|
||||
directiveIds = configServiceDirectiveService.queryDirectiveIdByBodyTagIds(configServiceDirective.getBodyTags());
|
||||
if (directiveIds != null && !directiveIds.isEmpty()) {
|
||||
queryWrapper.in("id", directiveIds.stream().map(ConfigServiceDirective::getId).collect(Collectors.toList()));
|
||||
}else{
|
||||
//体重标签下没有数据
|
||||
queryWrapper.eq("id","null");
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(configServiceDirective.getEmotionTags())) {
|
||||
directiveIds = configServiceDirectiveService.queryDirectiveIdByEmotionTagIds(configServiceDirective.getEmotionTags());
|
||||
if (directiveIds != null && !directiveIds.isEmpty() && StringUtils.isNotBlank(configServiceDirective.getEmotionTags())) {
|
||||
queryWrapper.in("id", directiveIds.stream().map(ConfigServiceDirective::getId).collect(Collectors.toList()));
|
||||
}else{
|
||||
//情绪标签下没有数据
|
||||
queryWrapper.eq("id","null");
|
||||
}
|
||||
}
|
||||
Page<ConfigServiceDirective> page = new Page<ConfigServiceDirective>(pageNo, pageSize);
|
||||
IPage<ConfigServiceDirective> list = configServiceDirectiveService.page(page, queryWrapper);
|
||||
List<ConfigServiceDirective> pageList = service.pageList(configServiceDirective, list);
|
||||
list.setRecords(pageList);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param configServiceDirective
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "服务指令-添加")
|
||||
@ApiOperation(value = "服务指令-添加", notes = "服务指令-添加")
|
||||
@RequiresPermissions("serviceDirective:config_service_directive:add")
|
||||
@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 {
|
||||
configServiceDirectiveService.removeBodyTags(configServiceDirective);
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(configServiceDirective.getEmotionTags())) {
|
||||
configServiceDirectiveService.saveEmotionTags(configServiceDirective);
|
||||
} else {
|
||||
configServiceDirectiveService.removeEmotionTags(configServiceDirective);
|
||||
}
|
||||
|
||||
//放在最后一行 如果是试验田(数据源)机构 需通知运维更新媒体资源
|
||||
configServiceDirectiveService.noticeOpe(configServiceDirective);
|
||||
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param configServiceDirective
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "服务指令-编辑")
|
||||
@ApiOperation(value = "服务指令-编辑", notes = "服务指令-编辑")
|
||||
@RequiresPermissions("serviceDirective:config_service_directive:edit")
|
||||
@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);
|
||||
}
|
||||
|
||||
//放在最后一行 如果是试验田(数据源)机构 需通知运维更新媒体资源
|
||||
configServiceDirectiveService.noticeOpe(configServiceDirective);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "服务指令-通过id删除")
|
||||
@ApiOperation(value = "服务指令-通过id删除", notes = "服务指令-通过id删除")
|
||||
@RequiresPermissions("serviceDirective:config_service_directive:delete")
|
||||
@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 = "服务指令-批量删除")
|
||||
@RequiresPermissions("serviceDirective:config_service_directive:deleteBatch")
|
||||
@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查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "服务指令-通过id查询")
|
||||
@ApiOperation(value = "服务指令-通过id查询", notes = "服务指令-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<ConfigServiceDirective> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
ConfigServiceDirective configServiceDirective = configServiceDirectiveService.getById(id);
|
||||
if (configServiceDirective == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(configServiceDirective);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param configServiceDirective
|
||||
*/
|
||||
@RequiresPermissions("serviceDirective:config_service_directive:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, ConfigServiceDirective configServiceDirective) {
|
||||
return super.exportXls(request, configServiceDirective, ConfigServiceDirective.class, "服务指令");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("serviceDirective:config_service_directive:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, ConfigServiceDirective.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,198 +0,0 @@
|
|||
package com.nu.modules.servicedirective.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.nu.modules.directivetag.body.entity.DirectiveBodyTag;
|
||||
import com.nu.modules.directivetag.emotion.entity.DirectiveEmotionTag;
|
||||
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-13
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_config_service_directive")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_config_service_directive对象", description="服务指令")
|
||||
public class ConfigServiceDirective implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.String id;
|
||||
/**服务类别id*/
|
||||
@Excel(name = "服务类别", width = 15)
|
||||
@ApiModelProperty(value = "服务类别")
|
||||
@Dict(dicCode = "id" , dictTable = "nu_config_service_category" , dicText = "category_name")
|
||||
private java.lang.String categoryId;
|
||||
/**服务类型id*/
|
||||
@Excel(name = "服务类型", width = 15)
|
||||
@ApiModelProperty(value = "服务类型")
|
||||
@Dict(dicCode = "id" , dictTable = "nu_config_service_type" , dicText = "type_name")
|
||||
private java.lang.String typeId;
|
||||
/**分类标签*/
|
||||
@Excel(name = "分类标签", width = 15)
|
||||
@ApiModelProperty(value = "分类标签")
|
||||
@Dict(dicCode = "instruction_tag" )
|
||||
private java.lang.String instructionTagId;
|
||||
/**服务指令名称*/
|
||||
@Excel(name = "服务指令名称", width = 15)
|
||||
@ApiModelProperty(value = "服务指令名称")
|
||||
private java.lang.String directiveName;
|
||||
/**收费价格*/
|
||||
@Excel(name = "收费价格", width = 15)
|
||||
@ApiModelProperty(value = "收费价格")
|
||||
private java.math.BigDecimal tollPrice;
|
||||
/**提成价格*/
|
||||
@Excel(name = "提成价格", width = 15)
|
||||
@ApiModelProperty(value = "提成价格")
|
||||
private java.math.BigDecimal comPrice;
|
||||
/**是否参与医保报销 0不报销 1报销*/
|
||||
@Excel(name = "医保报销", width = 15)
|
||||
@ApiModelProperty(value = "医保报销")
|
||||
@Dict(dicCode = "med_ins_reimb" )
|
||||
private java.lang.String izReimbursement;
|
||||
/**是否参与机构优惠 0不参与 1参与*/
|
||||
@Excel(name = "机构优惠", width = 15)
|
||||
@ApiModelProperty(value = "机构优惠")
|
||||
@Dict(dicCode = "institutional_discount" )
|
||||
private java.lang.String izPreferential;
|
||||
/**收费频次 1按次收费 2按天收费*/
|
||||
@Excel(name = "收费频次", width = 15)
|
||||
@ApiModelProperty(value = "收费频次")
|
||||
@Dict(dicCode = "billing_frequency" )
|
||||
private java.lang.String chargingFrequency;
|
||||
/**周期类型 1日常护理 2周期护理 3即时护理*/
|
||||
@Excel(name = "周期类型", width = 15)
|
||||
@ApiModelProperty(value = "周期类型")
|
||||
@Dict(dicCode = "period_type" )
|
||||
private java.lang.String cycleType;
|
||||
/**排序*/
|
||||
@Excel(name = "排序", width = 15)
|
||||
@ApiModelProperty(value = "排序")
|
||||
private java.lang.Integer sort;
|
||||
/**服务说明*/
|
||||
@Excel(name = "服务说明", width = 15)
|
||||
@ApiModelProperty(value = "服务说明")
|
||||
private java.lang.String serviceContent;
|
||||
/**服务时长(分钟)*/
|
||||
@Excel(name = "服务时长(分钟)", width = 15)
|
||||
@ApiModelProperty(value = "服务时长(分钟)")
|
||||
private java.lang.String serviceDuration;
|
||||
/**是否启用 0启用 1未启用*/
|
||||
@Excel(name = "是否启用", width = 15)
|
||||
@ApiModelProperty(value = "是否启用")
|
||||
@Dict(dicCode = "iz_enabled")
|
||||
private java.lang.String izEnabled;
|
||||
/**是否删除*/
|
||||
@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;
|
||||
/**语音文件*/
|
||||
@ApiModelProperty(value = "语音文件")
|
||||
private java.lang.String mp3File;
|
||||
//语音文件是否变更
|
||||
@TableField(exist = false)
|
||||
private boolean mp3FileChanged;
|
||||
//语音文件路径
|
||||
@TableField(exist = false)
|
||||
private java.lang.String mp3FileMedia;
|
||||
/**视频文件*/
|
||||
@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;
|
||||
//体型标签字符串
|
||||
@TableField(exist = false)
|
||||
private String bodyTagsName;
|
||||
|
||||
//情绪标签
|
||||
@TableField(exist = false)
|
||||
List<DirectiveEmotionTag> emotionTagList;
|
||||
//情绪标签字符串
|
||||
@TableField(exist = false)
|
||||
private String emotionTagsName;
|
||||
}
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
package com.nu.modules.servicedirective.mapper;
|
||||
|
||||
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: 服务指令
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-03-13
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ConfigServiceDirectiveMapper extends BaseMapper<ConfigServiceDirective> {
|
||||
/**
|
||||
* 自定义分页查询方法
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param directive 主查询对象(包含搜索条件)
|
||||
* @return 分页结果
|
||||
*/
|
||||
List<ConfigServiceDirective> pageList(
|
||||
@Param("directive") ConfigServiceDirective directive,
|
||||
@Param("ids") List<ConfigServiceDirective> records
|
||||
);
|
||||
// IPage<ConfigServiceDirective> pageList(
|
||||
// @Param("page") Page<ConfigServiceDirective> page,
|
||||
// @Param("directive") ConfigServiceDirective directive
|
||||
// );
|
||||
|
||||
int deleteBodyTags(@Param("directive") ConfigServiceDirective configServiceDirective);
|
||||
|
||||
int saveBodyTags(@Param("directive") ConfigServiceDirective configServiceDirective);
|
||||
|
||||
int deleteEmotionTags(@Param("directive") ConfigServiceDirective configServiceDirective);
|
||||
|
||||
int saveEmotionTags(@Param("directive") ConfigServiceDirective configServiceDirective);
|
||||
|
||||
/**
|
||||
* 根据体型标签查询对应的服务指令id
|
||||
* @return
|
||||
*/
|
||||
List<ConfigServiceDirective> queryDirectiveIdByBodyTagIds(@Param("tagIds") String tagIds);
|
||||
|
||||
/**
|
||||
* 根据情绪标签查询对应的服务指令id
|
||||
* @return
|
||||
*/
|
||||
List<ConfigServiceDirective> queryDirectiveIdByEmotionTagIds(@Param("tagIds") String tagIds);
|
||||
|
||||
/**
|
||||
* 查询体型标签是否被使用
|
||||
* @return
|
||||
*/
|
||||
int queryCountByBodyTagIds(@Param("tagIds") List<String> tagIds);
|
||||
|
||||
/**
|
||||
* 查询情绪标签是否被使用
|
||||
* @return
|
||||
*/
|
||||
int queryCountByEmotionTagIds(@Param("tagIds") List<String> tagIds);
|
||||
|
||||
int removeAll();
|
||||
}
|
||||
|
|
@ -1,148 +0,0 @@
|
|||
<?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.servicedirective.mapper.ConfigServiceDirectiveMapper">
|
||||
|
||||
<!-- 自定义结果映射 -->
|
||||
<resultMap id="ConfigServiceDirectiveResultMap"
|
||||
type="com.nu.modules.servicedirective.entity.ConfigServiceDirective">
|
||||
<id property="id" column="id"/>
|
||||
<result property="categoryId" column="category_id"/>
|
||||
<result property="typeId" column="type_id"/>
|
||||
<result property="instructionTagId" column="instruction_tag_id"/>
|
||||
<result property="directiveName" column="directive_name"/>
|
||||
<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="sort" column="sort"/>
|
||||
<result property="serviceContent" column="service_content"/>
|
||||
<result property="serviceDuration" column="service_duration"/>
|
||||
<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"/>
|
||||
<result property="sysOrgCode" column="sys_org_code"/>
|
||||
<result property="mp3File" column="mp3_file"/>
|
||||
<result property="mp4File" column="mp4_file"/>
|
||||
<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="bodyTagId"/>
|
||||
<result property="tagName" column="bodyTagName"/>
|
||||
</collection>
|
||||
|
||||
<collection property="emotionTagList" ofType="com.nu.modules.directivetag.emotion.entity.DirectiveEmotionTag">
|
||||
<id property="id" column="emotionTagId"/>
|
||||
<result property="tagName" column="emotionTagName"/>
|
||||
</collection>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="pageList" resultMap="ConfigServiceDirectiveResultMap" parameterType="map">
|
||||
SELECT
|
||||
c.id,
|
||||
c.category_id,
|
||||
c.type_id,
|
||||
c.instruction_tag_id,
|
||||
c.directive_name,
|
||||
c.toll_price,
|
||||
c.com_price,
|
||||
c.iz_reimbursement,
|
||||
c.iz_preferential,
|
||||
c.charging_frequency,
|
||||
c.cycle_type,
|
||||
c.sort,
|
||||
c.service_content,
|
||||
c.service_duration,
|
||||
c.iz_enabled,
|
||||
c.del_flag,
|
||||
c.create_by,
|
||||
c.create_time,
|
||||
c.update_by,
|
||||
c.update_time,
|
||||
c.sys_org_code,
|
||||
c.mp3_file,
|
||||
c.mp4_file,
|
||||
c.preview_file,
|
||||
c.immediate_file,
|
||||
bodytag.id as bodyTagId,
|
||||
bodytag.tag_name as bodyTagName,
|
||||
emotag.id as emotionTagId,
|
||||
emotag.tag_name as emotionTagName
|
||||
FROM nu_config_service_directive c
|
||||
LEFT JOIN nu_directive_body_tag dbt ON c.id = dbt.directive_id
|
||||
LEFT JOIN nu_config_body_tag bodytag ON dbt.tag_id = bodytag.id
|
||||
LEFT JOIN nu_directive_emotion_tag det ON c.id = det.directive_id
|
||||
LEFT JOIN nu_config_emotion_tag emotag ON det.tag_id = emotag.id
|
||||
<where>
|
||||
c.id IN
|
||||
<foreach collection="ids" item="item" open="(" separator="," close=")">
|
||||
#{item.id}
|
||||
</foreach>
|
||||
</where>
|
||||
ORDER BY c.category_id ASC, c.type_id ASC, c.instruction_tag_id ASC,c.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="queryDirectiveIdByBodyTagIds" resultType="com.nu.modules.servicedirective.entity.ConfigServiceDirective">
|
||||
SELECT distinct directive_id as id FROM nu_directive_body_tag WHERE tag_id IN
|
||||
<foreach collection="tagIds.split(',')" item="tagId" open="(" separator="," close=")">
|
||||
#{tagId}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="queryDirectiveIdByEmotionTagIds" resultType="com.nu.modules.servicedirective.entity.ConfigServiceDirective">
|
||||
SELECT distinct directive_id as id FROM nu_directive_emotion_tag WHERE tag_id IN
|
||||
<foreach collection="tagIds.split(',')" item="tagId" open="(" separator="," close=")">
|
||||
#{tagId}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="queryCountByBodyTagIds" resultType="java.lang.Integer">
|
||||
SELECT COUNT(*) FROM nu_directive_body_tag WHERE tag_id IN
|
||||
<foreach collection="tagIds" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="queryCountByEmotionTagIds" resultType="java.lang.Integer">
|
||||
SELECT COUNT(*) FROM nu_directive_emotion_tag WHERE tag_id IN
|
||||
<foreach collection="tagIds" item="item" open="(" separator="," close=")">
|
||||
#{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,62 +0,0 @@
|
|||
package com.nu.modules.servicedirective.service;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.nu.modules.mediamanage.entity.MediaManage;
|
||||
import com.nu.modules.servicedirective.entity.ConfigServiceDirective;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-03-13
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IConfigServiceDirectiveService extends IService<ConfigServiceDirective> {
|
||||
|
||||
void merge(List<ConfigServiceDirective> records);
|
||||
|
||||
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);
|
||||
|
||||
void noticeOpe(ConfigServiceDirective configServiceDirective);
|
||||
|
||||
List<JSONObject> selectMediaList(String dataSourceCode, List<String> idList);
|
||||
}
|
||||
|
|
@ -1,343 +0,0 @@
|
|||
package com.nu.modules.servicedirective.service.impl;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
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.google.common.collect.Maps;
|
||||
import com.nu.modules.directivetag.body.entity.DirectiveBodyTag;
|
||||
import com.nu.modules.directivetag.emotion.entity.DirectiveEmotionTag;
|
||||
import com.nu.modules.mediamanage.service.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.apache.commons.compress.utils.Lists;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-03-13
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigServiceDirectiveMapper, ConfigServiceDirective> implements IConfigServiceDirectiveService {
|
||||
|
||||
@Autowired
|
||||
private IMediaManageApi mediaManageApi;
|
||||
@Autowired
|
||||
private ISysConfigApi sysConfigApi;
|
||||
@Autowired
|
||||
private ISysBaseAPI sysBaseAPI;
|
||||
@Autowired
|
||||
private RabbitMQUtil rabbitMQUtil;
|
||||
|
||||
@Override
|
||||
public List<ConfigServiceDirective> pageList(ConfigServiceDirective configServiceDirective, IPage<ConfigServiceDirective> list_) {
|
||||
if (list_.getRecords() == null || list_.getRecords().isEmpty()) {
|
||||
return list_.getRecords();
|
||||
}
|
||||
List<ConfigServiceDirective> list = baseMapper.pageList(configServiceDirective, list_.getRecords());
|
||||
//处理服务标签字段
|
||||
if (list != null && !list.isEmpty()) {
|
||||
list.stream().forEach(record -> {
|
||||
List<DirectiveBodyTag> bodyTagList = record.getBodyTagList();
|
||||
record.setBodyTags(bodyTagList.stream().map(DirectiveBodyTag::getId).collect(Collectors.joining(",")));
|
||||
|
||||
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());
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 主合并方法
|
||||
*
|
||||
* @param records 已排序的记录列表(需先按categoryId→typeId→instructionTagId排序)
|
||||
*/
|
||||
@Override
|
||||
public void merge(List<ConfigServiceDirective> records) {
|
||||
if (records == null || records.isEmpty()) return;
|
||||
|
||||
int outerStart = 0; // 新一级分组(原三级)起始索引
|
||||
String currentInstructionId = records.get(0).getInstructionTagId();
|
||||
|
||||
// 新一级循环:遍历所有记录处理instructionTagId分组
|
||||
for (int i = 1; i < records.size(); i++) {
|
||||
if (!records.get(i).getInstructionTagId().equals(currentInstructionId)) {
|
||||
processAllGroups(records, outerStart, i - 1); // 处理完整个新一级分组
|
||||
outerStart = i;
|
||||
currentInstructionId = records.get(i).getInstructionTagId();
|
||||
}
|
||||
}
|
||||
processAllGroups(records, outerStart, records.size() - 1); // 处理最后一组
|
||||
}
|
||||
|
||||
private void processAllGroups(List<ConfigServiceDirective> records, int start, int end) {
|
||||
processOuterGroup(records, start, end); // 处理新一级instructionRowSpan
|
||||
|
||||
int middleStart = start; // 新二级分组起始索引
|
||||
String currentCategoryId = records.get(middleStart).getCategoryId();
|
||||
|
||||
// 新二级循环:处理当前新一级分组内的categoryId分组
|
||||
for (int j = middleStart + 1; j <= end; j++) {
|
||||
if (!records.get(j).getCategoryId().equals(currentCategoryId)) {
|
||||
processMiddleGroup(records, middleStart, j - 1); // 处理完整个新二级分组
|
||||
middleStart = j;
|
||||
currentCategoryId = records.get(j).getCategoryId();
|
||||
}
|
||||
}
|
||||
processMiddleGroup(records, middleStart, end); // 处理最后一组新二级数据
|
||||
}
|
||||
|
||||
private void processMiddleGroup(List<ConfigServiceDirective> records, int start, int end) {
|
||||
processTypeRowSpan(records, start, end); // 设置新二级categoryRowSpan
|
||||
|
||||
int innerStart = start; // 新三级分组起始索引
|
||||
String currentTypeId = records.get(innerStart).getTypeId();
|
||||
|
||||
// 新三级循环:处理当前新二级分组内的typeId分组
|
||||
for (int k = innerStart + 1; k <= end; k++) {
|
||||
if (!records.get(k).getTypeId().equals(currentTypeId)) {
|
||||
processInnerGroup(records, innerStart, k - 1); // 处理完整个新三级分组
|
||||
innerStart = k;
|
||||
currentTypeId = records.get(k).getTypeId();
|
||||
}
|
||||
}
|
||||
processInnerGroup(records, innerStart, end); // 处理最后一组新三级数据
|
||||
}
|
||||
|
||||
private void processInnerGroup(List<ConfigServiceDirective> records, int start, int end) {
|
||||
int count = end - start + 1;
|
||||
if (count > 1) {
|
||||
records.get(start).setTypeRowSpan(count);
|
||||
for (int i = start + 1; i <= end; i++) {
|
||||
records.get(i).setTypeRowSpan(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 处理新一级instructionRowSpan
|
||||
private void processOuterGroup(List<ConfigServiceDirective> records, int start, int end) {
|
||||
int count = end - start + 1;
|
||||
if (count > 1) {
|
||||
records.get(start).setInstructionRowSpan(count);
|
||||
for (int i = start + 1; i <= end; i++) {
|
||||
records.get(i).setInstructionRowSpan(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 处理新二级categoryRowSpan
|
||||
private void processTypeRowSpan(List<ConfigServiceDirective> records, int start, int end) {
|
||||
int count = end - start + 1;
|
||||
if (count > 1) {
|
||||
records.get(start).setCategoryRowSpan(count);
|
||||
for (int i = start + 1; i <= end; i++) {
|
||||
records.get(i).setCategoryRowSpan(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 存储体型标签数据
|
||||
*
|
||||
* @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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ConfigServiceDirective> queryDirectiveIdByEmotionTagIds(String tags) {
|
||||
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 void noticeOpe(ConfigServiceDirective configServiceDirective) {
|
||||
com.alibaba.fastjson.JSONObject all = sysConfigApi.getAll();
|
||||
JSONArray configs = all.getJSONArray("configs");
|
||||
configs.stream().forEach(c -> {
|
||||
System.out.println(c);
|
||||
});
|
||||
com.alibaba.fastjson.JSONObject config = sysConfigApi.getByKey("directive_source_url");
|
||||
String url1 = config.getString("configValue");
|
||||
|
||||
//获取本机构配置的协议+域名
|
||||
com.alibaba.fastjson.JSONObject deptInfo = sysBaseAPI.getDeptInfo();
|
||||
String url2 = deptInfo.getString("url");
|
||||
if (url1 != null && url2 != null) {
|
||||
if (url1.endsWith("/") ^ url2.endsWith("/")) {
|
||||
//一个结尾有斜杠 一个结尾没有斜杠
|
||||
if (url1.endsWith("/")) {
|
||||
url2 = url2 + "/";
|
||||
} else {
|
||||
url1 = url1 + "/";
|
||||
}
|
||||
}
|
||||
if ((url1).equals(url2)) {
|
||||
//给运维系统发通知
|
||||
//查询对应媒体资源作为参数给到运维系统
|
||||
List<String> mediaIds = Lists.newArrayList();
|
||||
if (StringUtils.isNotBlank(configServiceDirective.getPreviewFile())) {
|
||||
mediaIds.add(configServiceDirective.getPreviewFile());
|
||||
}
|
||||
if (StringUtils.isNotBlank(configServiceDirective.getImmediateFile())) {
|
||||
mediaIds.add(configServiceDirective.getImmediateFile());
|
||||
}
|
||||
if (StringUtils.isNotBlank(configServiceDirective.getMp3File())) {
|
||||
mediaIds.add(configServiceDirective.getMp3File());
|
||||
}
|
||||
if (StringUtils.isNotBlank(configServiceDirective.getMp4File())) {
|
||||
mediaIds.add(configServiceDirective.getMp4File());
|
||||
}
|
||||
List<JSONObject> jsonObjects = mediaManageApi.queryByIds(mediaIds);
|
||||
List<Map<String, Object>> mediaMaps = new ArrayList<>();
|
||||
if (jsonObjects != null && !jsonObjects.isEmpty()) {
|
||||
jsonObjects.stream().forEach(m -> {
|
||||
Map<String, Object> mediaMap = new HashMap<>();
|
||||
mediaMap.put("id", m.getStr("id"));
|
||||
mediaMap.put("name", m.getStr("name"));
|
||||
mediaMap.put("descr", m.getStr("descr"));
|
||||
mediaMap.put("sysFunc", m.getStr("sysFunc"));
|
||||
mediaMap.put("fileType", m.getStr("fileType"));
|
||||
mediaMap.put("filePath", m.getStr("filePath"));
|
||||
mediaMap.put("izNetUrl", m.getStr("izNetUrl"));
|
||||
mediaMap.put("delFlag", m.getStr("delFlag"));
|
||||
mediaMap.put("createBy", m.getStr("createBy"));
|
||||
// mediaMap.put("createTime", m.getDate("createTime"));
|
||||
mediaMap.put("updateBy", m.getStr("updateBy"));
|
||||
// mediaMap.put("updateTime", m.getDate("updateTime"));
|
||||
mediaMaps.add(mediaMap);
|
||||
});
|
||||
|
||||
rabbitMQUtil.sendToExchange("hldy.mediamanage", "mediamanage.async", mediaMaps);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> selectMediaList(String dataSourceCode, List<String> idList) {
|
||||
return mediaManageApi.selectByDirectiveIds(dataSourceCode, idList);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,168 +0,0 @@
|
|||
package com.nu.modules.servicetype.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.servicetype.entity.ConfigServiceType;
|
||||
import com.nu.modules.servicetype.service.IConfigServiceTypeService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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.Map;
|
||||
|
||||
/**
|
||||
* @Description: 服务类型
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-03-13
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags = "服务类型")
|
||||
@RestController
|
||||
@RequestMapping("/services/ServiceType/configServiceType")
|
||||
@Slf4j
|
||||
public class ConfigServiceTypeController extends JeecgController<ConfigServiceType, IConfigServiceTypeService> {
|
||||
@Autowired
|
||||
private IConfigServiceTypeService configServiceTypeService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param configServiceType
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "服务类型-分页列表查询")
|
||||
@ApiOperation(value = "服务类型-分页列表查询", notes = "服务类型-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<ConfigServiceType>> queryPageList(ConfigServiceType configServiceType,
|
||||
@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("categoryId", QueryRuleEnum.LIKE_WITH_OR);
|
||||
QueryWrapper<ConfigServiceType> queryWrapper = QueryGenerator.initQueryWrapper(configServiceType, req.getParameterMap(), customeRuleMap);
|
||||
Page<ConfigServiceType> page = new Page<ConfigServiceType>(pageNo, pageSize);
|
||||
IPage<ConfigServiceType> pageList = configServiceTypeService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param configServiceType
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "服务类型-添加")
|
||||
@ApiOperation(value = "服务类型-添加", notes = "服务类型-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody ConfigServiceType configServiceType) {
|
||||
configServiceTypeService.save(configServiceType);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param configServiceType
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "服务类型-编辑")
|
||||
@ApiOperation(value = "服务类型-编辑", notes = "服务类型-编辑")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody ConfigServiceType configServiceType) {
|
||||
configServiceTypeService.updateById(configServiceType);
|
||||
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) {
|
||||
if(configServiceTypeService.isUsed(id)){
|
||||
return Result.error("已被使用,无法删除!");
|
||||
}
|
||||
configServiceTypeService.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) {
|
||||
if(configServiceTypeService.isUsed(ids)){
|
||||
return Result.error("已被使用,无法删除!");
|
||||
}
|
||||
this.configServiceTypeService.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<ConfigServiceType> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
ConfigServiceType configServiceType = configServiceTypeService.getById(id);
|
||||
if (configServiceType == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(configServiceType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param configServiceType
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, ConfigServiceType configServiceType) {
|
||||
return super.exportXls(request, configServiceType, ConfigServiceType.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, ConfigServiceType.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,79 +0,0 @@
|
|||
package com.nu.modules.servicetype.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
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 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: 张明远
|
||||
* @Date: 2025-03-13
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_config_service_type")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_config_service_type对象", description="服务类型")
|
||||
public class ConfigServiceType implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.String id;
|
||||
/**服务类别id*/
|
||||
@Excel(name = "服务类别", width = 15)
|
||||
@ApiModelProperty(value = "服务类别")
|
||||
@Dict(dicCode = "id" , dictTable = "nu_config_service_category" , dicText = "category_name")
|
||||
private java.lang.String categoryId;
|
||||
/**服务类型名称*/
|
||||
@Excel(name = "服务类型名称", width = 15)
|
||||
@ApiModelProperty(value = "服务类型名称")
|
||||
private java.lang.String typeName;
|
||||
/**排序*/
|
||||
@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;
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
package com.nu.modules.servicetype.mapper;
|
||||
|
||||
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: 服务类型
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-03-13
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ConfigServiceTypeMapper extends BaseMapper<ConfigServiceType> {
|
||||
|
||||
void removeAll();
|
||||
|
||||
List<ConfigServiceType> selectAll(@Param("ids") List<String> ids, @Param("excludeIds") List<String> excludeIds);
|
||||
}
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
<?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.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,29 +0,0 @@
|
|||
package com.nu.modules.servicetype.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.nu.modules.servicetype.entity.ConfigServiceType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 服务类型
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-03-13
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IConfigServiceTypeService extends IService<ConfigServiceType> {
|
||||
|
||||
/**
|
||||
* 查询数据是否已被使用
|
||||
*
|
||||
* @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,65 +0,0 @@
|
|||
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 org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 服务类型
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-03-13
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class ConfigServiceTypeServiceImpl extends ServiceImpl<ConfigServiceTypeMapper, ConfigServiceType> implements IConfigServiceTypeService {
|
||||
|
||||
@Autowired
|
||||
private IConfigServiceDirectiveService configServiceDirectiveService;
|
||||
|
||||
@Override
|
||||
public boolean isUsed(String ids) {
|
||||
if (StringUtils.isBlank(ids)) {
|
||||
return false;
|
||||
}
|
||||
boolean result = false;
|
||||
//是否已被服务指令使用
|
||||
LambdaQueryWrapper<ConfigServiceDirective> configServiceDirectiveLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
configServiceDirectiveLambdaQueryWrapper.in(ConfigServiceDirective::getTypeId, Arrays.asList(ids.split(",")));
|
||||
configServiceDirectiveLambdaQueryWrapper.eq(ConfigServiceDirective::getDelFlag, "0");
|
||||
List<ConfigServiceDirective> configServiceDirectives = configServiceDirectiveService.list(configServiceDirectiveLambdaQueryWrapper);
|
||||
if (!(configServiceDirectives == null || configServiceDirectives.isEmpty())) {
|
||||
result = true;
|
||||
}
|
||||
|
||||
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);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -1,407 +1,359 @@
|
|||
package com.nu.mq.directive.listener;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
||||
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.DirectiveMQDto;
|
||||
import com.nu.dto.StatusMQDto;
|
||||
import com.nu.enums.MQStatus;
|
||||
import com.nu.modules.directivetag.body.entity.DirectiveBodyTag;
|
||||
import com.nu.modules.directivetag.body.entity.DirectiveBodyTagRelation;
|
||||
import com.nu.modules.directivetag.body.service.IDirectiveBodyTagService;
|
||||
import com.nu.modules.directivetag.emotion.entity.DirectiveEmotionTag;
|
||||
import com.nu.modules.directivetag.emotion.entity.DirectiveEmotionTagRelation;
|
||||
import com.nu.modules.directivetag.emotion.service.IDirectiveEmotionTagService;
|
||||
import com.nu.modules.mediaasyncerrorlog.entity.MediaAsyncErrorLog;
|
||||
import com.nu.modules.mediaasyncerrorlog.service.IMediaAsyncErrorLogService;
|
||||
import com.nu.modules.mediamanage.entity.MediaManage;
|
||||
import com.nu.modules.mediamanage.entity.MediaManageDto;
|
||||
import com.nu.modules.mediamanage.service.IMediaManageApi;
|
||||
import com.nu.modules.servicecategory.entity.ConfigServiceCategory;
|
||||
import com.nu.modules.servicecategory.service.IConfigServiceCategoryService;
|
||||
import com.nu.modules.servicedirective.entity.ConfigServiceDirective;
|
||||
import com.nu.modules.servicedirective.service.IConfigServiceDirectiveService;
|
||||
import com.nu.modules.servicetype.entity.ConfigServiceType;
|
||||
import com.nu.modules.servicetype.service.IConfigServiceTypeService;
|
||||
import com.nu.modules.sysconfig.entity.SysConfig;
|
||||
import com.nu.modules.sysconfig.service.ISysConfigService;
|
||||
import com.nu.utils.FileDownloader;
|
||||
import com.nu.utils.RabbitMQUtil;
|
||||
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.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class DirectiveMQListener {
|
||||
|
||||
@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;
|
||||
@Autowired
|
||||
private IConfigServiceDirectiveService directiveService;
|
||||
@Autowired
|
||||
private IDirectiveBodyTagService bodyTagService;
|
||||
@Autowired
|
||||
private IDirectiveEmotionTagService emotionTagService;
|
||||
@Autowired
|
||||
private IConfigServiceCategoryService serviceCategoryService;
|
||||
@Autowired
|
||||
private IConfigServiceTypeService serviceTypeService;
|
||||
@Autowired
|
||||
private RabbitMQUtil rabbitMQUtil;
|
||||
|
||||
/**
|
||||
* if 未到运营开始时间时 全量变更
|
||||
* else 增量
|
||||
*
|
||||
* <p>
|
||||
* 具体逻辑说明
|
||||
* ->全量同步<-
|
||||
* 1、未到运营开始时间时:dto.isIzInc()为false时
|
||||
* 1)先将所有相关指令字典表主表、关系表数据全部删除后增加
|
||||
* 2)将指令主表数据增加进去
|
||||
* <p>
|
||||
* ->增量同步<-
|
||||
* !!增量时:前台操作同步功能 只会在原基础上新增 不存在移除的情况
|
||||
* 2、已到运营开始时间:dto.isIzInc()为true时
|
||||
* 1)传过来的id是所有服务指令的id 需要处理只保留新增部分对应的id
|
||||
* 2)将新增的指令对应的字典表、关系表数据增加进去
|
||||
* 3)将新增的指令数据增加进去
|
||||
*
|
||||
* @param dto
|
||||
*/
|
||||
@RabbitListener(
|
||||
bindings = @QueueBinding(
|
||||
value = @Queue(name = "#{directiveAsyncDQNP.getQueueName()}"),
|
||||
exchange = @Exchange(name = "hldy.fwzl", type = ExchangeTypes.DIRECT),
|
||||
key = "#{directiveAsyncDQNP.getKeyName()}"
|
||||
),
|
||||
errorHandler = "directiveMQErrorHandler"
|
||||
)
|
||||
@DSTransactional(rollbackFor = {Exception.class})
|
||||
public void handleMessage(DirectiveMQDto dto) {
|
||||
try {
|
||||
if (!dto.isIzInc()) {
|
||||
//全量
|
||||
handleQuantity(dto);
|
||||
} else {
|
||||
//增量
|
||||
handleIncremental(dto);
|
||||
}
|
||||
StatusMQDto statusMQDto = new StatusMQDto();
|
||||
statusMQDto.setStatus(MQStatus.SUCCESS.getCode());
|
||||
statusMQDto.setMessage("数据同步成功!");
|
||||
statusMQDto.setAsyncId(dto.getAsyncId());
|
||||
statusMQDto.setCode("data");
|
||||
rabbitMQUtil.sendToExchange("hldy.fwzl", "fwzl.async.result", statusMQDto);
|
||||
} catch (Exception e) {
|
||||
StatusMQDto statusMQDto = new StatusMQDto();
|
||||
statusMQDto.setStatus(MQStatus.PROCESS_FAILED.getCode());
|
||||
statusMQDto.setMessage(e.getMessage());
|
||||
statusMQDto.setAsyncId(dto.getAsyncId());
|
||||
statusMQDto.setCode("data");
|
||||
rabbitMQUtil.sendToExchange("hldy.fwzl", "fwzl.async.result", statusMQDto);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
try {
|
||||
//处理文件同步
|
||||
handleFileAsync(dto);
|
||||
StatusMQDto statusMQDto = new StatusMQDto();
|
||||
statusMQDto.setStatus(MQStatus.SUCCESS.getCode());
|
||||
statusMQDto.setMessage("数据同步成功!");
|
||||
statusMQDto.setAsyncId(dto.getAsyncId());
|
||||
statusMQDto.setCode("file");
|
||||
rabbitMQUtil.sendToExchange("hldy.fwzl", "fwzl.async.result", statusMQDto);
|
||||
} catch (Exception e) {
|
||||
StatusMQDto statusMQDto = new StatusMQDto();
|
||||
statusMQDto.setStatus(MQStatus.PROCESS_FAILED.getCode());
|
||||
statusMQDto.setMessage("【文件同步失败请至“服务指令更新功能”重新同步】" + e.getMessage());
|
||||
statusMQDto.setAsyncId(dto.getAsyncId());
|
||||
statusMQDto.setCode("file");
|
||||
rabbitMQUtil.sendToExchange("hldy.fwzl", "fwzl.async.result", statusMQDto);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理全量同步数据
|
||||
*
|
||||
* @param dto
|
||||
*/
|
||||
private void handleQuantity(DirectiveMQDto dto) {
|
||||
//全量:移除所有服务指令主表、服务指令各字典主表、中间关系表数据
|
||||
directiveService.removeAll();
|
||||
//体型标签
|
||||
bodyTagService.removeAllRelation();
|
||||
//情绪标签
|
||||
emotionTagService.removeAllRelation();
|
||||
//服务类别
|
||||
serviceCategoryService.removeAll();
|
||||
//服务类型
|
||||
serviceTypeService.removeAll();
|
||||
|
||||
dto.setIdList(Arrays.asList(dto.getIdStr().split(",")));
|
||||
|
||||
handleData(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理增量同步数据
|
||||
*
|
||||
* @param dto
|
||||
* @throws Exception
|
||||
*/
|
||||
private void handleIncremental(DirectiveMQDto dto) {
|
||||
//增量:传过来的是已勾选的全部数据,需将重复部分去除
|
||||
//先查出所有指令id 然后进行去重
|
||||
QueryWrapper<ConfigServiceDirective> dtw = new QueryWrapper<>();
|
||||
dtw.select("id");
|
||||
List<ConfigServiceDirective> tempList = directiveService.list(dtw);
|
||||
Set<String> existingIds = tempList.stream()
|
||||
.map(ConfigServiceDirective::getId)
|
||||
.map(String::valueOf)
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
String idStr = dto.getIdStr();
|
||||
List<String> inputIds = Arrays.asList(idStr.split(","));
|
||||
|
||||
List<String> uniqueIds = inputIds.stream()
|
||||
.filter(id -> !existingIds.contains(id))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
dto.setIdList(uniqueIds);
|
||||
|
||||
handleData(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理数据
|
||||
*
|
||||
* @param dto
|
||||
*/
|
||||
private void handleData(DirectiveMQDto dto) {
|
||||
if (dto.getIdList() != null && !dto.getIdList().isEmpty()) {
|
||||
//体型标签
|
||||
{
|
||||
//需要排除的体型标签id
|
||||
List<String> excludeSubIds = Lists.newArrayList();
|
||||
if (dto.isIzInc()) {
|
||||
List<DirectiveBodyTag> list = bodyTagService.list();
|
||||
excludeSubIds = list.stream().map(DirectiveBodyTag::getId).collect(Collectors.toList());
|
||||
}
|
||||
List<DirectiveBodyTag> bodyAll = bodyTagService.selectAll("nuro", dto.getIdList(), excludeSubIds);
|
||||
if (bodyAll != null && !bodyAll.isEmpty()) {
|
||||
bodyTagService.insertAll(bodyAll);
|
||||
}
|
||||
List<DirectiveBodyTagRelation> bodyRelations = bodyTagService.selectAllRelation("nuro", dto.getIdList(), null);
|
||||
if (bodyRelations != null && !bodyRelations.isEmpty()) {
|
||||
bodyTagService.insertAllRelation(bodyRelations);
|
||||
}
|
||||
}
|
||||
//情绪标签
|
||||
{
|
||||
//需要排除的情绪标签id
|
||||
List<String> excludeSubIds = Lists.newArrayList();
|
||||
if (dto.isIzInc()) {
|
||||
List<DirectiveEmotionTag> list = emotionTagService.list();
|
||||
excludeSubIds = list.stream().map(DirectiveEmotionTag::getId).collect(Collectors.toList());
|
||||
}
|
||||
List<DirectiveEmotionTag> emoAll = emotionTagService.selectAll("nuro", dto.getIdList(), excludeSubIds);
|
||||
if (emoAll != null && !emoAll.isEmpty()) {
|
||||
emotionTagService.insertAll(emoAll);
|
||||
}
|
||||
List<DirectiveEmotionTagRelation> emoRelations = emotionTagService.selectAllRelation("nuro", dto.getIdList(), null);
|
||||
if (emoRelations != null && !emoRelations.isEmpty()) {
|
||||
emotionTagService.insertAllRelation(emoRelations);
|
||||
}
|
||||
}
|
||||
//服务类别
|
||||
{
|
||||
//需要排除的服务类别id
|
||||
List<String> excludeSubIds = Lists.newArrayList();
|
||||
if (dto.isIzInc()) {
|
||||
List<ConfigServiceCategory> list = serviceCategoryService.list();
|
||||
excludeSubIds = list.stream().map(ConfigServiceCategory::getId).collect(Collectors.toList());
|
||||
}
|
||||
List<ConfigServiceCategory> categoryList = serviceCategoryService.selectAll("nuro", dto.getIdList(), excludeSubIds);
|
||||
if (categoryList != null && !categoryList.isEmpty()) {
|
||||
serviceCategoryService.insertAll(categoryList);
|
||||
}
|
||||
}
|
||||
//服务类型
|
||||
{
|
||||
//需要排除的服务类型id
|
||||
List<String> excludeSubIds = Lists.newArrayList();
|
||||
if (dto.isIzInc()) {
|
||||
List<ConfigServiceType> list = serviceTypeService.list();
|
||||
excludeSubIds = list.stream().map(ConfigServiceType::getId).collect(Collectors.toList());
|
||||
}
|
||||
List<ConfigServiceType> typeList = serviceTypeService.selectAll("nuro", dto.getIdList(), excludeSubIds);
|
||||
if (typeList != null && !typeList.isEmpty()) {
|
||||
serviceTypeService.insertAll(typeList);
|
||||
}
|
||||
}
|
||||
//查询服务指令,并将服务指令新增进自己的数据库表中
|
||||
List<ConfigServiceDirective> directives = directiveService.selectAllByIds("nuro", dto.getIdList());
|
||||
if (directives != null && !directives.isEmpty()) {
|
||||
directiveService.insertAllDirectives(directives);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理文件同步
|
||||
*
|
||||
* @param dto
|
||||
*/
|
||||
private void handleFileAsync(DirectiveMQDto dto) {
|
||||
dto.setIdList(Arrays.asList(dto.getIdStr().split(",")));
|
||||
if (dto.getIdList() == null || dto.getIdList().isEmpty()) {
|
||||
return;
|
||||
}
|
||||
List<JSONObject> objs = directiveService.selectMediaList("nuro", dto.getIdList());
|
||||
if (CollectionUtils.isEmpty(objs)) {
|
||||
return;
|
||||
}
|
||||
//试验田对应服务指令下的媒体资源
|
||||
List<MediaManageDto> mediaList = directiveService.selectMediaList("nuro", dto.getIdList())
|
||||
.stream()
|
||||
.map(json -> JSONUtil.toBean(json, MediaManageDto.class))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
//获取机构下媒资数据
|
||||
List<String> mediaIds = mediaList.stream()
|
||||
.map(MediaManageDto::getId)
|
||||
.collect(Collectors.toList());
|
||||
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是试验田的媒体资源数据
|
||||
mediaList.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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理文件存储
|
||||
*
|
||||
* @param media
|
||||
*/
|
||||
private void handleSaveFile(MediaManageDto 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();
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
// @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;
|
||||
// @Autowired
|
||||
// private IConfigServiceDirectiveService directiveService;
|
||||
// @Autowired
|
||||
// private IDirectiveBodyTagService bodyTagService;
|
||||
// @Autowired
|
||||
// private IDirectiveEmotionTagService emotionTagService;
|
||||
// @Autowired
|
||||
// private IConfigServiceCategoryService serviceCategoryService;
|
||||
// @Autowired
|
||||
// private IConfigServiceTypeService serviceTypeService;
|
||||
// @Autowired
|
||||
// private RabbitMQUtil rabbitMQUtil;
|
||||
//
|
||||
// /**
|
||||
// * if 未到运营开始时间时 全量变更
|
||||
// * else 增量
|
||||
// *
|
||||
// * <p>
|
||||
// * 具体逻辑说明
|
||||
// * ->全量同步<-
|
||||
// * 1、未到运营开始时间时:dto.isIzInc()为false时
|
||||
// * 1)先将所有相关指令字典表主表、关系表数据全部删除后增加
|
||||
// * 2)将指令主表数据增加进去
|
||||
// * <p>
|
||||
// * ->增量同步<-
|
||||
// * !!增量时:前台操作同步功能 只会在原基础上新增 不存在移除的情况
|
||||
// * 2、已到运营开始时间:dto.isIzInc()为true时
|
||||
// * 1)传过来的id是所有服务指令的id 需要处理只保留新增部分对应的id
|
||||
// * 2)将新增的指令对应的字典表、关系表数据增加进去
|
||||
// * 3)将新增的指令数据增加进去
|
||||
// *
|
||||
// * @param dto
|
||||
// */
|
||||
// @RabbitListener(
|
||||
// bindings = @QueueBinding(
|
||||
// value = @Queue(name = "#{directiveAsyncDQNP.getQueueName()}"),
|
||||
// exchange = @Exchange(name = "hldy.fwzl", type = ExchangeTypes.DIRECT),
|
||||
// key = "#{directiveAsyncDQNP.getKeyName()}"
|
||||
// ),
|
||||
// errorHandler = "directiveMQErrorHandler"
|
||||
// )
|
||||
// @DSTransactional(rollbackFor = {Exception.class})
|
||||
// public void handleMessage(DirectiveMQDto dto) {
|
||||
// try {
|
||||
// if (!dto.isIzInc()) {
|
||||
// //全量
|
||||
// handleQuantity(dto);
|
||||
// } else {
|
||||
// //增量
|
||||
// handleIncremental(dto);
|
||||
// }
|
||||
// StatusMQDto statusMQDto = new StatusMQDto();
|
||||
// statusMQDto.setStatus(MQStatus.SUCCESS.getCode());
|
||||
// statusMQDto.setMessage("数据同步成功!");
|
||||
// statusMQDto.setAsyncId(dto.getAsyncId());
|
||||
// statusMQDto.setCode("data");
|
||||
// rabbitMQUtil.sendToExchange("hldy.fwzl", "fwzl.async.result", statusMQDto);
|
||||
// } catch (Exception e) {
|
||||
// StatusMQDto statusMQDto = new StatusMQDto();
|
||||
// statusMQDto.setStatus(MQStatus.PROCESS_FAILED.getCode());
|
||||
// statusMQDto.setMessage(e.getMessage());
|
||||
// statusMQDto.setAsyncId(dto.getAsyncId());
|
||||
// statusMQDto.setCode("data");
|
||||
// rabbitMQUtil.sendToExchange("hldy.fwzl", "fwzl.async.result", statusMQDto);
|
||||
// throw new RuntimeException(e);
|
||||
// }
|
||||
// try {
|
||||
// //处理文件同步
|
||||
// handleFileAsync(dto);
|
||||
// StatusMQDto statusMQDto = new StatusMQDto();
|
||||
// statusMQDto.setStatus(MQStatus.SUCCESS.getCode());
|
||||
// statusMQDto.setMessage("数据同步成功!");
|
||||
// statusMQDto.setAsyncId(dto.getAsyncId());
|
||||
// statusMQDto.setCode("file");
|
||||
// rabbitMQUtil.sendToExchange("hldy.fwzl", "fwzl.async.result", statusMQDto);
|
||||
// } catch (Exception e) {
|
||||
// StatusMQDto statusMQDto = new StatusMQDto();
|
||||
// statusMQDto.setStatus(MQStatus.PROCESS_FAILED.getCode());
|
||||
// statusMQDto.setMessage("【文件同步失败请至“服务指令更新功能”重新同步】" + e.getMessage());
|
||||
// statusMQDto.setAsyncId(dto.getAsyncId());
|
||||
// statusMQDto.setCode("file");
|
||||
// rabbitMQUtil.sendToExchange("hldy.fwzl", "fwzl.async.result", statusMQDto);
|
||||
// throw new RuntimeException(e);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 处理全量同步数据
|
||||
// *
|
||||
// * @param dto
|
||||
// */
|
||||
// private void handleQuantity(DirectiveMQDto dto) {
|
||||
// //全量:移除所有服务指令主表、服务指令各字典主表、中间关系表数据
|
||||
// directiveService.removeAll();
|
||||
// //体型标签
|
||||
// bodyTagService.removeAllRelation();
|
||||
// //情绪标签
|
||||
// emotionTagService.removeAllRelation();
|
||||
// //服务类别
|
||||
// serviceCategoryService.removeAll();
|
||||
// //服务类型
|
||||
// serviceTypeService.removeAll();
|
||||
//
|
||||
// dto.setIdList(Arrays.asList(dto.getIdStr().split(",")));
|
||||
//
|
||||
// handleData(dto);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 处理增量同步数据
|
||||
// *
|
||||
// * @param dto
|
||||
// * @throws Exception
|
||||
// */
|
||||
// private void handleIncremental(DirectiveMQDto dto) {
|
||||
// //增量:传过来的是已勾选的全部数据,需将重复部分去除
|
||||
// //先查出所有指令id 然后进行去重
|
||||
// QueryWrapper<ConfigServiceDirective> dtw = new QueryWrapper<>();
|
||||
// dtw.select("id");
|
||||
// List<ConfigServiceDirective> tempList = directiveService.list(dtw);
|
||||
// Set<String> existingIds = tempList.stream()
|
||||
// .map(ConfigServiceDirective::getId)
|
||||
// .map(String::valueOf)
|
||||
// .collect(Collectors.toSet());
|
||||
//
|
||||
// String idStr = dto.getIdStr();
|
||||
// List<String> inputIds = Arrays.asList(idStr.split(","));
|
||||
//
|
||||
// List<String> uniqueIds = inputIds.stream()
|
||||
// .filter(id -> !existingIds.contains(id))
|
||||
// .collect(Collectors.toList());
|
||||
//
|
||||
// dto.setIdList(uniqueIds);
|
||||
//
|
||||
// handleData(dto);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 处理数据
|
||||
// *
|
||||
// * @param dto
|
||||
// */
|
||||
// private void handleData(DirectiveMQDto dto) {
|
||||
// if (dto.getIdList() != null && !dto.getIdList().isEmpty()) {
|
||||
// //体型标签
|
||||
// {
|
||||
// //需要排除的体型标签id
|
||||
// List<String> excludeSubIds = Lists.newArrayList();
|
||||
// if (dto.isIzInc()) {
|
||||
// List<DirectiveBodyTag> list = bodyTagService.list();
|
||||
// excludeSubIds = list.stream().map(DirectiveBodyTag::getId).collect(Collectors.toList());
|
||||
// }
|
||||
// List<DirectiveBodyTag> bodyAll = bodyTagService.selectAll("nuro", dto.getIdList(), excludeSubIds);
|
||||
// if (bodyAll != null && !bodyAll.isEmpty()) {
|
||||
// bodyTagService.insertAll(bodyAll);
|
||||
// }
|
||||
// List<DirectiveBodyTagRelation> bodyRelations = bodyTagService.selectAllRelation("nuro", dto.getIdList(), null);
|
||||
// if (bodyRelations != null && !bodyRelations.isEmpty()) {
|
||||
// bodyTagService.insertAllRelation(bodyRelations);
|
||||
// }
|
||||
// }
|
||||
// //情绪标签
|
||||
// {
|
||||
// //需要排除的情绪标签id
|
||||
// List<String> excludeSubIds = Lists.newArrayList();
|
||||
// if (dto.isIzInc()) {
|
||||
// List<DirectiveEmotionTag> list = emotionTagService.list();
|
||||
// excludeSubIds = list.stream().map(DirectiveEmotionTag::getId).collect(Collectors.toList());
|
||||
// }
|
||||
// List<DirectiveEmotionTag> emoAll = emotionTagService.selectAll("nuro", dto.getIdList(), excludeSubIds);
|
||||
// if (emoAll != null && !emoAll.isEmpty()) {
|
||||
// emotionTagService.insertAll(emoAll);
|
||||
// }
|
||||
// List<DirectiveEmotionTagRelation> emoRelations = emotionTagService.selectAllRelation("nuro", dto.getIdList(), null);
|
||||
// if (emoRelations != null && !emoRelations.isEmpty()) {
|
||||
// emotionTagService.insertAllRelation(emoRelations);
|
||||
// }
|
||||
// }
|
||||
// //服务类别
|
||||
// {
|
||||
// //需要排除的服务类别id
|
||||
// List<String> excludeSubIds = Lists.newArrayList();
|
||||
// if (dto.isIzInc()) {
|
||||
// List<ConfigServiceCategory> list = serviceCategoryService.list();
|
||||
// excludeSubIds = list.stream().map(ConfigServiceCategory::getId).collect(Collectors.toList());
|
||||
// }
|
||||
// List<ConfigServiceCategory> categoryList = serviceCategoryService.selectAll("nuro", dto.getIdList(), excludeSubIds);
|
||||
// if (categoryList != null && !categoryList.isEmpty()) {
|
||||
// serviceCategoryService.insertAll(categoryList);
|
||||
// }
|
||||
// }
|
||||
// //服务类型
|
||||
// {
|
||||
// //需要排除的服务类型id
|
||||
// List<String> excludeSubIds = Lists.newArrayList();
|
||||
// if (dto.isIzInc()) {
|
||||
// List<ConfigServiceType> list = serviceTypeService.list();
|
||||
// excludeSubIds = list.stream().map(ConfigServiceType::getId).collect(Collectors.toList());
|
||||
// }
|
||||
// List<ConfigServiceType> typeList = serviceTypeService.selectAll("nuro", dto.getIdList(), excludeSubIds);
|
||||
// if (typeList != null && !typeList.isEmpty()) {
|
||||
// serviceTypeService.insertAll(typeList);
|
||||
// }
|
||||
// }
|
||||
// //查询服务指令,并将服务指令新增进自己的数据库表中
|
||||
// List<ConfigServiceDirective> directives = directiveService.selectAllByIds("nuro", dto.getIdList());
|
||||
// if (directives != null && !directives.isEmpty()) {
|
||||
// directiveService.insertAllDirectives(directives);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 处理文件同步
|
||||
// *
|
||||
// * @param dto
|
||||
// */
|
||||
// private void handleFileAsync(DirectiveMQDto dto) {
|
||||
// dto.setIdList(Arrays.asList(dto.getIdStr().split(",")));
|
||||
// if (dto.getIdList() == null || dto.getIdList().isEmpty()) {
|
||||
// return;
|
||||
// }
|
||||
// List<JSONObject> objs = directiveService.selectMediaList("nuro", dto.getIdList());
|
||||
// if (CollectionUtils.isEmpty(objs)) {
|
||||
// return;
|
||||
// }
|
||||
// //试验田对应服务指令下的媒体资源
|
||||
// List<MediaManageDto> mediaList = directiveService.selectMediaList("nuro", dto.getIdList())
|
||||
// .stream()
|
||||
// .map(json -> JSONUtil.toBean(json, MediaManageDto.class))
|
||||
// .collect(Collectors.toList());
|
||||
//
|
||||
// //获取机构下媒资数据
|
||||
// List<String> mediaIds = mediaList.stream()
|
||||
// .map(MediaManageDto::getId)
|
||||
// .collect(Collectors.toList());
|
||||
// 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是试验田的媒体资源数据
|
||||
// mediaList.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);
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 处理文件存储
|
||||
// *
|
||||
// * @param media
|
||||
// */
|
||||
// private void handleSaveFile(MediaManageDto 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();
|
||||
// throw new RuntimeException(e);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -549,4 +549,6 @@ public interface ISysBaseAPI extends CommonAPI {
|
|||
* @return
|
||||
*/
|
||||
JSONObject getDeptInfo();
|
||||
|
||||
String getOrgName();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package org.jeecg.modules.api.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.common.collect.Maps;
|
||||
import org.jeecg.modules.system.service.ISysUserService;
|
||||
import org.jeecg.modules.system.service.impl.SysBaseApiImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
|
@ -20,6 +21,7 @@ import java.util.Set;
|
|||
|
||||
/**
|
||||
* 服务化 system模块 对外接口请求类
|
||||
*
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Slf4j
|
||||
|
|
@ -32,49 +34,67 @@ public class SystemApiController {
|
|||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
/**
|
||||
* 通过用户账号查询部门集合
|
||||
*
|
||||
* @param username
|
||||
* @return 部门 id
|
||||
*/
|
||||
@GetMapping("/getOrgName")
|
||||
Result<Map<String,String>> getOrgName() {
|
||||
Map<String,String> result = Maps.newHashMap();
|
||||
result.put("orgName",sysBaseApi.getOrgName());
|
||||
return Result.ok(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送系统消息
|
||||
*
|
||||
* @param message 使用构造器赋值参数 如果不设置category(消息类型)则默认为2 发送系统消息
|
||||
*/
|
||||
@PostMapping("/sendSysAnnouncement")
|
||||
public void sendSysAnnouncement(@RequestBody MessageDTO message){
|
||||
public void sendSysAnnouncement(@RequestBody MessageDTO message) {
|
||||
sysBaseApi.sendSysAnnouncement(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送消息 附带业务参数
|
||||
*
|
||||
* @param message 使用构造器赋值参数
|
||||
*/
|
||||
@PostMapping("/sendBusAnnouncement")
|
||||
public void sendBusAnnouncement(@RequestBody BusMessageDTO message){
|
||||
public void sendBusAnnouncement(@RequestBody BusMessageDTO message) {
|
||||
sysBaseApi.sendBusAnnouncement(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过模板发送消息
|
||||
*
|
||||
* @param message 使用构造器赋值参数
|
||||
*/
|
||||
@PostMapping("/sendTemplateAnnouncement")
|
||||
public void sendTemplateAnnouncement(@RequestBody TemplateMessageDTO message){
|
||||
public void sendTemplateAnnouncement(@RequestBody TemplateMessageDTO message) {
|
||||
sysBaseApi.sendTemplateAnnouncement(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过模板发送消息 附带业务参数
|
||||
*
|
||||
* @param message 使用构造器赋值参数
|
||||
*/
|
||||
@PostMapping("/sendBusTemplateAnnouncement")
|
||||
public void sendBusTemplateAnnouncement(@RequestBody BusTemplateMessageDTO message){
|
||||
public void sendBusTemplateAnnouncement(@RequestBody BusTemplateMessageDTO message) {
|
||||
sysBaseApi.sendBusTemplateAnnouncement(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过消息中心模板,生成推送内容
|
||||
*
|
||||
* @param templateDTO 使用构造器赋值参数
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/parseTemplateByCode")
|
||||
public String parseTemplateByCode(@RequestBody TemplateDTO templateDTO){
|
||||
public String parseTemplateByCode(@RequestBody TemplateDTO templateDTO) {
|
||||
return sysBaseApi.parseTemplateByCode(templateDTO);
|
||||
}
|
||||
|
||||
|
|
@ -82,17 +102,18 @@ public class SystemApiController {
|
|||
* 根据业务类型busType及业务busId修改消息已读
|
||||
*/
|
||||
@GetMapping("/updateSysAnnounReadFlag")
|
||||
public void updateSysAnnounReadFlag(@RequestParam("busType") String busType, @RequestParam("busId")String busId){
|
||||
public void updateSysAnnounReadFlag(@RequestParam("busType") String busType, @RequestParam("busId") String busId) {
|
||||
sysBaseApi.updateSysAnnounReadFlag(busType, busId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户账号查询用户信息
|
||||
*
|
||||
* @param username
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getUserByName")
|
||||
public LoginUser getUserByName(@RequestParam("username") String username){
|
||||
public LoginUser getUserByName(@RequestParam("username") String username) {
|
||||
LoginUser loginUser = sysBaseApi.getUserByName(username);
|
||||
//用户信息加密
|
||||
try {
|
||||
|
|
@ -105,22 +126,24 @@ public class SystemApiController {
|
|||
|
||||
/**
|
||||
* 根据用户账号查询用户ID
|
||||
*
|
||||
* @param username
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getUserIdByName")
|
||||
public String getUserIdByName(@RequestParam("username") String username){
|
||||
public String getUserIdByName(@RequestParam("username") String username) {
|
||||
String userId = sysBaseApi.getUserIdByName(username);
|
||||
return userId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户id查询用户信息
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getUserById")
|
||||
LoginUser getUserById(@RequestParam("id") String id){
|
||||
LoginUser getUserById(@RequestParam("id") String id) {
|
||||
LoginUser loginUser = sysBaseApi.getUserById(id);
|
||||
//用户信息加密
|
||||
try {
|
||||
|
|
@ -133,99 +156,110 @@ public class SystemApiController {
|
|||
|
||||
/**
|
||||
* 通过用户账号查询角色集合
|
||||
*
|
||||
* @param username
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getRolesByUsername")
|
||||
List<String> getRolesByUsername(@RequestParam("username") String username){
|
||||
List<String> getRolesByUsername(@RequestParam("username") String username) {
|
||||
return sysBaseApi.getRolesByUsername(username);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过用户账号查询角色集合
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getRolesByUserId")
|
||||
List<String> getRolesByUserId(@RequestParam("userId") String userId){
|
||||
List<String> getRolesByUserId(@RequestParam("userId") String userId) {
|
||||
return sysBaseApi.getRolesByUserId(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过用户账号查询部门集合
|
||||
*
|
||||
* @param username
|
||||
* @return 部门 id
|
||||
*/
|
||||
@GetMapping("/getDepartIdsByUsername")
|
||||
List<String> getDepartIdsByUsername(@RequestParam("username") String username){
|
||||
List<String> getDepartIdsByUsername(@RequestParam("username") String username) {
|
||||
return sysBaseApi.getDepartIdsByUsername(username);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过用户账号查询部门集合
|
||||
*
|
||||
* @param userId
|
||||
* @return 部门 id
|
||||
*/
|
||||
@GetMapping("/getDepartIdsByUserId")
|
||||
List<String> getDepartIdsByUserId(@RequestParam("userId") String userId){
|
||||
List<String> getDepartIdsByUserId(@RequestParam("userId") String userId) {
|
||||
return sysBaseApi.getDepartIdsByUserId(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过用户账号查询部门父ID集合
|
||||
*
|
||||
* @param username
|
||||
* @return 部门 id
|
||||
*/
|
||||
@GetMapping("/getDepartParentIdsByUsername")
|
||||
Set<String> getDepartParentIdsByUsername(@RequestParam("username") String username){
|
||||
Set<String> getDepartParentIdsByUsername(@RequestParam("username") String username) {
|
||||
return sysBaseApi.getDepartParentIdsByUsername(username);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询部门父ID集合
|
||||
*
|
||||
* @param depIds
|
||||
* @return 部门 id
|
||||
*/
|
||||
@GetMapping("/getDepartParentIdsByDepIds")
|
||||
Set<String> getDepartParentIdsByDepIds(@RequestParam("depIds") Set<String> depIds){
|
||||
Set<String> getDepartParentIdsByDepIds(@RequestParam("depIds") Set<String> depIds) {
|
||||
return sysBaseApi.getDepartParentIdsByDepIds(depIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过用户账号查询部门 name
|
||||
*
|
||||
* @param username
|
||||
* @return 部门 name
|
||||
*/
|
||||
@GetMapping("/getDepartNamesByUsername")
|
||||
List<String> getDepartNamesByUsername(@RequestParam("username") String username){
|
||||
List<String> getDepartNamesByUsername(@RequestParam("username") String username) {
|
||||
return sysBaseApi.getDepartNamesByUsername(username);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取数据字典
|
||||
*
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/queryDictItemsByCode")
|
||||
List<DictModel> queryDictItemsByCode(@RequestParam("code") String code){
|
||||
List<DictModel> queryDictItemsByCode(@RequestParam("code") String code) {
|
||||
return sysBaseApi.queryDictItemsByCode(code);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取有效的数据字典
|
||||
*
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/queryEnableDictItemsByCode")
|
||||
List<DictModel> queryEnableDictItemsByCode(@RequestParam("code") String code){
|
||||
List<DictModel> queryEnableDictItemsByCode(@RequestParam("code") String code) {
|
||||
return sysBaseApi.queryEnableDictItemsByCode(code);
|
||||
}
|
||||
|
||||
|
||||
/** 查询所有的父级字典,按照create_time排序 */
|
||||
/**
|
||||
* 查询所有的父级字典,按照create_time排序
|
||||
*/
|
||||
@GetMapping("/queryAllDict")
|
||||
List<DictModel> queryAllDict(){
|
||||
List<DictModel> queryAllDict() {
|
||||
// try{
|
||||
// //睡10秒,gateway网关5秒超时,会触发熔断降级操作
|
||||
// Thread.sleep(10000);
|
||||
|
|
@ -239,63 +273,69 @@ public class SystemApiController {
|
|||
|
||||
/**
|
||||
* 查询所有分类字典
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/queryAllSysCategory")
|
||||
List<SysCategoryModel> queryAllSysCategory(){
|
||||
List<SysCategoryModel> queryAllSysCategory() {
|
||||
return sysBaseApi.queryAllSysCategory();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询所有部门 作为字典信息 id -->value,departName -->text
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/queryAllDepartBackDictModel")
|
||||
List<DictModel> queryAllDepartBackDictModel(){
|
||||
List<DictModel> queryAllDepartBackDictModel() {
|
||||
return sysBaseApi.queryAllDepartBackDictModel();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有角色 带参
|
||||
* roleIds 默认选中角色
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/queryAllRole")
|
||||
public List<ComboModel> queryAllRole(@RequestParam(name = "roleIds",required = false)String[] roleIds){
|
||||
if(roleIds==null || roleIds.length==0){
|
||||
public List<ComboModel> queryAllRole(@RequestParam(name = "roleIds", required = false) String[] roleIds) {
|
||||
if (roleIds == null || roleIds.length == 0) {
|
||||
return sysBaseApi.queryAllRole();
|
||||
}else{
|
||||
} else {
|
||||
return sysBaseApi.queryAllRole(roleIds);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过用户账号查询角色Id集合
|
||||
*
|
||||
* @param username
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getRoleIdsByUsername")
|
||||
public List<String> getRoleIdsByUsername(@RequestParam("username")String username){
|
||||
public List<String> getRoleIdsByUsername(@RequestParam("username") String username) {
|
||||
return sysBaseApi.getRoleIdsByUsername(username);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过部门编号查询部门id
|
||||
*
|
||||
* @param orgCode
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getDepartIdsByOrgCode")
|
||||
public String getDepartIdsByOrgCode(@RequestParam("orgCode")String orgCode){
|
||||
public String getDepartIdsByOrgCode(@RequestParam("orgCode") String orgCode) {
|
||||
return sysBaseApi.getDepartIdsByOrgCode(orgCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有部门
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getAllSysDepart")
|
||||
public List<SysDepartModel> getAllSysDepart(){
|
||||
public List<SysDepartModel> getAllSysDepart() {
|
||||
return sysBaseApi.getAllSysDepart();
|
||||
}
|
||||
|
||||
|
|
@ -306,29 +346,30 @@ public class SystemApiController {
|
|||
* @return
|
||||
*/
|
||||
@GetMapping("/getDynamicDbSourceById")
|
||||
DynamicDataSourceModel getDynamicDbSourceById(@RequestParam("dbSourceId")String dbSourceId){
|
||||
DynamicDataSourceModel getDynamicDbSourceById(@RequestParam("dbSourceId") String dbSourceId) {
|
||||
return sysBaseApi.getDynamicDbSourceById(dbSourceId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据部门Id获取部门负责人
|
||||
*
|
||||
* @param deptId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getDeptHeadByDepId")
|
||||
public List<String> getDeptHeadByDepId(@RequestParam("deptId") String deptId){
|
||||
public List<String> getDeptHeadByDepId(@RequestParam("deptId") String deptId) {
|
||||
return sysBaseApi.getDeptHeadByDepId(deptId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找父级部门
|
||||
*
|
||||
* @param departId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getParentDepartId")
|
||||
public DictModel getParentDepartId(@RequestParam("departId")String departId){
|
||||
public DictModel getParentDepartId(@RequestParam("departId") String departId) {
|
||||
return sysBaseApi.getParentDepartId(departId);
|
||||
}
|
||||
|
||||
|
|
@ -339,17 +380,18 @@ public class SystemApiController {
|
|||
* @return
|
||||
*/
|
||||
@GetMapping("/getDynamicDbSourceByCode")
|
||||
public DynamicDataSourceModel getDynamicDbSourceByCode(@RequestParam("dbSourceCode") String dbSourceCode){
|
||||
public DynamicDataSourceModel getDynamicDbSourceByCode(@RequestParam("dbSourceCode") String dbSourceCode) {
|
||||
return sysBaseApi.getDynamicDbSourceByCode(dbSourceCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 给指定用户发消息
|
||||
*
|
||||
* @param userIds
|
||||
* @param cmd
|
||||
*/
|
||||
@GetMapping("/sendWebSocketMsg")
|
||||
public void sendWebSocketMsg(String[] userIds, String cmd){
|
||||
public void sendWebSocketMsg(String[] userIds, String cmd) {
|
||||
sysBaseApi.sendWebSocketMsg(userIds, cmd);
|
||||
}
|
||||
|
||||
|
|
@ -357,81 +399,88 @@ public class SystemApiController {
|
|||
/**
|
||||
* 根据id获取所有参与用户
|
||||
* userIds
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/queryAllUserByIds")
|
||||
public List<UserAccountInfo> queryAllUserByIds(@RequestParam("userIds") String[] userIds){
|
||||
public List<UserAccountInfo> queryAllUserByIds(@RequestParam("userIds") String[] userIds) {
|
||||
return sysBaseApi.queryAllUserByIds(userIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有用户 返回ComboModel
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/queryAllUserBackCombo")
|
||||
public List<ComboModel> queryAllUserBackCombo(){
|
||||
public List<ComboModel> queryAllUserBackCombo() {
|
||||
return sysBaseApi.queryAllUserBackCombo();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询用户 返回JSONObject
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/queryAllUser")
|
||||
public JSONObject queryAllUser(@RequestParam(name="userIds",required=false)String userIds, @RequestParam(name="pageNo",required=false) Integer pageNo,@RequestParam(name="pageSize",required=false) Integer pageSize){
|
||||
public JSONObject queryAllUser(@RequestParam(name = "userIds", required = false) String userIds, @RequestParam(name = "pageNo", required = false) Integer pageNo, @RequestParam(name = "pageSize", required = false) Integer pageSize) {
|
||||
return sysBaseApi.queryAllUser(userIds, pageNo, pageSize);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 将会议签到信息推动到预览
|
||||
* userIds
|
||||
* @return
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/meetingSignWebsocket")
|
||||
public void meetingSignWebsocket(@RequestParam("userId")String userId){
|
||||
public void meetingSignWebsocket(@RequestParam("userId") String userId) {
|
||||
sysBaseApi.meetingSignWebsocket(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据name获取所有参与用户
|
||||
* userNames
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/queryUserByNames")
|
||||
public List<UserAccountInfo> queryUserByNames(@RequestParam("userNames")String[] userNames){
|
||||
public List<UserAccountInfo> queryUserByNames(@RequestParam("userNames") String[] userNames) {
|
||||
return sysBaseApi.queryUserByNames(userNames);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户的角色集合
|
||||
*
|
||||
* @param username
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getUserRoleSet")
|
||||
public Set<String> getUserRoleSet(@RequestParam("username")String username){
|
||||
public Set<String> getUserRoleSet(@RequestParam("username") String username) {
|
||||
return sysBaseApi.getUserRoleSet(username);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户的角色集合
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getUserRoleSetById")
|
||||
public Set<String> getUserRoleSetById(@RequestParam("userId")String userId){
|
||||
public Set<String> getUserRoleSetById(@RequestParam("userId") String userId) {
|
||||
return sysBaseApi.getUserRoleSetById(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户的权限集合
|
||||
*
|
||||
* @param userId 用户表ID
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getUserPermissionSet")
|
||||
public Set<String> getUserPermissionSet(@RequestParam("userId") String userId){
|
||||
public Set<String> getUserPermissionSet(@RequestParam("userId") String userId) {
|
||||
return sysBaseApi.getUserPermissionSet(userId);
|
||||
}
|
||||
|
||||
|
|
@ -439,42 +488,46 @@ public class SystemApiController {
|
|||
|
||||
/**
|
||||
* 判断是否有online访问的权限
|
||||
*
|
||||
* @param onlineAuthDTO
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/hasOnlineAuth")
|
||||
public boolean hasOnlineAuth(@RequestBody OnlineAuthDTO onlineAuthDTO){
|
||||
public boolean hasOnlineAuth(@RequestBody OnlineAuthDTO onlineAuthDTO) {
|
||||
return sysBaseApi.hasOnlineAuth(onlineAuthDTO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户角色信息
|
||||
*
|
||||
* @param username
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/queryUserRoles")
|
||||
public Set<String> queryUserRoles(@RequestParam("username") String username){
|
||||
public Set<String> queryUserRoles(@RequestParam("username") String username) {
|
||||
return sysUserService.getUserRolesSet(username);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户角色信息
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/queryUserRolesById")
|
||||
public Set<String> queryUserRolesById(@RequestParam("userId") String userId){
|
||||
public Set<String> queryUserRolesById(@RequestParam("userId") String userId) {
|
||||
return sysUserService.getUserRoleSetById(userId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询用户权限信息
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/queryUserAuths")
|
||||
public Set<String> queryUserAuths(@RequestParam("userId") String userId){
|
||||
public Set<String> queryUserAuths(@RequestParam("userId") String userId) {
|
||||
return sysUserService.getUserPermissionsSet(userId);
|
||||
}
|
||||
|
||||
|
|
@ -482,109 +535,122 @@ public class SystemApiController {
|
|||
* 通过部门id获取部门全部信息
|
||||
*/
|
||||
@GetMapping("/selectAllById")
|
||||
public SysDepartModel selectAllById(@RequestParam("id") String id){
|
||||
public SysDepartModel selectAllById(@RequestParam("id") String id) {
|
||||
return sysBaseApi.selectAllById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户id查询用户所属公司下所有用户ids
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/queryDeptUsersByUserId")
|
||||
public List<String> queryDeptUsersByUserId(@RequestParam("userId") String userId){
|
||||
public List<String> queryDeptUsersByUserId(@RequestParam("userId") String userId) {
|
||||
return sysBaseApi.queryDeptUsersByUserId(userId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询数据权限
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/queryPermissionDataRule")
|
||||
public List<SysPermissionDataRuleModel> queryPermissionDataRule(@RequestParam("component") String component, @RequestParam("requestPath")String requestPath, @RequestParam("username") String username){
|
||||
public List<SysPermissionDataRuleModel> queryPermissionDataRule(@RequestParam("component") String component, @RequestParam("requestPath") String requestPath, @RequestParam("username") String username) {
|
||||
return sysBaseApi.queryPermissionDataRule(component, requestPath, username);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户信息
|
||||
*
|
||||
* @param username
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getCacheUser")
|
||||
public SysUserCacheInfo getCacheUser(@RequestParam("username") String username){
|
||||
public SysUserCacheInfo getCacheUser(@RequestParam("username") String username) {
|
||||
return sysBaseApi.getCacheUser(username);
|
||||
}
|
||||
|
||||
/**
|
||||
* 普通字典的翻译
|
||||
*
|
||||
* @param code
|
||||
* @param key
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/translateDict")
|
||||
public String translateDict(@RequestParam("code") String code, @RequestParam("key") String key){
|
||||
public String translateDict(@RequestParam("code") String code, @RequestParam("key") String key) {
|
||||
return sysBaseApi.translateDict(code, key);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 36根据多个用户账号(逗号分隔),查询返回多个用户信息
|
||||
*
|
||||
* @param usernames
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/queryUsersByUsernames")
|
||||
List<JSONObject> queryUsersByUsernames(@RequestParam("usernames") String usernames){
|
||||
List<JSONObject> queryUsersByUsernames(@RequestParam("usernames") String usernames) {
|
||||
return this.sysBaseApi.queryUsersByUsernames(usernames);
|
||||
}
|
||||
|
||||
/**
|
||||
* 37根据多个用户id(逗号分隔),查询返回多个用户信息
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/queryUsersByIds")
|
||||
List<JSONObject> queryUsersByIds(@RequestParam("ids") String ids){
|
||||
List<JSONObject> queryUsersByIds(@RequestParam("ids") String ids) {
|
||||
return this.sysBaseApi.queryUsersByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 38根据多个部门编码(逗号分隔),查询返回多个部门信息
|
||||
*
|
||||
* @param orgCodes
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/queryDepartsByOrgcodes")
|
||||
List<JSONObject> queryDepartsByOrgcodes(@RequestParam("orgCodes") String orgCodes){
|
||||
List<JSONObject> queryDepartsByOrgcodes(@RequestParam("orgCodes") String orgCodes) {
|
||||
return this.sysBaseApi.queryDepartsByOrgcodes(orgCodes);
|
||||
}
|
||||
|
||||
/**
|
||||
* 39根据多个部门ID(逗号分隔),查询返回多个部门信息
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/queryDepartsByIds")
|
||||
List<JSONObject> queryDepartsByIds(@RequestParam("ids") String ids){
|
||||
List<JSONObject> queryDepartsByIds(@RequestParam("ids") String ids) {
|
||||
return this.sysBaseApi.queryDepartsByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 40发送邮件消息
|
||||
*
|
||||
* @param email
|
||||
* @param title
|
||||
* @param content
|
||||
*/
|
||||
@GetMapping("/sendEmailMsg")
|
||||
public void sendEmailMsg(@RequestParam("email")String email,@RequestParam("title")String title,@RequestParam("content")String content){
|
||||
this.sysBaseApi.sendEmailMsg(email,title,content);
|
||||
};
|
||||
public void sendEmailMsg(@RequestParam("email") String email, @RequestParam("title") String title, @RequestParam("content") String content) {
|
||||
this.sysBaseApi.sendEmailMsg(email, title, content);
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
/**
|
||||
* 41 获取公司下级部门和公司下所有用户信息
|
||||
*
|
||||
* @param orgCode
|
||||
*/
|
||||
@GetMapping("/getDeptUserByOrgCode")
|
||||
List<Map> getDeptUserByOrgCode(@RequestParam("orgCode")String orgCode){
|
||||
return this.sysBaseApi.getDeptUserByOrgCode(orgCode);
|
||||
List<Map> getDeptUserByOrgCode(@RequestParam("orgCode") String orgCode) {
|
||||
return this.sysBaseApi.getDeptUserByOrgCode(orgCode);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -670,35 +736,38 @@ public class SystemApiController {
|
|||
@RequestParam("keyword") String keyword,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1", required = false) Integer pageNo,
|
||||
@RequestParam(value = "pageSize", required = false) Integer pageSize) {
|
||||
return sysBaseApi.loadDictItemByKeyword(dictCode, keyword,pageNo, pageSize);
|
||||
return sysBaseApi.loadDictItemByKeyword(dictCode, keyword, pageNo, pageSize);
|
||||
}
|
||||
|
||||
/**
|
||||
* 48 普通字典的翻译,根据多个dictCode和多条数据,多个以逗号分割
|
||||
*
|
||||
* @param dictCodes
|
||||
* @param keys
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/translateManyDict")
|
||||
public Map<String, List<DictModel>> translateManyDict(@RequestParam("dictCodes") String dictCodes, @RequestParam("keys") String keys){
|
||||
public Map<String, List<DictModel>> translateManyDict(@RequestParam("dictCodes") String dictCodes, @RequestParam("keys") String keys) {
|
||||
return this.sysBaseApi.translateManyDict(dictCodes, keys);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取表数据字典 【接口签名验证】
|
||||
*
|
||||
* @param tableFilterSql 表名可以带where条件
|
||||
* @param text
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/queryTableDictItemsByCode")
|
||||
List<DictModel> queryTableDictItemsByCode(@RequestParam("tableFilterSql") String tableFilterSql, @RequestParam("text") String text, @RequestParam("code") String code){
|
||||
List<DictModel> queryTableDictItemsByCode(@RequestParam("tableFilterSql") String tableFilterSql, @RequestParam("text") String text, @RequestParam("code") String code) {
|
||||
return sysBaseApi.queryTableDictItemsByCode(tableFilterSql, text, code);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询表字典 支持过滤数据 【接口签名验证】
|
||||
*
|
||||
* @param table
|
||||
* @param text
|
||||
* @param code
|
||||
|
|
@ -706,13 +775,14 @@ public class SystemApiController {
|
|||
* @return
|
||||
*/
|
||||
@GetMapping("/queryFilterTableDictInfo")
|
||||
List<DictModel> queryFilterTableDictInfo(@RequestParam("table") String table, @RequestParam("text") String text, @RequestParam("code") String code, @RequestParam("filterSql") String filterSql){
|
||||
List<DictModel> queryFilterTableDictInfo(@RequestParam("table") String table, @RequestParam("text") String text, @RequestParam("code") String code, @RequestParam("filterSql") String filterSql) {
|
||||
return sysBaseApi.queryFilterTableDictInfo(table, text, code, filterSql);
|
||||
}
|
||||
|
||||
/**
|
||||
* 【接口签名验证】
|
||||
* 查询指定table的 text code 获取字典,包含text和value
|
||||
*
|
||||
* @param table
|
||||
* @param text
|
||||
* @param code
|
||||
|
|
@ -721,13 +791,14 @@ public class SystemApiController {
|
|||
*/
|
||||
@Deprecated
|
||||
@GetMapping("/queryTableDictByKeys")
|
||||
public List<String> queryTableDictByKeys(@RequestParam("table") String table, @RequestParam("text") String text, @RequestParam("code") String code, @RequestParam("keyArray") String[] keyArray){
|
||||
public List<String> queryTableDictByKeys(@RequestParam("table") String table, @RequestParam("text") String text, @RequestParam("code") String code, @RequestParam("keyArray") String[] keyArray) {
|
||||
return sysBaseApi.queryTableDictByKeys(table, text, code, keyArray);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 字典表的 翻译【接口签名验证】
|
||||
*
|
||||
* @param table
|
||||
* @param text
|
||||
* @param code
|
||||
|
|
@ -735,12 +806,13 @@ public class SystemApiController {
|
|||
* @return
|
||||
*/
|
||||
@GetMapping("/translateDictFromTable")
|
||||
public String translateDictFromTable(@RequestParam("table") String table, @RequestParam("text") String text, @RequestParam("code") String code, @RequestParam("key") String key){
|
||||
public String translateDictFromTable(@RequestParam("table") String table, @RequestParam("text") String text, @RequestParam("code") String code, @RequestParam("key") String key) {
|
||||
return sysBaseApi.translateDictFromTable(table, text, code, key);
|
||||
}
|
||||
|
||||
|
||||
//update-begin---author:chenrui ---date:20231221 for:[issues/#5643]解决分布式下表字典跨库无法查询问题------------
|
||||
|
||||
/**
|
||||
* 【接口签名验证】
|
||||
* 49 字典表的 翻译,可批量
|
||||
|
|
@ -749,60 +821,65 @@ public class SystemApiController {
|
|||
* @param text
|
||||
* @param code
|
||||
* @param keys 多个用逗号分割
|
||||
* @param ds 数据源
|
||||
* @param ds 数据源
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/translateDictFromTableByKeys")
|
||||
public List<DictModel> translateDictFromTableByKeys(@RequestParam("table") String table, @RequestParam("text") String text, @RequestParam("code") String code, @RequestParam("keys") String keys, @RequestParam("ds") String ds) {
|
||||
public List<DictModel> translateDictFromTableByKeys(@RequestParam("table") String table, @RequestParam("text") String text, @RequestParam("code") String code, @RequestParam("keys") String keys, @RequestParam("ds") String ds) {
|
||||
return this.sysBaseApi.translateDictFromTableByKeys(table, text, code, keys, ds);
|
||||
}
|
||||
//update-end---author:chenrui ---date:20231221 for:[issues/#5643]解决分布式下表字典跨库无法查询问题------------
|
||||
|
||||
/**
|
||||
* 发送模板信息
|
||||
*
|
||||
* @param message
|
||||
*/
|
||||
@PostMapping("/sendTemplateMessage")
|
||||
public void sendTemplateMessage(@RequestBody MessageDTO message){
|
||||
public void sendTemplateMessage(@RequestBody MessageDTO message) {
|
||||
sysBaseApi.sendTemplateMessage(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取消息模板内容
|
||||
*
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getTemplateContent")
|
||||
public String getTemplateContent(@RequestParam("code") String code){
|
||||
public String getTemplateContent(@RequestParam("code") String code) {
|
||||
return this.sysBaseApi.getTemplateContent(code);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存数据日志
|
||||
*
|
||||
* @param dataLogDto
|
||||
*/
|
||||
@PostMapping("/saveDataLog")
|
||||
public void saveDataLog(@RequestBody DataLogDTO dataLogDto){
|
||||
public void saveDataLog(@RequestBody DataLogDTO dataLogDto) {
|
||||
this.sysBaseApi.saveDataLog(dataLogDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新头像
|
||||
*
|
||||
* @param loginUser
|
||||
* @return
|
||||
*/
|
||||
@PutMapping("/updateAvatar")
|
||||
public void updateAvatar(@RequestBody LoginUser loginUser){
|
||||
public void updateAvatar(@RequestBody LoginUser loginUser) {
|
||||
this.sysBaseApi.updateAvatar(loginUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 向app端 websocket推送聊天刷新消息
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sendAppChatSocket")
|
||||
public void sendAppChatSocket(@RequestParam(name="userId") String userId){
|
||||
public void sendAppChatSocket(@RequestParam(name = "userId") String userId) {
|
||||
this.sysBaseApi.sendAppChatSocket(userId);
|
||||
}
|
||||
|
||||
|
|
@ -819,26 +896,28 @@ public class SystemApiController {
|
|||
|
||||
/**
|
||||
* 获取消息模板内容
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getRoleCode")
|
||||
public String getRoleCode(@RequestParam("id") String id){
|
||||
public String getRoleCode(@RequestParam("id") String id) {
|
||||
return this.sysBaseApi.getRoleCodeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* VUEN-2584【issue】平台sql注入漏洞几个问题
|
||||
* 部分特殊函数 可以将查询结果混夹在错误信息中,导致数据库的信息暴露
|
||||
*
|
||||
* @param e
|
||||
* @return
|
||||
*/
|
||||
@ExceptionHandler(java.sql.SQLException.class)
|
||||
public Result<?> handleSQLException(Exception e){
|
||||
public Result<?> handleSQLException(Exception e) {
|
||||
String msg = e.getMessage();
|
||||
String extractvalue = "extractvalue";
|
||||
String updatexml = "updatexml";
|
||||
if(msg!=null && (msg.toLowerCase().indexOf(extractvalue)>=0 || msg.toLowerCase().indexOf(updatexml)>=0)){
|
||||
if (msg != null && (msg.toLowerCase().indexOf(extractvalue) >= 0 || msg.toLowerCase().indexOf(updatexml) >= 0)) {
|
||||
return Result.error("校验失败,sql解析异常!");
|
||||
}
|
||||
return Result.error("校验失败,sql解析异常!" + msg);
|
||||
|
|
@ -846,96 +925,105 @@ public class SystemApiController {
|
|||
|
||||
/**
|
||||
* 根据高级查询条件查询用户
|
||||
*
|
||||
* @param superQuery
|
||||
* @param matchType
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/queryUserBySuperQuery")
|
||||
public List<JSONObject> queryUserBySuperQuery(@RequestParam("superQuery") String superQuery, @RequestParam("matchType") String matchType) {
|
||||
return sysBaseApi.queryUserBySuperQuery(superQuery,matchType);
|
||||
public List<JSONObject> queryUserBySuperQuery(@RequestParam("superQuery") String superQuery, @RequestParam("matchType") String matchType) {
|
||||
return sysBaseApi.queryUserBySuperQuery(superQuery, matchType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id条件查询用户
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/queryUserById")
|
||||
public JSONObject queryUserById(@RequestParam("id") String id) {
|
||||
public JSONObject queryUserById(@RequestParam("id") String id) {
|
||||
return sysBaseApi.queryUserById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据高级查询条件查询部门
|
||||
*
|
||||
* @param superQuery
|
||||
* @param matchType
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/queryDeptBySuperQuery")
|
||||
public List<JSONObject> queryDeptBySuperQuery(@RequestParam("superQuery") String superQuery, @RequestParam("matchType") String matchType) {
|
||||
return sysBaseApi.queryDeptBySuperQuery(superQuery,matchType);
|
||||
public List<JSONObject> queryDeptBySuperQuery(@RequestParam("superQuery") String superQuery, @RequestParam("matchType") String matchType) {
|
||||
return sysBaseApi.queryDeptBySuperQuery(superQuery, matchType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据高级查询条件查询角色
|
||||
*
|
||||
* @param superQuery
|
||||
* @param matchType
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/queryRoleBySuperQuery")
|
||||
public List<JSONObject> queryRoleBySuperQuery(@RequestParam("superQuery") String superQuery, @RequestParam("matchType") String matchType) {
|
||||
return sysBaseApi.queryRoleBySuperQuery(superQuery,matchType);
|
||||
public List<JSONObject> queryRoleBySuperQuery(@RequestParam("superQuery") String superQuery, @RequestParam("matchType") String matchType) {
|
||||
return sysBaseApi.queryRoleBySuperQuery(superQuery, matchType);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据租户ID查询用户ID
|
||||
*
|
||||
* @param tenantId 租户ID
|
||||
* @return List<String>
|
||||
*/
|
||||
@GetMapping("/selectUserIdByTenantId")
|
||||
public List<String> selectUserIdByTenantId(@RequestParam("tenantId") String tenantId) {
|
||||
public List<String> selectUserIdByTenantId(@RequestParam("tenantId") String tenantId) {
|
||||
return sysBaseApi.selectUserIdByTenantId(tenantId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据部门ID查询用户ID
|
||||
*
|
||||
* @param deptIds
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/queryUserIdsByDeptIds")
|
||||
public List<String> queryUserIdsByDeptIds(@RequestParam("deptIds") List<String> deptIds){
|
||||
public List<String> queryUserIdsByDeptIds(@RequestParam("deptIds") List<String> deptIds) {
|
||||
return sysBaseApi.queryUserIdsByDeptIds(deptIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据部门ID查询用户ID
|
||||
*
|
||||
* @param deptIds
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/queryUserAccountsByDeptIds")
|
||||
public List<String> queryUserAccountsByDeptIds(@RequestParam("deptIds") List<String> deptIds){
|
||||
public List<String> queryUserAccountsByDeptIds(@RequestParam("deptIds") List<String> deptIds) {
|
||||
return sysBaseApi.queryUserAccountsByDeptIds(deptIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据角色编码 查询用户ID
|
||||
*
|
||||
* @param roleCodes
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/queryUserIdsByRoleds")
|
||||
public List<String> queryUserIdsByRoleds(@RequestParam("roleCodes") List<String> roleCodes){
|
||||
public List<String> queryUserIdsByRoleds(@RequestParam("roleCodes") List<String> roleCodes) {
|
||||
return sysBaseApi.queryUserIdsByRoleds(roleCodes);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据职务ID查询用户ID
|
||||
*
|
||||
* @param positionIds
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/queryUserIdsByPositionIds")
|
||||
public List<String> queryUserIdsByPositionIds(@RequestParam("positionIds") List<String> positionIds){
|
||||
public List<String> queryUserIdsByPositionIds(@RequestParam("positionIds") List<String> positionIds) {
|
||||
return sysBaseApi.queryUserIdsByPositionIds(positionIds);
|
||||
}
|
||||
|
||||
|
|
@ -947,7 +1035,7 @@ public class SystemApiController {
|
|||
* @return
|
||||
*/
|
||||
@GetMapping("/getUserAccountsByDepCode")
|
||||
public List<String> getUserAccountsByDepCode(@RequestParam("orgCode") String orgCode){
|
||||
public List<String> getUserAccountsByDepCode(@RequestParam("orgCode") String orgCode) {
|
||||
return sysBaseApi.getUserAccountsByDepCode(orgCode);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -238,4 +238,6 @@ public interface ISysDepartService extends IService<SysDepart>{
|
|||
* @param errorMessageList
|
||||
*/
|
||||
void importSysDepart(List<SysDepartExportVo> listSysDeparts, List<String> errorMessageList);
|
||||
|
||||
String getOrgName();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1845,5 +1845,10 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
|||
return new JSONObject(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOrgName() {
|
||||
return sysDepartService.getOrgName();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1348,6 +1348,16 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOrgName() {
|
||||
QueryWrapper<SysDepart> qw = new QueryWrapper<>();
|
||||
qw.eq("org_category","1");
|
||||
qw.eq("org_type","1");
|
||||
qw.eq("del_flag","0");
|
||||
SysDepart sysDepart = baseMapper.selectOne(qw);
|
||||
return sysDepart.getDepartName();
|
||||
}
|
||||
|
||||
/**
|
||||
* 寻找部门路径
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
server:
|
||||
port: 8082
|
||||
port: 8092
|
||||
tomcat:
|
||||
max-swallow-size: -1
|
||||
error:
|
||||
|
|
@ -7,7 +7,7 @@ server:
|
|||
include-stacktrace: ALWAYS
|
||||
include-message: ALWAYS
|
||||
servlet:
|
||||
context-path: /nursing-unit_002
|
||||
context-path: /nursing-unit_102
|
||||
compression:
|
||||
enabled: true
|
||||
min-response-size: 1024
|
||||
|
|
@ -254,8 +254,6 @@ jeecg:
|
|||
pc: http://localhost:3100
|
||||
app: http://localhost:8051
|
||||
path:
|
||||
#服务指令上传目录
|
||||
directivepath: /cache/nu/opt/upFiles002/directive
|
||||
#文件上传根目录 设置
|
||||
upload: /cache/nu/opt/upFiles002
|
||||
#webapp文件路径
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
server:
|
||||
port: 8083
|
||||
port: 8093
|
||||
tomcat:
|
||||
max-swallow-size: -1
|
||||
error:
|
||||
|
|
@ -7,7 +7,7 @@ server:
|
|||
include-stacktrace: ALWAYS
|
||||
include-message: ALWAYS
|
||||
servlet:
|
||||
context-path: /nursing-unit_003
|
||||
context-path: /nursing-unit_103
|
||||
compression:
|
||||
enabled: true
|
||||
min-response-size: 1024
|
||||
|
|
@ -254,8 +254,6 @@ jeecg:
|
|||
pc: http://localhost:3100
|
||||
app: http://localhost:8051
|
||||
path:
|
||||
#服务指令上传目录
|
||||
directivepath: /cache/nu/opt/upFiles003/directive
|
||||
#文件上传根目录 设置
|
||||
upload: /cache/nu/opt/upFiles003
|
||||
#webapp文件路径
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
server:
|
||||
port: 8081
|
||||
port: 8091
|
||||
tomcat:
|
||||
max-swallow-size: -1
|
||||
error:
|
||||
|
|
@ -7,7 +7,7 @@ server:
|
|||
include-stacktrace: ALWAYS
|
||||
include-message: ALWAYS
|
||||
servlet:
|
||||
context-path: /nursing-unit_001
|
||||
context-path: /nursing-unit_101
|
||||
compression:
|
||||
enabled: true
|
||||
min-response-size: 1024
|
||||
|
|
@ -249,8 +249,6 @@ jeecg:
|
|||
pc: http://localhost:3100
|
||||
app: http://localhost:8051
|
||||
path:
|
||||
#服务指令上传目录
|
||||
directivepath: /cache/nu/opt/upFiles001/directive
|
||||
#文件上传根目录 设置
|
||||
upload: /cache/nu/opt/upFiles001
|
||||
#webapp文件路径
|
||||
|
|
|
|||
|
|
@ -253,10 +253,8 @@ jeecg:
|
|||
pc: http://localhost:3100
|
||||
app: http://localhost:8051
|
||||
path:
|
||||
#服务指令上传目录
|
||||
directivepath: /opt/upFiles001/directive
|
||||
#文件上传根目录 设置
|
||||
upload: /opt/biz101/upFiles
|
||||
upload: /opt/ope/upFiles
|
||||
#webapp文件路径
|
||||
webapp: /opt/biz101/webapp
|
||||
shiro:
|
||||
|
|
|
|||
|
|
@ -253,10 +253,8 @@ jeecg:
|
|||
pc: http://localhost:3100
|
||||
app: http://localhost:8051
|
||||
path:
|
||||
#服务指令上传目录
|
||||
directivepath: /opt/upFiles102/directive
|
||||
#文件上传根目录 设置
|
||||
upload: /opt/biz102/upFiles
|
||||
upload: /opt/ope/upFiles
|
||||
#webapp文件路径
|
||||
webapp: /opt/biz102/webapp
|
||||
shiro:
|
||||
|
|
|
|||
Loading…
Reference in New Issue