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 java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; 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.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.query.QueryRuleEnum; 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.jeecg.common.aspect.annotation.AutoLog;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
/** /**
* @Description: 媒体资源管理 * @Description: 媒体资源管理
* @Author: 张明远 * @Author: 张明远
* @Date: 2025-05-15 * @Date: 2025-05-15
* @Version: V1.0 * @Version: V1.0
*/ */
@Api(tags="媒体资源管理") @Api(tags = "媒体资源管理")
@RestController @RestController
@RequestMapping("/mediamanage/mediaManage") @RequestMapping("/mediamanage/mediaManage")
@Slf4j @Slf4j
public class MediaManageController extends JeecgController<MediaManage, IMediaManageService> { public class MediaManageController extends JeecgController<MediaManage, IMediaManageService> {
@Autowired
private IMediaManageService mediaManageService; @Autowired
private IMediaManageService mediaManageService;
/** @Autowired
* 分页列表查询 private ISysConfigApi sysConfigApi;
*
* @param mediaManage
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "媒体资源管理-分页列表查询")
@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,
HttpServletRequest req) {
QueryWrapper<MediaManage> queryWrapper = QueryGenerator.initQueryWrapper(mediaManage, req.getParameterMap());
Page<MediaManage> page = new Page<MediaManage>(pageNo, pageSize);
IPage<MediaManage> 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<String> 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<String> 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<String> 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<String> 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<MediaManage> 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
* @param mediaManage * @param pageNo
*/ * @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "媒体资源管理-分页列表查询")
@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,
HttpServletRequest req) {
QueryWrapper<MediaManage> queryWrapper = QueryGenerator.initQueryWrapper(mediaManage, req.getParameterMap());
Page<MediaManage> page = new Page<MediaManage>(pageNo, pageSize);
IPage<MediaManage> 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<String> 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<String> 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<String> 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<String> 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<MediaManage> 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") @RequiresPermissions("mediamanage:nu_media_manage:exportXls")
@RequestMapping(value = "/exportXls") @RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, MediaManage mediaManage) { public ModelAndView exportXls(HttpServletRequest request, MediaManage mediaManage) {
@ -165,16 +171,25 @@ public class MediaManageController extends JeecgController<MediaManage, IMediaMa
} }
/** /**
* 通过excel导入数据 * 通过excel导入数据
* *
* @param request * @param request
* @param response * @param response
* @return * @return
*/ */
@RequiresPermissions("mediamanage:nu_media_manage:importExcel") @RequiresPermissions("mediamanage:nu_media_manage:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST) @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, MediaManage.class); 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.dto.SysConfigMQDto;
import com.nu.modules.async.entity.AsyncMain; import com.nu.modules.async.entity.AsyncMain;
import com.nu.modules.async.service.IAsyncMainService; 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.entity.SysConfig;
import com.nu.modules.sysconfig.mapper.SysConfigMapper; import com.nu.modules.sysconfig.mapper.SysConfigMapper;
import com.nu.modules.sysconfig.service.ISysConfigService; import com.nu.modules.sysconfig.service.ISysConfigService;
@ -22,11 +23,11 @@ import java.util.List;
/** /**
* @Description: 系统参数配置 * @Description: 系统参数配置
* @Author: 张明远 * @Author: 张明远
* @Date: 2025-05-09 * @Date: 2025-05-09
* @Version: V1.0 * @Version: V1.0
*/ */
@Service @Service
public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig> implements ISysConfigService { public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig> implements ISysConfigService, ISysConfigApi {
@Autowired @Autowired
private IAsyncMainService asyncMainService; private IAsyncMainService asyncMainService;
@ -80,4 +81,16 @@ public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig
rabbitMQUtil.sendToExchange("hldy.sysconfig.fanout", "", sysConfigMQDto); 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; package com.nu.modules.common;
import com.alibaba.fastjson.JSONObject;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.api.ISysBaseAPI; import org.jeecg.common.system.api.ISysBaseAPI;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -21,11 +22,32 @@ public class NuCommonApi {
@Autowired @Autowired
private ISysBaseAPI sysBaseAPI; 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") @GetMapping("/queryAreaDict")
public Result<Object> queryAreaDict(@RequestParam("id") String id) { public Result<Object> queryAreaDict(@RequestParam("id") String id) {
return Result.ok(sysBaseAPI.queryCategoryByPid(id)); return Result.ok(sysBaseAPI.queryCategoryByPid(id));
} }
/**
* 根据id查询对应省市区县信息
* @param id
* @return 对应的一条数据
*/
@GetMapping("/queryAreaNameById") @GetMapping("/queryAreaNameById")
public Result<Object> queryAreaNameById(@RequestParam("id") String id) { public Result<Object> queryAreaNameById(@RequestParam("id") String id) {
return Result.ok(sysBaseAPI.queryAreaNameById(id)); return Result.ok(sysBaseAPI.queryAreaNameById(id));

View File

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

View File

@ -23,7 +23,7 @@ public class YouBianCodeUtil {
/** /**
* 根据前一个code获取同级下一个code * 根据前一个code获取同级下一个code
* 例如:当前最大code为D01A04下一个code为D01A05 * 例如:当前最大code为D01A04下一个code为D01A05
* *
* @param code * @param code
* @return * @return
*/ */
@ -34,6 +34,9 @@ public class YouBianCodeUtil {
String num = getStrNum(1); String num = getStrNum(1);
newcode = zimu + num; newcode = zimu + num;
} else { } else {
if(!code.startsWith("A")){
code = "A"+code;
}
String beforeCode = code.substring(0, code.length() - 1- NUM_LENGTH); String beforeCode = code.substring(0, code.length() - 1- NUM_LENGTH);
String afterCode = code.substring(code.length() - 1 - NUM_LENGTH,code.length()); String afterCode = code.substring(code.length() - 1 - NUM_LENGTH,code.length());
char afterCodeZimu = afterCode.substring(0, 1).charAt(0); char afterCodeZimu = afterCode.substring(0, 1).charAt(0);
@ -70,11 +73,11 @@ public class YouBianCodeUtil {
/** /**
* 根据父亲code,获取下级的下一个code * 根据父亲code,获取下级的下一个code
* *
* 例如父亲CODE:A01 * 例如父亲CODE:A01
* 当前CODE:A01B03 * 当前CODE:A01B03
* 获取的code:A01B04 * 获取的code:A01B04
* *
* @param parentCode 上级code * @param parentCode 上级code
* @param localCode 同级code * @param localCode 同级code
* @return * @return
@ -83,19 +86,20 @@ public class YouBianCodeUtil {
if(localCode!=null && localCode!=""){ if(localCode!=null && localCode!=""){
// return parentCode + getNextYouBianCode(localCode); // return parentCode + getNextYouBianCode(localCode);
return getNextYouBianCode(localCode); return getNextYouBianCode(localCode).replace("A","");
}else{ }else{
parentCode = parentCode + "A"+ getNextStrNum(0); // parentCode = parentCode + "A"+ getNextStrNum(0);
parentCode = parentCode + getNextStrNum(0);
} }
return parentCode; return parentCode;
} }
/** /**
* 将数字前面位数补零 * 将数字前面位数补零
* *
* @param num * @param num
* @return * @return
*/ */
@ -105,7 +109,7 @@ public class YouBianCodeUtil {
/** /**
* 将数字前面位数补零 * 将数字前面位数补零
* *
* @param num * @param num
* @return * @return
*/ */
@ -116,7 +120,7 @@ public class YouBianCodeUtil {
/** /**
* 递增获取下个数字 * 递增获取下个数字
* *
* @param num * @param num
* @return * @return
*/ */
@ -127,7 +131,7 @@ public class YouBianCodeUtil {
/** /**
* 递增获取下个字母 * 递增获取下个字母
* *
* @param num * @param num
* @return * @return
*/ */
@ -138,7 +142,7 @@ public class YouBianCodeUtil {
zimu++; zimu++;
return zimu; return zimu;
} }
/** /**
* 根据数字位数获取最大值 * 根据数字位数获取最大值
* @param length * @param length
@ -166,7 +170,7 @@ public class YouBianCodeUtil {
} }
return cutcode; return cutcode;
} }
} }
// public static void main(String[] args) { // public static void main(String[] args) {
// // org.jeecgframework.core.util.LogUtil.info(getNextZiMu('C')); // // org.jeecgframework.core.util.LogUtil.info(getNextZiMu('C'));

View File

@ -49,6 +49,12 @@
<version>2.0.0</version> <version>2.0.0</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>com.nursingunit.boot</groupId>
<artifactId>nu-admin-local-api</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>
</project> </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.query.QueryRuleEnum;
import org.jeecg.common.system.vo.DictModel; import org.jeecg.common.system.vo.DictModel;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
@ -103,12 +104,20 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
queryWrapper.eq("id", "null"); queryWrapper.eq("id", "null");
} }
} }
if(StringUtils.isNotBlank(configServiceDirective.getViewType())){ if (StringUtils.isNotBlank(configServiceDirective.getViewType())) {
if("selected".equals(configServiceDirective.getViewType())){ if ("selected".equals(configServiceDirective.getViewType())) {
queryWrapper.in("id",configServiceDirective.getSelectedRowIds()); if (CollectionUtils.isEmpty(configServiceDirective.getSelectedRowIds())) {
queryWrapper.eq("id", "jh11J8");
} else {
queryWrapper.in("id", configServiceDirective.getSelectedRowIds());
}
} }
if("unselected".equals(configServiceDirective.getViewType())){ if ("unselected".equals(configServiceDirective.getViewType())) {
queryWrapper.notIn("id",configServiceDirective.getSelectedRowIds()); if (CollectionUtils.isEmpty(configServiceDirective.getSelectedRowIds())) {
queryWrapper.eq("id", "jh11J8");
} else {
queryWrapper.notIn("id", configServiceDirective.getSelectedRowIds());
}
} }
} }
Page<ConfigServiceDirective> page = new Page<ConfigServiceDirective>(pageNo, pageSize); Page<ConfigServiceDirective> page = new Page<ConfigServiceDirective>(pageNo, pageSize);

View File

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

View File

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

View File

@ -13,40 +13,46 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
/** /**
* @Description 底层共通业务API提供其他独立模块调用 * @Description 底层共通业务API提供其他独立模块调用
* @Author scott * @Author scott
* @Date 2019-4-20 * @Date 2019-4-20
* @Version V1.0 * @Version V1.0
*/ */
public interface ISysBaseAPI extends CommonAPI { public interface ISysBaseAPI extends CommonAPI {
//=======OLD 系统消息推送接口============================ //=======OLD 系统消息推送接口============================
/** /**
* 1发送系统消息 * 1发送系统消息
*
* @param message 使用构造器赋值参数 如果不设置category(消息类型)则默认为2 发送系统消息 * @param message 使用构造器赋值参数 如果不设置category(消息类型)则默认为2 发送系统消息
*/ */
void sendSysAnnouncement(MessageDTO message); void sendSysAnnouncement(MessageDTO message);
/** /**
* 2发送消息 附带业务参数 * 2发送消息 附带业务参数
*
* @param message 使用构造器赋值参数 * @param message 使用构造器赋值参数
*/ */
void sendBusAnnouncement(BusMessageDTO message); void sendBusAnnouncement(BusMessageDTO message);
/** /**
* 3通过模板发送消息 * 3通过模板发送消息
*
* @param message 使用构造器赋值参数 * @param message 使用构造器赋值参数
*/ */
void sendTemplateAnnouncement(TemplateMessageDTO message); void sendTemplateAnnouncement(TemplateMessageDTO message);
/** /**
* 4通过模板发送消息 附带业务参数 * 4通过模板发送消息 附带业务参数
*
* @param message 使用构造器赋值参数 * @param message 使用构造器赋值参数
*/ */
void sendBusTemplateAnnouncement(BusTemplateMessageDTO message); void sendBusTemplateAnnouncement(BusTemplateMessageDTO message);
/** /**
* 5通过消息中心模板生成推送内容 * 5通过消息中心模板生成推送内容
*
* @param templateDTO 使用构造器赋值参数 * @param templateDTO 使用构造器赋值参数
* @return * @return
*/ */
@ -54,14 +60,17 @@ public interface ISysBaseAPI extends CommonAPI {
//=======OLD 系统消息推送接口============================ //=======OLD 系统消息推送接口============================
//=======TY NEW 自定义消息推送接口邮件钉钉企业微信系统消息============================ //=======TY NEW 自定义消息推送接口邮件钉钉企业微信系统消息============================
/** /**
* NEW发送模板消息支持自定义推送类型: 邮件钉钉企业微信系统消息 * NEW发送模板消息支持自定义推送类型: 邮件钉钉企业微信系统消息
*
* @param message * @param message
*/ */
void sendTemplateMessage(MessageDTO message); void sendTemplateMessage(MessageDTO message);
/** /**
* NEW根据模板编码获取模板内容支持自定义推送类型 * NEW根据模板编码获取模板内容支持自定义推送类型
*
* @param templateCode * @param templateCode
* @return * @return
*/ */
@ -70,6 +79,7 @@ public interface ISysBaseAPI extends CommonAPI {
/** /**
* 6根据用户id查询用户信息 * 6根据用户id查询用户信息
*
* @param id * @param id
* @return * @return
*/ */
@ -77,6 +87,7 @@ public interface ISysBaseAPI extends CommonAPI {
/** /**
* 7通过用户账号查询角色集合 * 7通过用户账号查询角色集合
*
* @param username * @param username
* @return * @return
*/ */
@ -84,6 +95,7 @@ public interface ISysBaseAPI extends CommonAPI {
/** /**
* 7通过用户账号查询角色集合 * 7通过用户账号查询角色集合
*
* @param userId * @param userId
* @return * @return
*/ */
@ -91,12 +103,15 @@ public interface ISysBaseAPI extends CommonAPI {
/** /**
* 8通过用户账号查询部门集合 * 8通过用户账号查询部门集合
*
* @param username * @param username
* @return 部门 id * @return 部门 id
*/ */
List<String> getDepartIdsByUsername(String username); List<String> getDepartIdsByUsername(String username);
/** /**
* 8通过用户账号查询部门集合 * 8通过用户账号查询部门集合
*
* @param userId * @param userId
* @return 部门 id * @return 部门 id
*/ */
@ -104,6 +119,7 @@ public interface ISysBaseAPI extends CommonAPI {
/** /**
* 8.2 通过用户账号查询部门父ID集合 * 8.2 通过用户账号查询部门父ID集合
*
* @param username * @param username
* @return 部门 parentIds * @return 部门 parentIds
*/ */
@ -111,6 +127,7 @@ public interface ISysBaseAPI extends CommonAPI {
/** /**
* 8.2 查询部门父ID集合 * 8.2 查询部门父ID集合
*
* @param depIds * @param depIds
* @return 部门 parentIds * @return 部门 parentIds
*/ */
@ -118,26 +135,30 @@ public interface ISysBaseAPI extends CommonAPI {
/** /**
* 9通过用户账号查询部门 name * 9通过用户账号查询部门 name
*
* @param username * @param username
* @return 部门 name * @return 部门 name
*/ */
List<String> getDepartNamesByUsername(String username); List<String> getDepartNamesByUsername(String username);
/**
/** 11查询所有的父级字典按照create_time排序 * 11查询所有的父级字典按照create_time排序
*
* @return List<DictModel> 字典集合 * @return List<DictModel> 字典集合
*/ */
public List<DictModel> queryAllDict(); public List<DictModel> queryAllDict();
/** /**
* 12查询所有分类字典 * 12查询所有分类字典
*
* @return * @return
*/ */
public List<SysCategoryModel> queryAllSysCategory(); public List<SysCategoryModel> queryAllSysCategory();
/** /**
* 查询子集合 * 查询子集合
*
* @return * @return
*/ */
public List<SysCategoryModel> queryCategoryByPid(String pid); public List<SysCategoryModel> queryCategoryByPid(String pid);
@ -145,12 +166,14 @@ public interface ISysBaseAPI extends CommonAPI {
/** /**
* 14查询所有部门 作为字典信息 id -->value,departName -->text * 14查询所有部门 作为字典信息 id -->value,departName -->text
*
* @return * @return
*/ */
public List<DictModel> queryAllDepartBackDictModel(); public List<DictModel> queryAllDepartBackDictModel();
/** /**
* 15根据业务类型及业务id修改消息已读 * 15根据业务类型及业务id修改消息已读
*
* @param busType * @param busType
* @param busId * @param busId
*/ */
@ -158,6 +181,7 @@ public interface ISysBaseAPI extends CommonAPI {
/** /**
* 16查询表字典 支持过滤数据 * 16查询表字典 支持过滤数据
*
* @param table * @param table
* @param text * @param text
* @param code * @param code
@ -168,6 +192,7 @@ public interface ISysBaseAPI extends CommonAPI {
/** /**
* 17查询指定table的 text code 获取字典包含text和value * 17查询指定table的 text code 获取字典包含text和value
*
* @param table * @param table
* @param text * @param text
* @param code * @param code
@ -179,14 +204,16 @@ public interface ISysBaseAPI extends CommonAPI {
/** /**
* 18查询所有用户 返回ComboModel * 18查询所有用户 返回ComboModel
*
* @return * @return
*/ */
public List<ComboModel> queryAllUserBackCombo(); public List<ComboModel> queryAllUserBackCombo();
/** /**
* 19分页查询用户 返回JSONObject * 19分页查询用户 返回JSONObject
* @param userIds 多个用户id *
* @param pageNo 当前页数 * @param userIds 多个用户id
* @param pageNo 当前页数
* @param pageSize 每页显示条数 * @param pageSize 每页显示条数
* @return * @return
*/ */
@ -194,19 +221,22 @@ public interface ISysBaseAPI extends CommonAPI {
/** /**
* 20获取所有角色 * 20获取所有角色
*
* @return * @return
*/ */
public List<ComboModel> queryAllRole(); public List<ComboModel> queryAllRole();
/** /**
* 21获取所有角色 带参 * 21获取所有角色 带参
*
* @param roleIds 默认选中角色 * @param roleIds 默认选中角色
* @return * @return
*/ */
public List<ComboModel> queryAllRole(String[] roleIds ); public List<ComboModel> queryAllRole(String[] roleIds);
/** /**
* 22通过用户账号查询角色Id集合 * 22通过用户账号查询角色Id集合
*
* @param username * @param username
* @return * @return
*/ */
@ -214,6 +244,7 @@ public interface ISysBaseAPI extends CommonAPI {
/** /**
* 23通过部门编号查询部门id * 23通过部门编号查询部门id
*
* @param orgCode * @param orgCode
* @return * @return
*/ */
@ -221,12 +252,14 @@ public interface ISysBaseAPI extends CommonAPI {
/** /**
* 24查询所有部门 * 24查询所有部门
*
* @return * @return
*/ */
public List<SysDepartModel> getAllSysDepart(); public List<SysDepartModel> getAllSysDepart();
/** /**
* 25查找父级部门 * 25查找父级部门
*
* @param departId * @param departId
* @return * @return
*/ */
@ -234,6 +267,7 @@ public interface ISysBaseAPI extends CommonAPI {
/** /**
* 26根据部门Id获取部门负责人 * 26根据部门Id获取部门负责人
*
* @param deptId * @param deptId
* @return * @return
*/ */
@ -241,6 +275,7 @@ public interface ISysBaseAPI extends CommonAPI {
/** /**
* 27给指定用户发消息 * 27给指定用户发消息
*
* @param userIds * @param userIds
* @param cmd * @param cmd
*/ */
@ -248,6 +283,7 @@ public interface ISysBaseAPI extends CommonAPI {
/** /**
* 28根据id获取所有参与用户 * 28根据id获取所有参与用户
*
* @param userIds 多个用户id * @param userIds 多个用户id
* @return * @return
*/ */
@ -256,13 +292,15 @@ public interface ISysBaseAPI extends CommonAPI {
/** /**
* 29将会议签到信息推动到预览 * 29将会议签到信息推动到预览
* userIds * userIds
* @return *
* @param userId * @param userId
* @return
*/ */
void meetingSignWebsocket(String userId); void meetingSignWebsocket(String userId);
/** /**
* 30根据name获取所有参与用户 * 30根据name获取所有参与用户
*
* @param userNames 多个用户账户 * @param userNames 多个用户账户
* @return * @return
*/ */
@ -271,15 +309,17 @@ public interface ISysBaseAPI extends CommonAPI {
/** /**
* 根据高级查询条件查询用户 * 根据高级查询条件查询用户
*
* @param superQuery * @param superQuery
* @param matchType * @param matchType
* @return * @return
*/ */
List<JSONObject> queryUserBySuperQuery(String superQuery,String matchType); List<JSONObject> queryUserBySuperQuery(String superQuery, String matchType);
/** /**
* 根据ID查询用户 * 根据ID查询用户
*
* @param id * @param id
* @return * @return
*/ */
@ -288,38 +328,43 @@ public interface ISysBaseAPI extends CommonAPI {
/** /**
* 根据高级查询条件查询部门 * 根据高级查询条件查询部门
*
* @param superQuery * @param superQuery
* @param matchType * @param matchType
* @return * @return
*/ */
List<JSONObject> queryDeptBySuperQuery(String superQuery,String matchType); List<JSONObject> queryDeptBySuperQuery(String superQuery, String matchType);
/** /**
* 根据高级查询条件查询角色 * 根据高级查询条件查询角色
*
* @param superQuery * @param superQuery
* @param matchType * @param matchType
* @return * @return
*/ */
List<JSONObject> queryRoleBySuperQuery(String superQuery,String matchType); List<JSONObject> queryRoleBySuperQuery(String superQuery, String matchType);
/** /**
* 根据租户ID查询用户ID * 根据租户ID查询用户ID
*
* @param tenantId 租户ID * @param tenantId 租户ID
* @return List<String> * @return List<String>
*/ */
List<String> selectUserIdByTenantId(String tenantId); List<String> selectUserIdByTenantId(String tenantId);
/** /**
* 31获取用户的角色集合 * 31获取用户的角色集合
*
* @param username * @param username
* @return * @return
*/ */
Set<String> getUserRoleSet(String username); Set<String> getUserRoleSet(String username);
/** /**
* 31获取用户的角色集合 * 31获取用户的角色集合
*
* @param useId * @param useId
* @return * @return
*/ */
@ -327,6 +372,7 @@ public interface ISysBaseAPI extends CommonAPI {
/** /**
* 32获取用户的权限集合 * 32获取用户的权限集合
*
* @param userId * @param userId
* @return * @return
*/ */
@ -334,6 +380,7 @@ public interface ISysBaseAPI extends CommonAPI {
/** /**
* 33判断是否有online访问的权限 * 33判断是否有online访问的权限
*
* @param onlineAuthDTO * @param onlineAuthDTO
* @return * @return
*/ */
@ -341,6 +388,7 @@ public interface ISysBaseAPI extends CommonAPI {
/** /**
* 34通过部门id获取部门全部信息 * 34通过部门id获取部门全部信息
*
* @param id 部门id * @param id 部门id
* @return SysDepartModel对象 * @return SysDepartModel对象
*/ */
@ -348,6 +396,7 @@ public interface ISysBaseAPI extends CommonAPI {
/** /**
* 35根据用户id查询用户所属公司下所有用户ids * 35根据用户id查询用户所属公司下所有用户ids
*
* @param userId * @param userId
* @return * @return
*/ */
@ -355,6 +404,7 @@ public interface ISysBaseAPI extends CommonAPI {
/** /**
* 36根据多个用户账号(逗号分隔)查询返回多个用户信息 * 36根据多个用户账号(逗号分隔)查询返回多个用户信息
*
* @param usernames * @param usernames
* @return * @return
*/ */
@ -362,6 +412,7 @@ public interface ISysBaseAPI extends CommonAPI {
/** /**
* 37根据多个用户ID(逗号分隔)查询返回多个用户信息 * 37根据多个用户ID(逗号分隔)查询返回多个用户信息
*
* @param ids * @param ids
* @return * @return
*/ */
@ -369,6 +420,7 @@ public interface ISysBaseAPI extends CommonAPI {
/** /**
* 38根据多个部门编码(逗号分隔)查询返回多个部门信息 * 38根据多个部门编码(逗号分隔)查询返回多个部门信息
*
* @param orgCodes * @param orgCodes
* @return * @return
*/ */
@ -376,6 +428,7 @@ public interface ISysBaseAPI extends CommonAPI {
/** /**
* 39根据多个部门id(逗号分隔)查询返回多个部门信息 * 39根据多个部门id(逗号分隔)查询返回多个部门信息
*
* @param ids * @param ids
* @return * @return
*/ */
@ -383,11 +436,12 @@ public interface ISysBaseAPI extends CommonAPI {
/** /**
* 40发送邮件消息 * 40发送邮件消息
*
* @param email * @param email
* @param title * @param title
* @param content * @param content
*/ */
void sendEmailMsg(String email,String title,String content); void sendEmailMsg(String email, String title, String content);
/** /**
* 40发送模版邮件消息 * 40发送模版邮件消息
@ -398,8 +452,10 @@ public interface ISysBaseAPI extends CommonAPI {
* @param params 模版参数 * @param params 模版参数
*/ */
void sendHtmlTemplateEmail(String email, String title, EmailTemplateEnum emailTemplateEnum, JSONObject params); void sendHtmlTemplateEmail(String email, String title, EmailTemplateEnum emailTemplateEnum, JSONObject params);
/** /**
* 41 获取公司下级部门和公司下所有用户信息 * 41 获取公司下级部门和公司下所有用户信息
*
* @param orgCode * @param orgCode
* @return List<Map> * @return List<Map>
*/ */
@ -407,6 +463,7 @@ public interface ISysBaseAPI extends CommonAPI {
/** /**
* 查询分类字典翻译 * 查询分类字典翻译
*
* @param ids 多个分类字典id * @param ids 多个分类字典id
* @return List<String> * @return List<String>
*/ */
@ -431,10 +488,10 @@ public interface ISysBaseAPI extends CommonAPI {
/** /**
* 复制应用下的所有字典配置到新的租户下 * 复制应用下的所有字典配置到新的租户下
* *
* @param originalAppId 原始低代码应用ID * @param originalAppId 原始低代码应用ID
* @param appId 新的低代码应用ID * @param appId 新的低代码应用ID
* @param tenantId 新的租户ID * @param tenantId 新的租户ID
* @return Map<String, String> Map<原字典编码, 新字典编码> * @return Map<String, String> Map<原字典编码, 新字典编码>
*/ */
Map<String, String> copyLowAppDict(String originalAppId, String appId, String tenantId); Map<String, String> copyLowAppDict(String originalAppId, String appId, String tenantId);
@ -448,7 +505,8 @@ public interface ISysBaseAPI extends CommonAPI {
List<DictModel> getDictItems(String dictCode); List<DictModel> getDictItems(String dictCode);
/** /**
* 根据多个字典code查询多个字典项 * 根据多个字典code查询多个字典项
*
* @param dictCodeList * @param dictCodeList
* @return key = dictCode value=对应的字典项 * @return key = dictCode value=对应的字典项
*/ */
@ -459,7 +517,7 @@ public interface ISysBaseAPI extends CommonAPI {
* 大数据量的字典表 走异步加载 即前端输入内容过滤数据 * 大数据量的字典表 走异步加载 即前端输入内容过滤数据
* *
* @param dictCode 字典code格式table,text,code * @param dictCode 字典code格式table,text,code
* @param keyword 过滤关键字 * @param keyword 过滤关键字
* @param pageSize 分页条数 * @param pageSize 分页条数
* @return * @return
*/ */
@ -467,23 +525,28 @@ public interface ISysBaseAPI extends CommonAPI {
/** /**
* 新增数据日志 * 新增数据日志
*
* @param dataLogDto * @param dataLogDto
*/ */
void saveDataLog(DataLogDTO dataLogDto); void saveDataLog(DataLogDTO dataLogDto);
/** /**
* 更新头像 * 更新头像
*
* @param loginUser * @param loginUser
*/ */
void updateAvatar(LoginUser loginUser); void updateAvatar(LoginUser loginUser);
/** /**
* 向app端 websocket推送聊天刷新消息 * 向app端 websocket推送聊天刷新消息
*
* @param userId * @param userId
*/ */
void sendAppChatSocket(String userId); void sendAppChatSocket(String userId);
/** /**
* 根据角色id查询角色code * 根据角色id查询角色code
*
* @param id * @param id
* @return * @return
*/ */
@ -499,6 +562,7 @@ public interface ISysBaseAPI extends CommonAPI {
/** /**
* 根据部门ID查询用户ID * 根据部门ID查询用户ID
*
* @param deptIds * @param deptIds
* @return * @return
*/ */
@ -506,6 +570,7 @@ public interface ISysBaseAPI extends CommonAPI {
/** /**
* 根据部门ID查询用户账号 * 根据部门ID查询用户账号
*
* @param deptIds * @param deptIds
* @return * @return
*/ */
@ -513,6 +578,7 @@ public interface ISysBaseAPI extends CommonAPI {
/** /**
* 根据角色编码 查询用户ID * 根据角色编码 查询用户ID
*
* @param roleCodes * @param roleCodes
* @return * @return
*/ */
@ -520,6 +586,7 @@ public interface ISysBaseAPI extends CommonAPI {
/** /**
* 根据职务ID查询用户ID * 根据职务ID查询用户ID
*
* @param positionIds * @param positionIds
* @return * @return
*/ */
@ -552,9 +619,10 @@ public interface ISysBaseAPI extends CommonAPI {
/** /**
* 查询各业务机构 编码名称 * 查询各业务机构 编码名称
*
*/ */
List<JSONObject> queryOpeDept(); 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 org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.Objects; import java.util.Objects;
@ -74,6 +75,11 @@ public class SysDepart implements Serializable {
*/ */
@Excel(name = "机构编码", width = 15) @Excel(name = "机构编码", width = 15)
private String orgCode; private String orgCode;
/**
* 协议+域名
*/
@Excel(name = "协议+域名", width = 30)
private String url;
/** /**
* 省份 * 省份
*/ */
@ -139,6 +145,11 @@ public class SysDepart implements Serializable {
*/ */
@Excel(name = "备注", width = 15) @Excel(name = "备注", width = 15)
private String memo; private String memo;
/**
* 应缴金额
*/
@Excel(name = "应缴金额", width = 15)
private BigDecimal payableAmount;
/** /**
* 状态1启用0不启用 * 状态1启用0不启用
*/ */
@ -234,9 +245,14 @@ public class SysDepart implements Serializable {
Objects.equals(orgCategory, depart.orgCategory) && Objects.equals(orgCategory, depart.orgCategory) &&
Objects.equals(orgType, depart.orgType) && Objects.equals(orgType, depart.orgType) &&
Objects.equals(orgCode, depart.orgCode) && Objects.equals(orgCode, depart.orgCode) &&
Objects.equals(url, depart.url) &&
Objects.equals(province, depart.province) && Objects.equals(province, depart.province) &&
Objects.equals(city, depart.city) && Objects.equals(city, depart.city) &&
Objects.equals(district, depart.district) && 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(mobile, depart.mobile) &&
Objects.equals(fax, depart.fax) && Objects.equals(fax, depart.fax) &&
Objects.equals(address, depart.address) && Objects.equals(address, depart.address) &&
@ -247,6 +263,7 @@ public class SysDepart implements Serializable {
Objects.equals(createTime, depart.createTime) && Objects.equals(createTime, depart.createTime) &&
Objects.equals(updateBy, depart.updateBy) && Objects.equals(updateBy, depart.updateBy) &&
Objects.equals(tenantId, depart.tenantId) && Objects.equals(tenantId, depart.tenantId) &&
Objects.equals(payableAmount, depart.payableAmount) &&
Objects.equals(updateTime, depart.updateTime); Objects.equals(updateTime, depart.updateTime);
} }
@ -257,7 +274,8 @@ public class SysDepart implements Serializable {
public int hashCode() { public int hashCode() {
return Objects.hash(super.hashCode(), id, parentId, departName, return Objects.hash(super.hashCode(), id, parentId, departName,
departNameEn, departNameAbbr, departOrder, description, orgCategory, departNameEn, departNameAbbr, departOrder, description, orgCategory,
orgType, orgCode, province, city, district, mobile, fax, address, memo, status, orgType, orgCode, url, province, city, district, operationStartTime,
delFlag, createBy, createTime, updateBy, updateTime, tenantId); operationEndTime, contractStartTime, contractEndTime, mobile, fax, address, memo, status,
delFlag, createBy, createTime, updateBy, updateTime, tenantId, payableAmount);
} }
} }

View File

@ -2,54 +2,53 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.system.mapper.SysDepartMapper"> <mapper namespace="org.jeecg.modules.system.mapper.SysDepartMapper">
<select id="queryUserDeparts" parameterType="String" resultType="org.jeecg.modules.system.entity.SysDepart"> <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 *
</select> from sys_depart
where id IN (select dep_id from sys_user_depart where user_id = #{userId})
</select>
<!-- 根据username查询所拥有的部门 --> <!-- 根据username查询所拥有的部门 -->
<select id="queryDepartsByUsername" parameterType="String" resultType="org.jeecg.modules.system.entity.SysDepart"> <select id="queryDepartsByUsername" parameterType="String" resultType="org.jeecg.modules.system.entity.SysDepart">
SELECT * SELECT *
FROM sys_depart FROM sys_depart
WHERE id IN ( WHERE id IN (SELECT dep_id
SELECT dep_id FROM sys_user_depart
FROM sys_user_depart WHERE user_id = (SELECT id
WHERE user_id = ( FROM sys_user
SELECT id WHERE username = #{username}))
FROM sys_user
WHERE username = #{username}
)
)
</select> </select>
<!-- 根据username查询所拥有的部门 --> <!-- 根据username查询所拥有的部门 -->
<select id="queryDepartsByUserId" parameterType="String" resultType="java.lang.String"> <select id="queryDepartsByUserId" parameterType="String" resultType="java.lang.String">
SELECT id SELECT id
FROM sys_depart FROM sys_depart
WHERE id IN ( WHERE id IN (SELECT dep_id
SELECT dep_id FROM sys_user_depart
FROM sys_user_depart WHERE user_id = #{userId})
WHERE user_id = #{userId}
)
</select> </select>
<!-- 根据部门Id查询,当前和下级所有部门IDS --> <!-- 根据部门Id查询,当前和下级所有部门IDS -->
<select id="getSubDepIdsByDepId" resultType="java.lang.String"> <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
</select> from sys_depart
where del_flag = '0'
and org_code like concat((select org_code from sys_depart where id = #{departId}), '%')
</select>
<!--根据部门编码获取我的部门下所有部门ids --> <!--根据部门编码获取我的部门下所有部门ids -->
<select id="getSubDepIdsByOrgCodes" resultType="java.lang.String"> <select id="getSubDepIdsByOrgCodes" resultType="java.lang.String">
select id from sys_depart where del_flag = '0' and select id from sys_depart where del_flag = '0' and
<foreach collection="orgCodes" item="item" index="index" open="(" separator="or" close=")"> <foreach collection="orgCodes" item="item" index="index" open="(" separator="or" close=")">
org_code LIKE CONCAT(#{item},'%') org_code LIKE CONCAT(#{item},'%')
</foreach> </foreach>
</select> </select>
<!--根据parent_id查询下级部门--> <!--根据parent_id查询下级部门-->
<select id="queryTreeListByPid" parameterType="Object" resultType="org.jeecg.modules.system.entity.SysDepart"> <select id="queryTreeListByPid" parameterType="Object" resultType="org.jeecg.modules.system.entity.SysDepart">
SELECT * FROM sys_depart where del_flag = '0' SELECT * FROM sys_depart where del_flag = '0'
<choose> <choose>
<when test="parentId != null and parentId != ''"> <when test="parentId != null and parentId != ''">
AND parent_id = #{parentId,jdbcType=VARCHAR} AND parent_id = #{parentId,jdbcType=VARCHAR}
</when> </when>
<otherwise> <otherwise>
AND parent_id is null or parent_id='' AND parent_id is null or parent_id=''
@ -60,8 +59,12 @@
<!-- 根据OrgCod查询公司信息 --> <!-- 根据OrgCod查询公司信息 -->
<select id="queryCompByOrgCode" resultType="org.jeecg.modules.system.entity.SysDepart"> <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 *
</select> from sys_depart
where del_flag = '0'
and org_category = '1'
and org_code = #{orgCode,jdbcType=VARCHAR}
</select>
<!--通过父级id和租户id查询部门--> <!--通过父级id和租户id查询部门-->
<select id="queryBookDepTreeSync" resultType="org.jeecg.modules.system.entity.SysDepart"> <select id="queryBookDepTreeSync" resultType="org.jeecg.modules.system.entity.SysDepart">
@ -100,7 +103,7 @@
parent_id IS NULL OR parent_id='' parent_id IS NULL OR parent_id=''
</otherwise> </otherwise>
</choose> </choose>
ORDER BY org_code DESC ORDER BY org_code + 0 DESC
</select> </select>
<!--获取父级部门的数据--> <!--获取父级部门的数据-->
@ -162,7 +165,7 @@
<!--通过部门id查询部门下的用户的账号 --> <!--通过部门id查询部门下的用户的账号 -->
<select id="queryUserAccountByDepartIds" resultType="java.lang.String"> <select id="queryUserAccountByDepartIds" resultType="java.lang.String">
select username from sys_user where id in (select user_id from sys_user_depart where dep_id in select username from sys_user where id in (select user_id from sys_user_depart where dep_id in
<foreach item="item" index="index" collection="departIds" open="(" separator="," close=" )"> <foreach item="item" index="index" collection="departIds" open="(" separator="," close=" )">
#{item} #{item}
</foreach> </foreach>
) )
@ -171,22 +174,22 @@
<!--系统后台导出根据父级id和租户id查询部门数据--> <!--系统后台导出根据父级id和租户id查询部门数据-->
<select id="getSysDepartList" resultType="org.jeecg.modules.system.vo.SysDepartExportVo"> <select id="getSysDepartList" resultType="org.jeecg.modules.system.vo.SysDepartExportVo">
SELECT SELECT
id, id,
depart_name, depart_name,
parent_id, parent_id,
depart_name_en, depart_name_en,
depart_order, depart_order,
description, description,
org_category, org_category,
org_code, org_code,
operation_start_time, operation_start_time,
operation_end_time, operation_end_time,
contract_start_time, contract_start_time,
contract_end_time, contract_end_time,
mobile, mobile,
fax, fax,
address, address,
memo memo
FROM sys_depart FROM sys_depart
WHERE WHERE
1=1 1=1

View File

@ -2,9 +2,11 @@ package org.jeecg.modules.system.model;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.jeecg.modules.system.entity.SysDepart; import org.jeecg.modules.system.entity.SysDepart;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -63,6 +65,8 @@ public class SysDepartTreeModel implements Serializable {
private String orgCode; private String orgCode;
private String url;
private String province; private String province;
private String city; private String city;
@ -101,6 +105,8 @@ public class SysDepartTreeModel implements Serializable {
private String picUrl; private String picUrl;
private BigDecimal payableAmount;
//update-begin---author:wangshuai ---date:20200308 for[JTC-119]在部门管理菜单下设置部门负责人新增字段部门负责人ids //update-begin---author:wangshuai ---date:20200308 for[JTC-119]在部门管理菜单下设置部门负责人新增字段部门负责人ids
/** /**
* 部门负责人ids * 部门负责人ids
@ -131,6 +137,7 @@ public class SysDepartTreeModel implements Serializable {
this.orgCategory = sysDepart.getOrgCategory(); this.orgCategory = sysDepart.getOrgCategory();
this.orgType = sysDepart.getOrgType(); this.orgType = sysDepart.getOrgType();
this.orgCode = sysDepart.getOrgCode(); this.orgCode = sysDepart.getOrgCode();
this.url = sysDepart.getUrl();
this.province = sysDepart.getProvince(); this.province = sysDepart.getProvince();
this.city = sysDepart.getCity(); this.city = sysDepart.getCity();
this.district = sysDepart.getDistrict(); this.district = sysDepart.getDistrict();
@ -151,6 +158,7 @@ public class SysDepartTreeModel implements Serializable {
this.updateTime = sysDepart.getUpdateTime(); this.updateTime = sysDepart.getUpdateTime();
this.directorUserIds = sysDepart.getDirectorUserIds(); this.directorUserIds = sysDepart.getDirectorUserIds();
this.picUrl = sysDepart.getPicUrl(); this.picUrl = sysDepart.getPicUrl();
this.payableAmount = sysDepart.getPayableAmount();
if (0 == sysDepart.getIzLeaf()) { if (0 == sysDepart.getIzLeaf()) {
this.isLeaf = false; this.isLeaf = false;
} else { } else {
@ -462,6 +470,22 @@ public class SysDepartTreeModel implements Serializable {
this.district = district; 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方法 * 重写equals方法
*/ */
@ -485,6 +509,7 @@ public class SysDepartTreeModel implements Serializable {
Objects.equals(orgCategory, model.orgCategory) && Objects.equals(orgCategory, model.orgCategory) &&
Objects.equals(orgType, model.orgType) && Objects.equals(orgType, model.orgType) &&
Objects.equals(orgCode, model.orgCode) && Objects.equals(orgCode, model.orgCode) &&
Objects.equals(url, model.url) &&
Objects.equals(province, model.province) && Objects.equals(province, model.province) &&
Objects.equals(city, model.city) && Objects.equals(city, model.city) &&
Objects.equals(district, model.district) && Objects.equals(district, model.district) &&
@ -504,6 +529,7 @@ public class SysDepartTreeModel implements Serializable {
Objects.equals(updateBy, model.updateBy) && Objects.equals(updateBy, model.updateBy) &&
Objects.equals(updateTime, model.updateTime) && Objects.equals(updateTime, model.updateTime) &&
Objects.equals(directorUserIds, model.directorUserIds) && Objects.equals(directorUserIds, model.directorUserIds) &&
Objects.equals(payableAmount, model.payableAmount) &&
Objects.equals(children, model.children); Objects.equals(children, model.children);
} }
@ -514,10 +540,10 @@ public class SysDepartTreeModel implements Serializable {
public int hashCode() { public int hashCode() {
return Objects.hash(id, parentId, platType, departName, departNameEn, departNameAbbr, 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, operationStartTime, operationEndTime, contractStartTime, contractEndTime,
mobile, fax, address, memo, status, delFlag, qywxIdentifier, 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(); oldOrgCode = depart.getOrgCode();
orgType = depart.getOrgType(); orgType = depart.getOrgType();
newOrgCode = YouBianCodeUtil.getNextYouBianCode(oldOrgCode); newOrgCode = YouBianCodeUtil.getNextYouBianCode(oldOrgCode);
newOrgCode = newOrgCode.substring(1);
} }
} else {//反之则查询出所有同级的部门,获取结果后有两种情况,有同级和没有同级 } else {//反之则查询出所有同级的部门,获取结果后有两种情况,有同级和没有同级
//获取自己部门最大值orgCode部门信息 //获取自己部门最大值orgCode部门信息

View File

@ -59,6 +59,7 @@ import org.jeecg.config.mybatis.MybatisPlusSaasConfig;
import org.jeecg.modules.system.entity.*; import org.jeecg.modules.system.entity.*;
import org.jeecg.modules.system.mapper.*; import org.jeecg.modules.system.mapper.*;
import org.jeecg.modules.system.service.*; import org.jeecg.modules.system.service.*;
import org.jetbrains.annotations.Nullable;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable; import org.springframework.cache.annotation.Cacheable;
@ -1889,33 +1890,28 @@ public class SysBaseApiImpl implements ISysBaseAPI {
} }
@Override @Override
public JSONObject getOrgInfoByNUCode(String nuCode) { public JSONObject getOrgInfoByNuId(String nuId) {
if(StringUtils.isBlank(nuCode)){ if(StringUtils.isBlank(nuId)){
return null; 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<>(); QueryWrapper<SysDepart> qw = new QueryWrapper<>();
qw.eq("org_code", orgCode);//机构编码 qw.eq("org_code", orgCode);//机构编码
qw.eq("org_category", "1");//机构类型 qw.eq("org_category", "1");//机构类型
qw.eq("del_flag", "0");//未删除数据 qw.eq("del_flag", "0");//未删除数据
SysDepart sysDepart = sysDepartService.getOne(qw); SysDepart sysDepart = sysDepartService.getOne(qw);
if (sysDepart != null) { if (sysDepart != null) {
JSONObject result = new JSONObject(); return (JSONObject) JSONObject.toJSON(sysDepart);
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;
} else { } else {
return null; return null;
} }