diff --git a/nursing-unit-admin/nu-admin-api/nu-admin-local-api/src/main/java/com/nu/modules/sysconfig/ISysConfigApi.java b/nursing-unit-admin/nu-admin-api/nu-admin-local-api/src/main/java/com/nu/modules/sysconfig/ISysConfigApi.java new file mode 100644 index 0000000..07da3c8 --- /dev/null +++ b/nursing-unit-admin/nu-admin-api/nu-admin-local-api/src/main/java/com/nu/modules/sysconfig/ISysConfigApi.java @@ -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); +} diff --git a/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/mediamanage/controller/MediaManageController.java b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/mediamanage/controller/MediaManageController.java index e518f89..f9b42a9 100644 --- a/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/mediamanage/controller/MediaManageController.java +++ b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/mediamanage/controller/MediaManageController.java @@ -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,125 +42,128 @@ 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 + * @Date: 2025-05-15 * @Version: V1.0 */ -@Api(tags="媒体资源管理") +@Api(tags = "媒体资源管理") @RestController @RequestMapping("/mediamanage/mediaManage") @Slf4j public class MediaManageController extends JeecgController { - @Autowired - private IMediaManageService mediaManageService; - - /** - * 分页列表查询 - * - * @param mediaManage - * @param pageNo - * @param pageSize - * @param req - * @return - */ - //@AutoLog(value = "媒体资源管理-分页列表查询") - @ApiOperation(value="媒体资源管理-分页列表查询", notes="媒体资源管理-分页列表查询") - @GetMapping(value = "/list") - public Result> queryPageList(MediaManage mediaManage, - @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, - @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, - HttpServletRequest req) { - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(mediaManage, req.getParameterMap()); - Page page = new Page(pageNo, pageSize); - IPage pageList = mediaManageService.page(page, queryWrapper); - return Result.OK(pageList); - } - - /** - * 添加 - * - * @param mediaManage - * @return - */ - @AutoLog(value = "媒体资源管理-添加") - @ApiOperation(value="媒体资源管理-添加", notes="媒体资源管理-添加") - @RequiresPermissions("mediamanage:nu_media_manage:add") - @PostMapping(value = "/add") - public Result add(@RequestBody MediaManage mediaManage) { - mediaManageService.save(mediaManage); - return Result.OK("添加成功!"); - } - - /** - * 编辑 - * - * @param mediaManage - * @return - */ - @AutoLog(value = "媒体资源管理-编辑") - @ApiOperation(value="媒体资源管理-编辑", notes="媒体资源管理-编辑") - @RequiresPermissions("mediamanage:nu_media_manage:edit") - @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) - public Result edit(@RequestBody MediaManage mediaManage) { - mediaManageService.updateById(mediaManage); - return Result.OK("编辑成功!"); - } - - /** - * 通过id删除 - * - * @param id - * @return - */ - @AutoLog(value = "媒体资源管理-通过id删除") - @ApiOperation(value="媒体资源管理-通过id删除", notes="媒体资源管理-通过id删除") - @RequiresPermissions("mediamanage:nu_media_manage:delete") - @DeleteMapping(value = "/delete") - public Result delete(@RequestParam(name="id",required=true) String id) { - mediaManageService.removeById(id); - return Result.OK("删除成功!"); - } - - /** - * 批量删除 - * - * @param ids - * @return - */ - @AutoLog(value = "媒体资源管理-批量删除") - @ApiOperation(value="媒体资源管理-批量删除", notes="媒体资源管理-批量删除") - @RequiresPermissions("mediamanage:nu_media_manage:deleteBatch") - @DeleteMapping(value = "/deleteBatch") - public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { - this.mediaManageService.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 queryById(@RequestParam(name="id",required=true) String id) { - MediaManage mediaManage = mediaManageService.getById(id); - if(mediaManage==null) { - return Result.error("未找到对应数据"); - } - return Result.OK(mediaManage); - } + + @Autowired + private IMediaManageService mediaManageService; + @Autowired + private ISysConfigApi sysConfigApi; /** - * 导出excel - * - * @param request - * @param mediaManage - */ + * 分页列表查询 + * + * @param mediaManage + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "媒体资源管理-分页列表查询") + @ApiOperation(value = "媒体资源管理-分页列表查询", notes = "媒体资源管理-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(MediaManage mediaManage, + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(mediaManage, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = mediaManageService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param mediaManage + * @return + */ + @AutoLog(value = "媒体资源管理-添加") + @ApiOperation(value = "媒体资源管理-添加", notes = "媒体资源管理-添加") + @RequiresPermissions("mediamanage:nu_media_manage:add") + @PostMapping(value = "/add") + public Result add(@RequestBody MediaManage mediaManage) { + mediaManageService.save(mediaManage); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param mediaManage + * @return + */ + @AutoLog(value = "媒体资源管理-编辑") + @ApiOperation(value = "媒体资源管理-编辑", notes = "媒体资源管理-编辑") + @RequiresPermissions("mediamanage:nu_media_manage:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) + public Result edit(@RequestBody MediaManage mediaManage) { + mediaManageService.updateById(mediaManage); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "媒体资源管理-通过id删除") + @ApiOperation(value = "媒体资源管理-通过id删除", notes = "媒体资源管理-通过id删除") + @RequiresPermissions("mediamanage:nu_media_manage:delete") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name = "id", required = true) String id) { + mediaManageService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "媒体资源管理-批量删除") + @ApiOperation(value = "媒体资源管理-批量删除", notes = "媒体资源管理-批量删除") + @RequiresPermissions("mediamanage:nu_media_manage:deleteBatch") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) { + this.mediaManageService.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 queryById(@RequestParam(name = "id", required = true) String id) { + MediaManage mediaManage = mediaManageService.getById(id); + if (mediaManage == null) { + return Result.error("未找到对应数据"); + } + return Result.OK(mediaManage); + } + + /** + * 导出excel + * + * @param request + * @param mediaManage + */ @RequiresPermissions("mediamanage:nu_media_manage:exportXls") @RequestMapping(value = "/exportXls") public ModelAndView exportXls(HttpServletRequest request, MediaManage mediaManage) { @@ -165,16 +171,25 @@ public class MediaManageController extends JeecgController importExcel(HttpServletRequest request, HttpServletResponse response) { 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")); + } } diff --git a/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/sysconfig/service/impl/SysConfigServiceImpl.java b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/sysconfig/service/impl/SysConfigServiceImpl.java index 0bc4448..4c3bec6 100644 --- a/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/sysconfig/service/impl/SysConfigServiceImpl.java +++ b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/sysconfig/service/impl/SysConfigServiceImpl.java @@ -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; @@ -22,11 +23,11 @@ import java.util.List; /** * @Description: 系统参数配置 * @Author: 张明远 - * @Date: 2025-05-09 + * @Date: 2025-05-09 * @Version: V1.0 */ @Service -public class SysConfigServiceImpl extends ServiceImpl implements ISysConfigService { +public class SysConfigServiceImpl extends ServiceImpl implements ISysConfigService, ISysConfigApi { @Autowired private IAsyncMainService asyncMainService; @@ -80,4 +81,16 @@ public class SysConfigServiceImpl extends ServiceImpl qw = new QueryWrapper<>(); + qw.eq("config_key", key); + SysConfig sysConfig = baseMapper.selectOne(qw); + if (sysConfig != null) { + return sysConfig.getConfigValue(); + } else { + return null; + } + } } diff --git a/nursing-unit-api/src/main/java/com/nu/modules/common/NuCommonApi.java b/nursing-unit-api/src/main/java/com/nu/modules/common/NuCommonApi.java index 9b93d1f..eccdbe2 100644 --- a/nursing-unit-api/src/main/java/com/nu/modules/common/NuCommonApi.java +++ b/nursing-unit-api/src/main/java/com/nu/modules/common/NuCommonApi.java @@ -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 getOrgInfo(@RequestParam("orgCode") String orgCode){ + return Result.ok(sysBaseAPI.getOrgInfo(orgCode)); + } + + + /** + * 根据父id查询对应省、市、区/县 列表 + * @param id 父id + * @return 列表 + */ @GetMapping("/queryAreaDict") public Result queryAreaDict(@RequestParam("id") String id) { return Result.ok(sysBaseAPI.queryCategoryByPid(id)); } + /** + * 根据id查询对应省市区县信息 + * @param id + * @return 对应的一条数据 + */ @GetMapping("/queryAreaNameById") public Result queryAreaNameById(@RequestParam("id") String id) { return Result.ok(sysBaseAPI.queryAreaNameById(id)); diff --git a/nursing-unit-api/src/main/java/com/nu/modules/systeminfo/api/SystemInfoApi.java b/nursing-unit-api/src/main/java/com/nu/modules/systeminfo/api/SystemInfoApi.java index 076012e..20e9a94 100644 --- a/nursing-unit-api/src/main/java/com/nu/modules/systeminfo/api/SystemInfoApi.java +++ b/nursing-unit-api/src/main/java/com/nu/modules/systeminfo/api/SystemInfoApi.java @@ -19,13 +19,13 @@ public class SystemInfoApi { private ISysBaseAPI sysBaseAPI; /** - * 根据护理单元编码查询机构信息 - * @param nuCode + * 根据nuId查询机构信息 + * @param nuId * @return 查询不到时返回结果为null */ - @GetMapping("/getOrgInfoByNUCode") - public Result getOrgInfoByNUCode(@RequestParam("nuCode") String nuCode){ - return Result.ok(sysBaseAPI.getOrgInfoByNUCode(nuCode)); + @GetMapping("/getOrgInfoByNuId") + public Result getOrgInfoByNuId(@RequestParam("nuId") String nuId){ + return Result.ok(sysBaseAPI.getOrgInfoByNuId(nuId)); } } diff --git a/nursing-unit-base-core/src/main/java/org/jeecg/common/util/YouBianCodeUtil.java b/nursing-unit-base-core/src/main/java/org/jeecg/common/util/YouBianCodeUtil.java index 9f5af93..820329d 100644 --- a/nursing-unit-base-core/src/main/java/org/jeecg/common/util/YouBianCodeUtil.java +++ b/nursing-unit-base-core/src/main/java/org/jeecg/common/util/YouBianCodeUtil.java @@ -23,7 +23,7 @@ public class YouBianCodeUtil { /** * 根据前一个code,获取同级下一个code * 例如:当前最大code为D01A04,下一个code为:D01A05 - * + * * @param code * @return */ @@ -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); @@ -70,11 +73,11 @@ public class YouBianCodeUtil { /** * 根据父亲code,获取下级的下一个code - * + * * 例如:父亲CODE:A01 * 当前CODE:A01B03 * 获取的code:A01B04 - * + * * @param parentCode 上级code * @param localCode 同级code * @return @@ -83,19 +86,20 @@ 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; } - + /** * 将数字前面位数补零 - * + * * @param num * @return */ @@ -105,7 +109,7 @@ public class YouBianCodeUtil { /** * 将数字前面位数补零 - * + * * @param num * @return */ @@ -116,7 +120,7 @@ public class YouBianCodeUtil { /** * 递增获取下个数字 - * + * * @param num * @return */ @@ -127,7 +131,7 @@ public class YouBianCodeUtil { /** * 递增获取下个字母 - * + * * @param num * @return */ @@ -138,7 +142,7 @@ public class YouBianCodeUtil { zimu++; return zimu; } - + /** * 根据数字位数获取最大值 * @param length @@ -166,7 +170,7 @@ public class YouBianCodeUtil { } return cutcode; } - + } // public static void main(String[] args) { // // org.jeecgframework.core.util.LogUtil.info(getNextZiMu('C')); diff --git a/nursing-unit-services/nu-services-biz/pom.xml b/nursing-unit-services/nu-services-biz/pom.xml index 4ffb4ba..5e088e4 100644 --- a/nursing-unit-services/nu-services-biz/pom.xml +++ b/nursing-unit-services/nu-services-biz/pom.xml @@ -49,6 +49,12 @@ 2.0.0 compile + + com.nursingunit.boot + nu-admin-local-api + 2.0.0 + compile + diff --git a/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/servicedirective/controller/ConfigServiceDirectiveController.java b/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/servicedirective/controller/ConfigServiceDirectiveController.java index a206603..3fd360b 100644 --- a/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/servicedirective/controller/ConfigServiceDirectiveController.java +++ b/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/servicedirective/controller/ConfigServiceDirectiveController.java @@ -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 page = new Page(pageNo, pageSize); diff --git a/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/servicedirective/entity/ConfigServiceDirective.java b/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/servicedirective/entity/ConfigServiceDirective.java index afed00c..6a61ca9 100644 --- a/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/servicedirective/entity/ConfigServiceDirective.java +++ b/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/servicedirective/entity/ConfigServiceDirective.java @@ -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; diff --git a/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/servicedirective/service/impl/ConfigServiceDirectiveServiceImpl.java b/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/servicedirective/service/impl/ConfigServiceDirectiveServiceImpl.java index 4f9c62b..9b80173 100644 --- a/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/servicedirective/service/impl/ConfigServiceDirectiveServiceImpl.java +++ b/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/servicedirective/service/impl/ConfigServiceDirectiveServiceImpl.java @@ -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 implements IConfigServiceDirectiveService { + @Autowired + private IMediaManageApi mediaManageApi; + @Override - public List pageList(ConfigServiceDirective configServiceDirective,IPage list_) { + public List pageList(ConfigServiceDirective configServiceDirective, IPage list_) { if (list_.getRecords() == null || list_.getRecords().isEmpty()) { return list_.getRecords(); } @@ -37,6 +47,23 @@ public class ConfigServiceDirectiveServiceImpl extends ServiceImpl 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 mediaObjs = mediaManageApi.queryByIds(meidsIds); + + Map 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; diff --git a/nursing-unit-system/nu-system-api/nu-system-local-api/src/main/java/org/jeecg/common/system/api/ISysBaseAPI.java b/nursing-unit-system/nu-system-api/nu-system-local-api/src/main/java/org/jeecg/common/system/api/ISysBaseAPI.java index a37c7d2..1005fd2 100644 --- a/nursing-unit-system/nu-system-api/nu-system-local-api/src/main/java/org/jeecg/common/system/api/ISysBaseAPI.java +++ b/nursing-unit-system/nu-system-api/nu-system-local-api/src/main/java/org/jeecg/common/system/api/ISysBaseAPI.java @@ -13,40 +13,46 @@ import java.util.Map; import java.util.Set; /** - * @Description 底层共通业务API,提供其他独立模块调用 - * @Author scott + * @Description 底层共通业务API,提供其他独立模块调用 + * @Author scott * @Date 2019-4-20 * @Version V1.0 */ 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 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 getDepartNamesByUsername(String username); - - /** 11查询所有的父级字典,按照create_time排序 + /** + * 11查询所有的父级字典,按照create_time排序 + * * @return List 字典集合 */ public List queryAllDict(); /** * 12查询所有分类字典 + * * @return */ public List queryAllSysCategory(); /** * 查询子集合 + * * @return */ public List queryCategoryByPid(String pid); @@ -145,12 +166,14 @@ public interface ISysBaseAPI extends CommonAPI { /** * 14查询所有部门 作为字典信息 id -->value,departName -->text + * * @return */ public List 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,14 +204,16 @@ public interface ISysBaseAPI extends CommonAPI { /** * 18查询所有用户 返回ComboModel + * * @return */ public List queryAllUserBackCombo(); /** * 19分页查询用户 返回JSONObject - * @param userIds 多个用户id - * @param pageNo 当前页数 + * + * @param userIds 多个用户id + * @param pageNo 当前页数 * @param pageSize 每页显示条数 * @return */ @@ -194,19 +221,22 @@ public interface ISysBaseAPI extends CommonAPI { /** * 20获取所有角色 + * * @return */ public List queryAllRole(); /** * 21获取所有角色 带参 + * * @param roleIds 默认选中角色 * @return */ - public List queryAllRole(String[] roleIds ); + public List 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 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 queryUserBySuperQuery(String superQuery,String matchType); + List queryUserBySuperQuery(String superQuery, String matchType); /** * 根据ID查询用户 + * * @param id * @return */ @@ -288,38 +328,43 @@ public interface ISysBaseAPI extends CommonAPI { /** * 根据高级查询条件查询部门 + * * @param superQuery * @param matchType * @return */ - List queryDeptBySuperQuery(String superQuery,String matchType); + List queryDeptBySuperQuery(String superQuery, String matchType); /** * 根据高级查询条件查询角色 + * * @param superQuery * @param matchType * @return */ - List queryRoleBySuperQuery(String superQuery,String matchType); + List queryRoleBySuperQuery(String superQuery, String matchType); /** * 根据租户ID查询用户ID + * * @param tenantId 租户ID * @return List */ List selectUserIdByTenantId(String tenantId); - /** * 31获取用户的角色集合 + * * @param username * @return */ Set 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 */ @@ -407,6 +463,7 @@ public interface ISysBaseAPI extends CommonAPI { /** * 查询分类字典翻译 + * * @param ids 多个分类字典id * @return List */ @@ -431,10 +488,10 @@ public interface ISysBaseAPI extends CommonAPI { /** * 复制应用下的所有字典配置到新的租户下 * - * @param originalAppId 原始低代码应用ID - * @param appId 新的低代码应用ID - * @param tenantId 新的租户ID - * @return Map Map<原字典编码, 新字典编码> + * @param originalAppId 原始低代码应用ID + * @param appId 新的低代码应用ID + * @param tenantId 新的租户ID + * @return Map Map<原字典编码, 新字典编码> */ Map copyLowAppDict(String originalAppId, String appId, String tenantId); @@ -448,7 +505,8 @@ public interface ISysBaseAPI extends CommonAPI { List getDictItems(String dictCode); /** - * 根据多个字典code查询多个字典项 + * 根据多个字典code查询多个字典项 + * * @param dictCodeList * @return key = dictCode ; value=对应的字典项 */ @@ -459,7 +517,7 @@ public interface ISysBaseAPI extends CommonAPI { * 大数据量的字典表 走异步加载 即前端输入内容过滤数据 * * @param dictCode 字典code格式:table,text,code - * @param keyword 过滤关键字 + * @param keyword 过滤关键字 * @param pageSize 分页条数 * @return */ @@ -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 queryOpeDept(); - JSONObject getOrgInfoByNUCode(String nuCode); + JSONObject getOrgInfoByNuId(String nuId); + + JSONObject getOrgInfo(String orgCode); } diff --git a/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/entity/SysDepart.java b/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/entity/SysDepart.java index 790a6f4..6f5c792 100644 --- a/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/entity/SysDepart.java +++ b/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/entity/SysDepart.java @@ -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); } } diff --git a/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/SysDepartMapper.xml b/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/SysDepartMapper.xml index ec2b80d..85f19cc 100644 --- a/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/SysDepartMapper.xml +++ b/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/SysDepartMapper.xml @@ -2,54 +2,53 @@ - + + select id + from sys_depart + where del_flag = '0' + and org_code like concat((select org_code from sys_depart where id = #{departId}), '%') + - - + + - 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} + @@ -162,7 +165,7 @@ SELECT - id, - depart_name, - parent_id, - depart_name_en, - depart_order, - description, - org_category, - org_code, - operation_start_time, - operation_end_time, - contract_start_time, - contract_end_time, - mobile, - fax, - address, - memo + id, + depart_name, + parent_id, + depart_name_en, + depart_order, + description, + org_category, + org_code, + operation_start_time, + operation_end_time, + contract_start_time, + contract_end_time, + mobile, + fax, + address, + memo FROM sys_depart WHERE 1=1 diff --git a/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/model/SysDepartTreeModel.java b/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/model/SysDepartTreeModel.java index 8736747..b234e58 100644 --- a/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/model/SysDepartTreeModel.java +++ b/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/model/SysDepartTreeModel.java @@ -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); } } diff --git a/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/rule/OrgCodeRule.java b/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/rule/OrgCodeRule.java index 2ce3863..8a3c225 100644 --- a/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/rule/OrgCodeRule.java +++ b/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/rule/OrgCodeRule.java @@ -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部门信息 diff --git a/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysBaseApiImpl.java b/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysBaseApiImpl.java index d8a7134..b059881 100644 --- a/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysBaseApiImpl.java +++ b/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysBaseApiImpl.java @@ -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 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; }