Compare commits

...

2 Commits

Author SHA1 Message Date
1378012178@qq.com 4efbfd461f Merge branch 'master' of http://47.115.223.229:8888/yangjun/hldy_java_monomer 2025-06-19 15:03:28 +08:00
1378012178@qq.com 16004f9c93 1、调整媒体资源管理功能相关接口
2、增加系统配置查询接口
3、调整框架机构、部门编码生成方式
4、调整服务指令同步功能bug
2025-06-19 15:03:22 +08:00
16 changed files with 463 additions and 230 deletions

View File

@ -0,0 +1,13 @@
package com.nu.modules.sysconfig;
import cn.hutool.json.JSONObject;
public interface ISysConfigApi {
/**
* 查询键值
* @param key
* @return
*/
public Object querySysConfigByKey(String key);
}

View File

@ -10,6 +10,9 @@ import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.alibaba.fastjson.JSONObject;
import com.nu.modules.sysconfig.ISysConfigApi;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.query.QueryRuleEnum;
@ -39,19 +42,22 @@ import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
/**
* @Description: 媒体资源管理
* @Author: 张明远
* @Date: 2025-05-15
* @Version: V1.0
*/
@Api(tags="媒体资源管理")
@Api(tags = "媒体资源管理")
@RestController
@RequestMapping("/mediamanage/mediaManage")
@Slf4j
public class MediaManageController extends JeecgController<MediaManage, IMediaManageService> {
@Autowired
private IMediaManageService mediaManageService;
@Autowired
private ISysConfigApi sysConfigApi;
/**
* 分页列表查询
@ -63,11 +69,11 @@ public class MediaManageController extends JeecgController<MediaManage, IMediaMa
* @return
*/
//@AutoLog(value = "媒体资源管理-分页列表查询")
@ApiOperation(value="媒体资源管理-分页列表查询", notes="媒体资源管理-分页列表查询")
@ApiOperation(value = "媒体资源管理-分页列表查询", notes = "媒体资源管理-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<MediaManage>> queryPageList(MediaManage mediaManage,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<MediaManage> queryWrapper = QueryGenerator.initQueryWrapper(mediaManage, req.getParameterMap());
Page<MediaManage> page = new Page<MediaManage>(pageNo, pageSize);
@ -82,7 +88,7 @@ public class MediaManageController extends JeecgController<MediaManage, IMediaMa
* @return
*/
@AutoLog(value = "媒体资源管理-添加")
@ApiOperation(value="媒体资源管理-添加", notes="媒体资源管理-添加")
@ApiOperation(value = "媒体资源管理-添加", notes = "媒体资源管理-添加")
@RequiresPermissions("mediamanage:nu_media_manage:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody MediaManage mediaManage) {
@ -97,9 +103,9 @@ public class MediaManageController extends JeecgController<MediaManage, IMediaMa
* @return
*/
@AutoLog(value = "媒体资源管理-编辑")
@ApiOperation(value="媒体资源管理-编辑", notes="媒体资源管理-编辑")
@ApiOperation(value = "媒体资源管理-编辑", notes = "媒体资源管理-编辑")
@RequiresPermissions("mediamanage:nu_media_manage:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody MediaManage mediaManage) {
mediaManageService.updateById(mediaManage);
return Result.OK("编辑成功!");
@ -112,10 +118,10 @@ public class MediaManageController extends JeecgController<MediaManage, IMediaMa
* @return
*/
@AutoLog(value = "媒体资源管理-通过id删除")
@ApiOperation(value="媒体资源管理-通过id删除", notes="媒体资源管理-通过id删除")
@ApiOperation(value = "媒体资源管理-通过id删除", notes = "媒体资源管理-通过id删除")
@RequiresPermissions("mediamanage:nu_media_manage:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
mediaManageService.removeById(id);
return Result.OK("删除成功!");
}
@ -127,10 +133,10 @@ public class MediaManageController extends JeecgController<MediaManage, IMediaMa
* @return
*/
@AutoLog(value = "媒体资源管理-批量删除")
@ApiOperation(value="媒体资源管理-批量删除", notes="媒体资源管理-批量删除")
@ApiOperation(value = "媒体资源管理-批量删除", notes = "媒体资源管理-批量删除")
@RequiresPermissions("mediamanage:nu_media_manage:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.mediaManageService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
@ -142,11 +148,11 @@ public class MediaManageController extends JeecgController<MediaManage, IMediaMa
* @return
*/
//@AutoLog(value = "媒体资源管理-通过id查询")
@ApiOperation(value="媒体资源管理-通过id查询", notes="媒体资源管理-通过id查询")
@ApiOperation(value = "媒体资源管理-通过id查询", notes = "媒体资源管理-通过id查询")
@GetMapping(value = "/queryById")
public Result<MediaManage> queryById(@RequestParam(name="id",required=true) String id) {
public Result<MediaManage> queryById(@RequestParam(name = "id", required = true) String id) {
MediaManage mediaManage = mediaManageService.getById(id);
if(mediaManage==null) {
if (mediaManage == null) {
return Result.error("未找到对应数据");
}
return Result.OK(mediaManage);
@ -177,4 +183,13 @@ public class MediaManageController extends JeecgController<MediaManage, IMediaMa
return super.importExcel(request, response, MediaManage.class);
}
/**
* 获取协议域名
*
* @return
*/
@RequestMapping(value = "/getUrl", method = RequestMethod.GET)
public Result<?> getUrl() {
return Result.OK(sysConfigApi.querySysConfigByKey("dev_ope_url"));
}
}

View File

@ -7,6 +7,7 @@ import com.google.common.collect.Lists;
import com.nu.dto.SysConfigMQDto;
import com.nu.modules.async.entity.AsyncMain;
import com.nu.modules.async.service.IAsyncMainService;
import com.nu.modules.sysconfig.ISysConfigApi;
import com.nu.modules.sysconfig.entity.SysConfig;
import com.nu.modules.sysconfig.mapper.SysConfigMapper;
import com.nu.modules.sysconfig.service.ISysConfigService;
@ -26,7 +27,7 @@ import java.util.List;
* @Version: V1.0
*/
@Service
public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig> implements ISysConfigService {
public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig> implements ISysConfigService, ISysConfigApi {
@Autowired
private IAsyncMainService asyncMainService;
@ -80,4 +81,16 @@ public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig
rabbitMQUtil.sendToExchange("hldy.sysconfig.fanout", "", sysConfigMQDto);
}
}
@Override
public Object querySysConfigByKey(String key) {
QueryWrapper<SysConfig> qw = new QueryWrapper<>();
qw.eq("config_key", key);
SysConfig sysConfig = baseMapper.selectOne(qw);
if (sysConfig != null) {
return sysConfig.getConfigValue();
} else {
return null;
}
}
}

View File

@ -1,5 +1,6 @@
package com.nu.modules.common;
import com.alibaba.fastjson.JSONObject;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.api.ISysBaseAPI;
import org.springframework.beans.factory.annotation.Autowired;
@ -21,11 +22,32 @@ public class NuCommonApi {
@Autowired
private ISysBaseAPI sysBaseAPI;
/**
* 获取机构信息
* @param orgCode 机构编码
* @return
*/
@GetMapping("/getOrgInfo")
public Result<JSONObject> getOrgInfo(@RequestParam("orgCode") String orgCode){
return Result.ok(sysBaseAPI.getOrgInfo(orgCode));
}
/**
* 根据父id查询对应省/ 列表
* @param id 父id
* @return 列表
*/
@GetMapping("/queryAreaDict")
public Result<Object> queryAreaDict(@RequestParam("id") String id) {
return Result.ok(sysBaseAPI.queryCategoryByPid(id));
}
/**
* 根据id查询对应省市区县信息
* @param id
* @return 对应的一条数据
*/
@GetMapping("/queryAreaNameById")
public Result<Object> queryAreaNameById(@RequestParam("id") String id) {
return Result.ok(sysBaseAPI.queryAreaNameById(id));

View File

@ -19,13 +19,13 @@ public class SystemInfoApi {
private ISysBaseAPI sysBaseAPI;
/**
* 根据护理单元编码查询机构信息
* @param nuCode
* 根据nuId查询机构信息
* @param nuId
* @return 查询不到时返回结果为null
*/
@GetMapping("/getOrgInfoByNUCode")
public Result<JSONObject> getOrgInfoByNUCode(@RequestParam("nuCode") String nuCode){
return Result.ok(sysBaseAPI.getOrgInfoByNUCode(nuCode));
@GetMapping("/getOrgInfoByNuId")
public Result<JSONObject> getOrgInfoByNuId(@RequestParam("nuId") String nuId){
return Result.ok(sysBaseAPI.getOrgInfoByNuId(nuId));
}
}

View File

@ -34,6 +34,9 @@ public class YouBianCodeUtil {
String num = getStrNum(1);
newcode = zimu + num;
} else {
if(!code.startsWith("A")){
code = "A"+code;
}
String beforeCode = code.substring(0, code.length() - 1- NUM_LENGTH);
String afterCode = code.substring(code.length() - 1 - NUM_LENGTH,code.length());
char afterCodeZimu = afterCode.substring(0, 1).charAt(0);
@ -83,10 +86,11 @@ public class YouBianCodeUtil {
if(localCode!=null && localCode!=""){
// return parentCode + getNextYouBianCode(localCode);
return getNextYouBianCode(localCode);
return getNextYouBianCode(localCode).replace("A","");
}else{
parentCode = parentCode + "A"+ getNextStrNum(0);
// parentCode = parentCode + "A"+ getNextStrNum(0);
parentCode = parentCode + getNextStrNum(0);
}
return parentCode;
}

View File

@ -49,6 +49,12 @@
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.nursingunit.boot</groupId>
<artifactId>nu-admin-local-api</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>

View File

@ -24,6 +24,7 @@ import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.query.QueryRuleEnum;
import org.jeecg.common.system.vo.DictModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
@ -103,12 +104,20 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
queryWrapper.eq("id", "null");
}
}
if(StringUtils.isNotBlank(configServiceDirective.getViewType())){
if("selected".equals(configServiceDirective.getViewType())){
queryWrapper.in("id",configServiceDirective.getSelectedRowIds());
if (StringUtils.isNotBlank(configServiceDirective.getViewType())) {
if ("selected".equals(configServiceDirective.getViewType())) {
if (CollectionUtils.isEmpty(configServiceDirective.getSelectedRowIds())) {
queryWrapper.eq("id", "jh11J8");
} else {
queryWrapper.in("id", configServiceDirective.getSelectedRowIds());
}
}
if ("unselected".equals(configServiceDirective.getViewType())) {
if (CollectionUtils.isEmpty(configServiceDirective.getSelectedRowIds())) {
queryWrapper.eq("id", "jh11J8");
} else {
queryWrapper.notIn("id", configServiceDirective.getSelectedRowIds());
}
if("unselected".equals(configServiceDirective.getViewType())){
queryWrapper.notIn("id",configServiceDirective.getSelectedRowIds());
}
}
Page<ConfigServiceDirective> page = new Page<ConfigServiceDirective>(pageNo, pageSize);

View File

@ -126,16 +126,28 @@ public class ConfigServiceDirective implements Serializable {
@Excel(name = "语音文件", width = 15)
@ApiModelProperty(value = "语音文件")
private java.lang.String mp3File;
//语音文件路径
@TableField(exist = false)
private java.lang.String mp3FileMedia;
/**视频文件*/
@Excel(name = "视频文件", width = 15)
@ApiModelProperty(value = "视频文件")
private java.lang.String mp4File;
//视频文件路径
@TableField(exist = false)
private java.lang.String mp4FileMedia;
/**预览图片*/
@ApiModelProperty(value = "预览图片")
private java.lang.String previewFile;
//预览图片路径
@TableField(exist = false)
private java.lang.String previewFileMedia;
/**即时指令图片*/
@ApiModelProperty(value = "即时指令图片")
private java.lang.String immediateFile;
//即时指令图片路径
@TableField(exist = false)
private java.lang.String immediateFileMedia;
@TableField(exist = false)
private Integer categoryRowSpan;

View File

@ -1,16 +1,23 @@
package com.nu.modules.servicedirective.service.impl;
import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.nu.modules.directivetag.body.entity.DirectiveBodyTag;
import com.nu.modules.directivetag.emotion.entity.DirectiveEmotionTag;
import com.nu.modules.mediamanage.IMediaManageApi;
import com.nu.modules.servicedirective.entity.ConfigServiceDirective;
import com.nu.modules.servicedirective.mapper.ConfigServiceDirectiveMapper;
import com.nu.modules.servicedirective.service.IConfigServiceDirectiveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* @Description: 服务指令
@ -21,8 +28,11 @@ import java.util.stream.Collectors;
@Service
public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigServiceDirectiveMapper, ConfigServiceDirective> implements IConfigServiceDirectiveService {
@Autowired
private IMediaManageApi mediaManageApi;
@Override
public List<ConfigServiceDirective> pageList(ConfigServiceDirective configServiceDirective,IPage<ConfigServiceDirective> list_) {
public List<ConfigServiceDirective> pageList(ConfigServiceDirective configServiceDirective, IPage<ConfigServiceDirective> list_) {
if (list_.getRecords() == null || list_.getRecords().isEmpty()) {
return list_.getRecords();
}
@ -37,6 +47,23 @@ public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigService
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;

View File

@ -21,32 +21,38 @@ import java.util.Set;
public interface ISysBaseAPI extends CommonAPI {
//=======OLD 系统消息推送接口============================
/**
* 1发送系统消息
*
* @param message 使用构造器赋值参数 如果不设置category(消息类型)则默认为2 发送系统消息
*/
void sendSysAnnouncement(MessageDTO message);
/**
* 2发送消息 附带业务参数
*
* @param message 使用构造器赋值参数
*/
void sendBusAnnouncement(BusMessageDTO message);
/**
* 3通过模板发送消息
*
* @param message 使用构造器赋值参数
*/
void sendTemplateAnnouncement(TemplateMessageDTO message);
/**
* 4通过模板发送消息 附带业务参数
*
* @param message 使用构造器赋值参数
*/
void sendBusTemplateAnnouncement(BusTemplateMessageDTO message);
/**
* 5通过消息中心模板生成推送内容
*
* @param templateDTO 使用构造器赋值参数
* @return
*/
@ -54,14 +60,17 @@ public interface ISysBaseAPI extends CommonAPI {
//=======OLD 系统消息推送接口============================
//=======TY NEW 自定义消息推送接口邮件钉钉企业微信系统消息============================
/**
* NEW发送模板消息支持自定义推送类型: 邮件钉钉企业微信系统消息
*
* @param message
*/
void sendTemplateMessage(MessageDTO message);
/**
* NEW根据模板编码获取模板内容支持自定义推送类型
*
* @param templateCode
* @return
*/
@ -70,6 +79,7 @@ public interface ISysBaseAPI extends CommonAPI {
/**
* 6根据用户id查询用户信息
*
* @param id
* @return
*/
@ -77,6 +87,7 @@ public interface ISysBaseAPI extends CommonAPI {
/**
* 7通过用户账号查询角色集合
*
* @param username
* @return
*/
@ -84,6 +95,7 @@ public interface ISysBaseAPI extends CommonAPI {
/**
* 7通过用户账号查询角色集合
*
* @param userId
* @return
*/
@ -91,12 +103,15 @@ public interface ISysBaseAPI extends CommonAPI {
/**
* 8通过用户账号查询部门集合
*
* @param username
* @return 部门 id
*/
List<String> getDepartIdsByUsername(String username);
/**
* 8通过用户账号查询部门集合
*
* @param userId
* @return 部门 id
*/
@ -104,6 +119,7 @@ public interface ISysBaseAPI extends CommonAPI {
/**
* 8.2 通过用户账号查询部门父ID集合
*
* @param username
* @return 部门 parentIds
*/
@ -111,6 +127,7 @@ public interface ISysBaseAPI extends CommonAPI {
/**
* 8.2 查询部门父ID集合
*
* @param depIds
* @return 部门 parentIds
*/
@ -118,26 +135,30 @@ public interface ISysBaseAPI extends CommonAPI {
/**
* 9通过用户账号查询部门 name
*
* @param username
* @return 部门 name
*/
List<String> getDepartNamesByUsername(String username);
/** 11查询所有的父级字典按照create_time排序
/**
* 11查询所有的父级字典按照create_time排序
*
* @return List<DictModel> 字典集合
*/
public List<DictModel> queryAllDict();
/**
* 12查询所有分类字典
*
* @return
*/
public List<SysCategoryModel> queryAllSysCategory();
/**
* 查询子集合
*
* @return
*/
public List<SysCategoryModel> queryCategoryByPid(String pid);
@ -145,12 +166,14 @@ public interface ISysBaseAPI extends CommonAPI {
/**
* 14查询所有部门 作为字典信息 id -->value,departName -->text
*
* @return
*/
public List<DictModel> queryAllDepartBackDictModel();
/**
* 15根据业务类型及业务id修改消息已读
*
* @param busType
* @param busId
*/
@ -158,6 +181,7 @@ public interface ISysBaseAPI extends CommonAPI {
/**
* 16查询表字典 支持过滤数据
*
* @param table
* @param text
* @param code
@ -168,6 +192,7 @@ public interface ISysBaseAPI extends CommonAPI {
/**
* 17查询指定table的 text code 获取字典包含text和value
*
* @param table
* @param text
* @param code
@ -179,12 +204,14 @@ public interface ISysBaseAPI extends CommonAPI {
/**
* 18查询所有用户 返回ComboModel
*
* @return
*/
public List<ComboModel> queryAllUserBackCombo();
/**
* 19分页查询用户 返回JSONObject
*
* @param userIds 多个用户id
* @param pageNo 当前页数
* @param pageSize 每页显示条数
@ -194,19 +221,22 @@ public interface ISysBaseAPI extends CommonAPI {
/**
* 20获取所有角色
*
* @return
*/
public List<ComboModel> queryAllRole();
/**
* 21获取所有角色 带参
*
* @param roleIds 默认选中角色
* @return
*/
public List<ComboModel> queryAllRole(String[] roleIds );
public List<ComboModel> queryAllRole(String[] roleIds);
/**
* 22通过用户账号查询角色Id集合
*
* @param username
* @return
*/
@ -214,6 +244,7 @@ public interface ISysBaseAPI extends CommonAPI {
/**
* 23通过部门编号查询部门id
*
* @param orgCode
* @return
*/
@ -221,12 +252,14 @@ public interface ISysBaseAPI extends CommonAPI {
/**
* 24查询所有部门
*
* @return
*/
public List<SysDepartModel> getAllSysDepart();
/**
* 25查找父级部门
*
* @param departId
* @return
*/
@ -234,6 +267,7 @@ public interface ISysBaseAPI extends CommonAPI {
/**
* 26根据部门Id获取部门负责人
*
* @param deptId
* @return
*/
@ -241,6 +275,7 @@ public interface ISysBaseAPI extends CommonAPI {
/**
* 27给指定用户发消息
*
* @param userIds
* @param cmd
*/
@ -248,6 +283,7 @@ public interface ISysBaseAPI extends CommonAPI {
/**
* 28根据id获取所有参与用户
*
* @param userIds 多个用户id
* @return
*/
@ -256,13 +292,15 @@ public interface ISysBaseAPI extends CommonAPI {
/**
* 29将会议签到信息推动到预览
* userIds
* @return
*
* @param userId
* @return
*/
void meetingSignWebsocket(String userId);
/**
* 30根据name获取所有参与用户
*
* @param userNames 多个用户账户
* @return
*/
@ -271,15 +309,17 @@ public interface ISysBaseAPI extends CommonAPI {
/**
* 根据高级查询条件查询用户
*
* @param superQuery
* @param matchType
* @return
*/
List<JSONObject> queryUserBySuperQuery(String superQuery,String matchType);
List<JSONObject> queryUserBySuperQuery(String superQuery, String matchType);
/**
* 根据ID查询用户
*
* @param id
* @return
*/
@ -288,38 +328,43 @@ public interface ISysBaseAPI extends CommonAPI {
/**
* 根据高级查询条件查询部门
*
* @param superQuery
* @param matchType
* @return
*/
List<JSONObject> queryDeptBySuperQuery(String superQuery,String matchType);
List<JSONObject> queryDeptBySuperQuery(String superQuery, String matchType);
/**
* 根据高级查询条件查询角色
*
* @param superQuery
* @param matchType
* @return
*/
List<JSONObject> queryRoleBySuperQuery(String superQuery,String matchType);
List<JSONObject> queryRoleBySuperQuery(String superQuery, String matchType);
/**
* 根据租户ID查询用户ID
*
* @param tenantId 租户ID
* @return List<String>
*/
List<String> selectUserIdByTenantId(String tenantId);
/**
* 31获取用户的角色集合
*
* @param username
* @return
*/
Set<String> getUserRoleSet(String username);
/**
* 31获取用户的角色集合
*
* @param useId
* @return
*/
@ -327,6 +372,7 @@ public interface ISysBaseAPI extends CommonAPI {
/**
* 32获取用户的权限集合
*
* @param userId
* @return
*/
@ -334,6 +380,7 @@ public interface ISysBaseAPI extends CommonAPI {
/**
* 33判断是否有online访问的权限
*
* @param onlineAuthDTO
* @return
*/
@ -341,6 +388,7 @@ public interface ISysBaseAPI extends CommonAPI {
/**
* 34通过部门id获取部门全部信息
*
* @param id 部门id
* @return SysDepartModel对象
*/
@ -348,6 +396,7 @@ public interface ISysBaseAPI extends CommonAPI {
/**
* 35根据用户id查询用户所属公司下所有用户ids
*
* @param userId
* @return
*/
@ -355,6 +404,7 @@ public interface ISysBaseAPI extends CommonAPI {
/**
* 36根据多个用户账号(逗号分隔)查询返回多个用户信息
*
* @param usernames
* @return
*/
@ -362,6 +412,7 @@ public interface ISysBaseAPI extends CommonAPI {
/**
* 37根据多个用户ID(逗号分隔)查询返回多个用户信息
*
* @param ids
* @return
*/
@ -369,6 +420,7 @@ public interface ISysBaseAPI extends CommonAPI {
/**
* 38根据多个部门编码(逗号分隔)查询返回多个部门信息
*
* @param orgCodes
* @return
*/
@ -376,6 +428,7 @@ public interface ISysBaseAPI extends CommonAPI {
/**
* 39根据多个部门id(逗号分隔)查询返回多个部门信息
*
* @param ids
* @return
*/
@ -383,11 +436,12 @@ public interface ISysBaseAPI extends CommonAPI {
/**
* 40发送邮件消息
*
* @param email
* @param title
* @param content
*/
void sendEmailMsg(String email,String title,String content);
void sendEmailMsg(String email, String title, String content);
/**
* 40发送模版邮件消息
@ -398,8 +452,10 @@ public interface ISysBaseAPI extends CommonAPI {
* @param params 模版参数
*/
void sendHtmlTemplateEmail(String email, String title, EmailTemplateEnum emailTemplateEnum, JSONObject params);
/**
* 41 获取公司下级部门和公司下所有用户信息
*
* @param orgCode
* @return List<Map>
*/
@ -407,6 +463,7 @@ public interface ISysBaseAPI extends CommonAPI {
/**
* 查询分类字典翻译
*
* @param ids 多个分类字典id
* @return List<String>
*/
@ -449,6 +506,7 @@ public interface ISysBaseAPI extends CommonAPI {
/**
* 根据多个字典code查询多个字典项
*
* @param dictCodeList
* @return key = dictCode value=对应的字典项
*/
@ -467,23 +525,28 @@ public interface ISysBaseAPI extends CommonAPI {
/**
* 新增数据日志
*
* @param dataLogDto
*/
void saveDataLog(DataLogDTO dataLogDto);
/**
* 更新头像
*
* @param loginUser
*/
void updateAvatar(LoginUser loginUser);
/**
* 向app端 websocket推送聊天刷新消息
*
* @param userId
*/
void sendAppChatSocket(String userId);
/**
* 根据角色id查询角色code
*
* @param id
* @return
*/
@ -499,6 +562,7 @@ public interface ISysBaseAPI extends CommonAPI {
/**
* 根据部门ID查询用户ID
*
* @param deptIds
* @return
*/
@ -506,6 +570,7 @@ public interface ISysBaseAPI extends CommonAPI {
/**
* 根据部门ID查询用户账号
*
* @param deptIds
* @return
*/
@ -513,6 +578,7 @@ public interface ISysBaseAPI extends CommonAPI {
/**
* 根据角色编码 查询用户ID
*
* @param roleCodes
* @return
*/
@ -520,6 +586,7 @@ public interface ISysBaseAPI extends CommonAPI {
/**
* 根据职务ID查询用户ID
*
* @param positionIds
* @return
*/
@ -552,9 +619,10 @@ public interface ISysBaseAPI extends CommonAPI {
/**
* 查询各业务机构 编码名称
*
*/
List<JSONObject> queryOpeDept();
JSONObject getOrgInfoByNUCode(String nuCode);
JSONObject getOrgInfoByNuId(String nuId);
JSONObject getOrgInfo(String orgCode);
}

View File

@ -11,6 +11,7 @@ import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Objects;
@ -74,6 +75,11 @@ public class SysDepart implements Serializable {
*/
@Excel(name = "机构编码", width = 15)
private String orgCode;
/**
* 协议+域名
*/
@Excel(name = "协议+域名", width = 30)
private String url;
/**
* 省份
*/
@ -139,6 +145,11 @@ public class SysDepart implements Serializable {
*/
@Excel(name = "备注", width = 15)
private String memo;
/**
* 应缴金额
*/
@Excel(name = "应缴金额", width = 15)
private BigDecimal payableAmount;
/**
* 状态1启用0不启用
*/
@ -234,9 +245,14 @@ public class SysDepart implements Serializable {
Objects.equals(orgCategory, depart.orgCategory) &&
Objects.equals(orgType, depart.orgType) &&
Objects.equals(orgCode, depart.orgCode) &&
Objects.equals(url, depart.url) &&
Objects.equals(province, depart.province) &&
Objects.equals(city, depart.city) &&
Objects.equals(district, depart.district) &&
Objects.equals(operationStartTime, depart.operationStartTime) &&
Objects.equals(operationEndTime, depart.operationEndTime) &&
Objects.equals(contractStartTime, depart.contractStartTime) &&
Objects.equals(contractEndTime, depart.contractEndTime) &&
Objects.equals(mobile, depart.mobile) &&
Objects.equals(fax, depart.fax) &&
Objects.equals(address, depart.address) &&
@ -247,6 +263,7 @@ public class SysDepart implements Serializable {
Objects.equals(createTime, depart.createTime) &&
Objects.equals(updateBy, depart.updateBy) &&
Objects.equals(tenantId, depart.tenantId) &&
Objects.equals(payableAmount, depart.payableAmount) &&
Objects.equals(updateTime, depart.updateTime);
}
@ -257,7 +274,8 @@ public class SysDepart implements Serializable {
public int hashCode() {
return Objects.hash(super.hashCode(), id, parentId, departName,
departNameEn, departNameAbbr, departOrder, description, orgCategory,
orgType, orgCode, province, city, district, mobile, fax, address, memo, status,
delFlag, createBy, createTime, updateBy, updateTime, tenantId);
orgType, orgCode, url, province, city, district, operationStartTime,
operationEndTime, contractStartTime, contractEndTime, mobile, fax, address, memo, status,
delFlag, createBy, createTime, updateBy, updateTime, tenantId, payableAmount);
}
}

View File

@ -3,38 +3,37 @@
<mapper namespace="org.jeecg.modules.system.mapper.SysDepartMapper">
<select id="queryUserDeparts" parameterType="String" resultType="org.jeecg.modules.system.entity.SysDepart">
select * from sys_depart where id IN ( select dep_id from sys_user_depart where user_id = #{userId} )
select *
from sys_depart
where id IN (select dep_id from sys_user_depart where user_id = #{userId})
</select>
<!-- 根据username查询所拥有的部门 -->
<select id="queryDepartsByUsername" parameterType="String" resultType="org.jeecg.modules.system.entity.SysDepart">
SELECT *
FROM sys_depart
WHERE id IN (
SELECT dep_id
WHERE id IN (SELECT dep_id
FROM sys_user_depart
WHERE user_id = (
SELECT id
WHERE user_id = (SELECT id
FROM sys_user
WHERE username = #{username}
)
)
WHERE username = #{username}))
</select>
<!-- 根据username查询所拥有的部门 -->
<select id="queryDepartsByUserId" parameterType="String" resultType="java.lang.String">
SELECT id
FROM sys_depart
WHERE id IN (
SELECT dep_id
WHERE id IN (SELECT dep_id
FROM sys_user_depart
WHERE user_id = #{userId}
)
WHERE user_id = #{userId})
</select>
<!-- 根据部门Id查询,当前和下级所有部门IDS -->
<select id="getSubDepIdsByDepId" resultType="java.lang.String">
select id from sys_depart where del_flag = '0' and org_code like concat((select org_code from sys_depart where id=#{departId}),'%')
select id
from sys_depart
where del_flag = '0'
and org_code like concat((select org_code from sys_depart where id = #{departId}), '%')
</select>
<!--根据部门编码获取我的部门下所有部门ids -->
@ -60,7 +59,11 @@
<!-- 根据OrgCod查询公司信息 -->
<select id="queryCompByOrgCode" resultType="org.jeecg.modules.system.entity.SysDepart">
select * from sys_depart where del_flag = '0' and org_category='1' and org_code= #{orgCode,jdbcType=VARCHAR}
select *
from sys_depart
where del_flag = '0'
and org_category = '1'
and org_code = #{orgCode,jdbcType=VARCHAR}
</select>
<!--通过父级id和租户id查询部门-->
@ -100,7 +103,7 @@
parent_id IS NULL OR parent_id=''
</otherwise>
</choose>
ORDER BY org_code DESC
ORDER BY org_code + 0 DESC
</select>
<!--获取父级部门的数据-->

View File

@ -2,9 +2,11 @@ package org.jeecg.modules.system.model;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.jeecg.modules.system.entity.SysDepart;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -63,6 +65,8 @@ public class SysDepartTreeModel implements Serializable {
private String orgCode;
private String url;
private String province;
private String city;
@ -101,6 +105,8 @@ public class SysDepartTreeModel implements Serializable {
private String picUrl;
private BigDecimal payableAmount;
//update-begin---author:wangshuai ---date:20200308 for[JTC-119]在部门管理菜单下设置部门负责人新增字段部门负责人ids
/**
* 部门负责人ids
@ -131,6 +137,7 @@ public class SysDepartTreeModel implements Serializable {
this.orgCategory = sysDepart.getOrgCategory();
this.orgType = sysDepart.getOrgType();
this.orgCode = sysDepart.getOrgCode();
this.url = sysDepart.getUrl();
this.province = sysDepart.getProvince();
this.city = sysDepart.getCity();
this.district = sysDepart.getDistrict();
@ -151,6 +158,7 @@ public class SysDepartTreeModel implements Serializable {
this.updateTime = sysDepart.getUpdateTime();
this.directorUserIds = sysDepart.getDirectorUserIds();
this.picUrl = sysDepart.getPicUrl();
this.payableAmount = sysDepart.getPayableAmount();
if (0 == sysDepart.getIzLeaf()) {
this.isLeaf = false;
} else {
@ -462,6 +470,22 @@ public class SysDepartTreeModel implements Serializable {
this.district = district;
}
public BigDecimal getPayableAmount() {
return payableAmount;
}
public void setPayableAmount(BigDecimal payableAmount) {
this.payableAmount = payableAmount;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
/**
* 重写equals方法
*/
@ -485,6 +509,7 @@ public class SysDepartTreeModel implements Serializable {
Objects.equals(orgCategory, model.orgCategory) &&
Objects.equals(orgType, model.orgType) &&
Objects.equals(orgCode, model.orgCode) &&
Objects.equals(url, model.url) &&
Objects.equals(province, model.province) &&
Objects.equals(city, model.city) &&
Objects.equals(district, model.district) &&
@ -504,6 +529,7 @@ public class SysDepartTreeModel implements Serializable {
Objects.equals(updateBy, model.updateBy) &&
Objects.equals(updateTime, model.updateTime) &&
Objects.equals(directorUserIds, model.directorUserIds) &&
Objects.equals(payableAmount, model.payableAmount) &&
Objects.equals(children, model.children);
}
@ -514,10 +540,10 @@ public class SysDepartTreeModel implements Serializable {
public int hashCode() {
return Objects.hash(id, parentId, platType, departName, departNameEn, departNameAbbr,
departOrder, description, orgCategory, orgType, orgCode, province, city, district,
departOrder, description, orgCategory, orgType, orgCode, url, province, city, district,
operationStartTime, operationEndTime, contractStartTime, contractEndTime,
mobile, fax, address, memo, status, delFlag, qywxIdentifier,
createBy, createTime, updateBy, updateTime, children, directorUserIds);
createBy, createTime, updateBy, updateTime, children, directorUserIds, payableAmount);
}
}

View File

@ -70,6 +70,7 @@ public class OrgCodeRule implements IFillRuleHandler {
oldOrgCode = depart.getOrgCode();
orgType = depart.getOrgType();
newOrgCode = YouBianCodeUtil.getNextYouBianCode(oldOrgCode);
newOrgCode = newOrgCode.substring(1);
}
} else {//反之则查询出所有同级的部门,获取结果后有两种情况,有同级和没有同级
//获取自己部门最大值orgCode部门信息

View File

@ -59,6 +59,7 @@ import org.jeecg.config.mybatis.MybatisPlusSaasConfig;
import org.jeecg.modules.system.entity.*;
import org.jeecg.modules.system.mapper.*;
import org.jeecg.modules.system.service.*;
import org.jetbrains.annotations.Nullable;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
@ -1889,33 +1890,28 @@ public class SysBaseApiImpl implements ISysBaseAPI {
}
@Override
public JSONObject getOrgInfoByNUCode(String nuCode) {
if(StringUtils.isBlank(nuCode)){
public JSONObject getOrgInfoByNuId(String nuId) {
if(StringUtils.isBlank(nuId)){
return null;
}
String orgCode = nuCode.split("-")[0];
String orgCode = nuId.substring(4, nuId.length()-3);
return queryOrgInfo(orgCode);
}
@Override
public JSONObject getOrgInfo(String orgCode) {
return queryOrgInfo(orgCode);
}
@Nullable
private JSONObject queryOrgInfo(String orgCode) {
QueryWrapper<SysDepart> qw = new QueryWrapper<>();
qw.eq("org_code", orgCode);//机构编码
qw.eq("org_category", "1");//机构类型
qw.eq("del_flag", "0");//未删除数据
SysDepart sysDepart = sysDepartService.getOne(qw);
if (sysDepart != null) {
JSONObject result = new JSONObject();
result.put("departName", sysDepart.getDepartName()); // 机构名称
result.put("orgCode", sysDepart.getOrgCode()); // 机构编码
result.put("province", sysDepart.getProvince()); // 省份
result.put("city", sysDepart.getCity()); // 城市
result.put("district", sysDepart.getDistrict()); // 区县
result.put("operationStartTime", sysDepart.getOperationStartTime()); // 运营开始时间
result.put("operationEndTime", sysDepart.getOperationEndTime()); // 运营到期时间
result.put("contractStartTime", sysDepart.getContractStartTime()); // 合同开始时间
result.put("contractEndTime", sysDepart.getContractEndTime()); // 合同到期时间
result.put("mobile", sysDepart.getMobile()); // 手机号
result.put("fax", sysDepart.getFax()); // 传真
result.put("address", sysDepart.getAddress()); // 地址
result.put("memo", sysDepart.getMemo()); // 备注
result.put("serverUrl", sysDepart.getServerUrl()); // 机构服务器后台接口地址
return result;
return (JSONObject) JSONObject.toJSON(sysDepart);
} else {
return null;
}