Compare commits

..

No commits in common. "7bcd2fc40312258b6ee73d7a7a5dc92eef15bd3e" and "545573e588a8edfc5abc989366b493a800c00bff" have entirely different histories.

26 changed files with 1641 additions and 2085 deletions

View File

@ -18,7 +18,7 @@ public class AdvisoryMQExceptionHandler implements RabbitListenerErrorHandler {
// 根据异常类型选择处理策略
if (isRetryable(e)) {
// 可重试异常抛出异常触发重试
throw new AmqpRejectAndDontRequeueException("消息处理失败且禁止重试", e);
throw e;
} else {
// 不可恢复异常拒绝消息且不重新入队
throw new AmqpRejectAndDontRequeueException("消息处理失败且禁止重试", e);

View File

@ -1,73 +0,0 @@
package com.nu.modules.pad.appversionconfig.api;
import cn.hutool.core.util.StrUtil;
import com.nu.modules.pad.appversionconfig.entity.AppConfig;
import com.nu.modules.pad.appversionconfig.entity.R;
import com.nu.modules.pad.appversionconfig.entity.VersionInfo;
import com.nu.modules.pad.appversionconfig.service.IAppConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.Map;
@RestController
@RequestMapping("/nuIpadApi/versionManage")
@CrossOrigin("*")
public class VersionManageApi {
@Autowired
private IAppConfigService appConfigService;
/**
* APP版本更新
* 请求参数中其实不止传递了一下四个更多请看插件市场作者的文档https://ext.dcloud.net.cn/plugin?id=3931
* @param platform 平台android/ios
* @param name 应用名称
* @param version 应用版本名称 主版本号.次版本号.修订号
* @param code 应用版本号
* @return
*/
@RequestMapping("/versionUpdate")
public R check(String platform,String name,String version,String code) {
Map<String, Object> map = new HashMap<>();
VersionInfo info = new VersionInfo();
info.setUpdate_flag(0);
map.put("code", 100);
map.put("data", info);
AppConfig appConfig = appConfigService.findLastVersionInfo();
if(appConfig ==null) {
map.put("msg", "无版本配置信息");
return R.ok(map);
}
if(!StrUtil.isEmptyIfStr(version) && !StrUtil.isEmptyIfStr(platform)) {
int[] oldVers = StrUtil.splitToInt(version, ".");
int[] newVers = StrUtil.splitToInt(appConfig.getVersionCode(), ".");
boolean isUpdateFlag = false;
int length = oldVers.length > newVers.length ? newVers.length : oldVers.length;
for (int i = 0; i < length; i++) {
if(newVers[i] > oldVers[i]) {
isUpdateFlag = true;
break;
}
}
if(isUpdateFlag) {
info.setUpdate_flag(1);//0不需要更新1:需要更新
info.setVersion(appConfig.getVersionCode());
info.setUpdate_url(appConfig.getVersionUrl());
info.setUpdate_tips(appConfig.getUpdateTrips());
info.setForceupdate(appConfig.getIsForceUpdate());
map.put("code", 100);
map.put("msg", "应用程序需要更新");
map.put("data", info);
}
return R.ok(map);
}else {
map.put("code", 500);
map.put("msg", "请求参数不含版本号、平台");
map.put("data", info);
return R.ok(map);
}
}
}

View File

@ -16,7 +16,7 @@ import java.util.Map;
@RestController
@RequestMapping("/api/pad")
@CrossOrigin("*")
public class VersionManageApiBK {
public class VersionUpdateApi {
@Autowired
private IAppConfigService appConfigService;

View File

@ -114,7 +114,6 @@ public class ShiroConfig {
filterChainDefinitionMap.put("/sys/getQrcodeToken/**", "anon"); //监听扫码
filterChainDefinitionMap.put("/sys/checkAuth", "anon"); //授权接口排除
filterChainDefinitionMap.put("/api/pad/versionUpdate", "anon");//pad端版本检测接口
filterChainDefinitionMap.put("/nuIpadApi/versionManage/versionUpdate", "anon");//pad端版本检测接口
//update-begin--Author:scott Date:20221116 for排除静态资源后缀
filterChainDefinitionMap.put("/", "anon");

View File

@ -17,11 +17,6 @@
<artifactId>nursing-unit-base-core</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.nursingunit.boot</groupId>
<artifactId>nu-system-local-api</artifactId>
<version>2.0.0</version>
</dependency>
</dependencies>
</project>

View File

@ -32,6 +32,43 @@ public class RabbitMQConfig {
return new DirectExchange("hldy.fwzl");
}
// 队列
@Bean
public Queue nu001FwzlAsyncQueue() {
return new Queue("nu001.fwzl.async", true);
}
@Bean
public Queue nu001FwzlStatusQueue() {
return new Queue("nu001.fwzl.status", true);
}
@Bean
public Queue nu002FwzlAsyncQueue() {
return new Queue("nu002.fwzl.async", true);
}
@Bean
public Queue nu002FwzlStatusQueue() {
return new Queue("nu002.fwzl.status", true);
}
@Bean
public Binding binding1(Queue nu001FwzlAsyncQueue, DirectExchange fwzlExchange) {
return BindingBuilder.bind(nu001FwzlAsyncQueue).to(fwzlExchange).with("nu001.fwzl.async");
}
@Bean
public Binding binding2(Queue nu001FwzlStatusQueue, DirectExchange fwzlExchange) {
return BindingBuilder.bind(nu001FwzlStatusQueue).to(fwzlExchange).with("nu001.fwzl.status");
}
@Bean
public Binding binding3(Queue nu002FwzlAsyncQueue, DirectExchange fwzlExchange) {
return BindingBuilder.bind(nu002FwzlAsyncQueue).to(fwzlExchange).with("nu002.fwzl.async");
}
@Bean
public Binding binding4(Queue nu002FwzlStatusQueue, DirectExchange fwzlExchange) {
return BindingBuilder.bind(nu002FwzlStatusQueue).to(fwzlExchange).with("nu002.fwzl.status");
}
//注册
@Bean
public DirectExchange registerExchange() {
@ -53,5 +90,4 @@ public class RabbitMQConfig {
public Binding bindingRegEdit(Queue registerEditQueue, DirectExchange registerExchange) {
return BindingBuilder.bind(registerEditQueue).to(registerExchange).with("register.editData");
}
}

View File

@ -13,9 +13,4 @@ public class StatusMQDto {
private String asyncId;
//同步表子表code
private String code;
private String dictId;
private String orgCode;
private String orgName;
}

View File

@ -1,70 +0,0 @@
package com.nu.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @Author zmy
* @since 2025-5-6
*/
@Data
public class SysDictItemMQDto implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
private String id;
/**
* 字典id
*/
private String dictId;
/**
* 字典项文本
*/
private String itemText;
/**
* 字典项值
*/
private String itemValue;
/**
* 描述
*/
private String description;
/**
* 排序
*/
private Integer sortOrder;
/**
* 状态1启用 0不启用
*/
private Integer status;
private String createBy;
private Date createTime;
private String updateBy;
private Date updateTime;
/**
* 字典项颜色
*/
private String itemColor;
}

View File

@ -1,90 +0,0 @@
package com.nu.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* <p>
* 字典表
* </p>
*
* @Author zmy
* @since 2025-5-6
*/
@Data
public class SysDictMQDto implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
private String id;
/**
* [预留字段暂时无用]
* 字典类型,0 string,1 number类型,2 boolean
* 前端js对stirng类型和number类型 boolean 类型敏感需要区分在select 标签匹配的时候会用到
* 默认为string类型
*/
private Integer type;
/**
* 字典名称
*/
private String dictName;
/**
* 字典编码
*/
private String dictCode;
/**
* 描述
*/
private String description;
/**
* 标识
* sys系统字典非客户使用字典
* nu业务字典客户使用字典
*/
private String tag;
/**
* 删除状态
*/
private Integer delFlag;
/**
* 创建人
*/
private String createBy;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新人
*/
private String updateBy;
/**
* 更新时间
*/
private Date updateTime;
/**租户ID*/
private Integer tenantId;
/** 关联的低代码应用ID */
private String lowAppId;
private List<SysDictItemMQDto> sysDictItemList;
}

View File

@ -2,7 +2,6 @@ package com.nu.modules.async.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@ -18,7 +17,6 @@ import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import io.swagger.annotations.Api;
@ -37,7 +35,6 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
@RequestMapping("/asyncmain/asyncMain")
@Slf4j
public class AsyncMainController extends JeecgController<AsyncMain, IAsyncMainService> {
@Autowired
private IAsyncMainService asyncMainService;
@ -63,7 +60,7 @@ public class AsyncMainController extends JeecgController<AsyncMain, IAsyncMainSe
IPage<AsyncMain> pageList = asyncMainService.page(page, queryWrapper);
List<AsyncMain> records = pageList.getRecords();
if (records != null && !records.isEmpty()) {
records = asyncMainService.pageList(records,asyncMain);
records = asyncMainService.pageList(records);
pageList.setRecords(records);
}
return Result.OK(pageList);
@ -171,8 +168,4 @@ public class AsyncMainController extends JeecgController<AsyncMain, IAsyncMainSe
return super.importExcel(request, response, AsyncMain.class);
}
@PostMapping("/listByType")
public Result<Map<String,List<AsyncMain>>> listByType(@RequestBody AsyncMain am){
return Result.OK(asyncMainService.listByType(am));
}
}

View File

@ -35,18 +35,10 @@ public class AsyncMain implements Serializable {
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private java.lang.String id;
/**被同步数据的主键id*/
@Excel(name = "被同步数据的主键id", width = 15)
@ApiModelProperty(value = "被同步数据的主键id")
private java.lang.String primaryKey;
/**机构编码*/
@Excel(name = "机构编码", width = 15)
@ApiModelProperty(value = "机构编码")
private java.lang.String orgCode;
/**机构名称*/
@Excel(name = "机构名称", width = 15)
@ApiModelProperty(value = "机构名称")
private java.lang.String orgName;
/**类型(同步的是什么类型的数据)*/
@Excel(name = "类型(同步的是什么类型的数据)", width = 15)
@ApiModelProperty(value = "类型(同步的是什么类型的数据)")
@ -64,13 +56,7 @@ public class AsyncMain implements Serializable {
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private java.util.Date createTime;
/**状态*/
@Excel(name = "状态", width = 15)
@ApiModelProperty(value = "状态")
private java.lang.String status;
@TableField(exist = false)
private List<AsyncStatus> asyncStatusList;
@TableField(exist = false)
private List<String> ids;
}

View File

@ -14,5 +14,5 @@ import java.util.List;
*/
public interface AsyncMainMapper extends BaseMapper<AsyncMain> {
List<AsyncMain> pageList(@Param("records") List<AsyncMain> records,@Param("dto") AsyncMain dto);
List<AsyncMain> pageList(@Param("pojo") List<AsyncMain> records);
}

View File

@ -4,9 +4,7 @@
<resultMap id="asyncResultMap" type="com.nu.modules.async.entity.AsyncMain">
<id property="id" column="id"/>
<result property="primaryKey" column="primaryKey"/>
<result property="orgCode" column="orgCode"/>
<result property="orgName" column="orgName"/>
<result property="type" column="type"/>
<result property="descr" column="descr"/>
<result property="createBy" column="createBy"/>
@ -24,9 +22,7 @@
<select id="pageList" resultMap="asyncResultMap">
select
f.id as id,
f.primary_key as primaryKey,
f.org_code as orgCode,
f.org_name as orgName,
f.type as type,
f.descr as descr,
f.create_by as createBy,
@ -40,16 +36,10 @@
from nu_async_main f
left join nu_async_status z on f.id = z.pkid
<where>
<if test="records !=null and !records.isEmpty()">
f.id in
<foreach collection="records" item="am" separator="," open="(" close=")">
<foreach collection="pojo" item="am" separator="," open="(" close=")">
#{am.id}
</foreach>
</if>
<if test="dto.primaryKey != '' and dto.primaryKey != null">
and f.primary_key = #{dto.primaryKey}
and f.status = '500'
</if>
</where>
order by f.create_time desc,z.update_time desc
</select>

View File

@ -4,7 +4,6 @@ import com.nu.modules.async.entity.AsyncMain;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
import java.util.Map;
/**
* @Description: 数据同步主表
@ -14,7 +13,5 @@ import java.util.Map;
*/
public interface IAsyncMainService extends IService<AsyncMain> {
List<AsyncMain> pageList(List<AsyncMain> records, AsyncMain dto);
Map<String,List<AsyncMain>> listByType(AsyncMain am);
List<AsyncMain> pageList(List<AsyncMain> records);
}

View File

@ -1,21 +1,13 @@
package com.nu.modules.async.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.collect.Maps;
import com.nu.enums.MQStatus;
import com.nu.modules.async.entity.AsyncMain;
import com.nu.modules.async.mapper.AsyncMainMapper;
import com.nu.modules.async.service.IAsyncMainService;
import org.apache.commons.compress.utils.Lists;
import org.jeecg.common.system.api.ISysBaseAPI;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
import java.util.Map;
/**
* @Description: 数据同步主表
@ -26,48 +18,8 @@ import java.util.Map;
@Service
public class AsyncMainServiceImpl extends ServiceImpl<AsyncMainMapper, AsyncMain> implements IAsyncMainService {
@Autowired
private ISysBaseAPI sysBaseAPI;
@Override
public List<AsyncMain> pageList(List<AsyncMain> records, AsyncMain dto) {
return baseMapper.pageList(records, dto);
}
@Override
public Map<String, List<AsyncMain>> listByType(AsyncMain am) {
Map<String, List<AsyncMain>> result = Maps.newHashMap();
List<AsyncMain> errorList = Lists.newArrayList();
List<AsyncMain> processingList = Lists.newArrayList();
List<AsyncMain> successList = Lists.newArrayList();
List<JSONObject> depts = sysBaseAPI.queryOpeDept();
QueryWrapper<AsyncMain> asyncMainQueryWrapper = new QueryWrapper<>();
asyncMainQueryWrapper.eq("primary_key", am.getPrimaryKey());
asyncMainQueryWrapper.orderByAsc("org_code");
List<AsyncMain> asyncMains = baseMapper.selectList(asyncMainQueryWrapper);
if (asyncMains != null && !asyncMains.isEmpty()) {
asyncMains.stream().forEach(a -> {
if ((MQStatus.SUCCESS.getCode() + "").equals(a.getStatus())) {
successList.add(a);
} else {
errorList.add(a);
}
depts.removeIf(dept -> a.getOrgCode().equals(dept.getString("code")));
});
}
depts.forEach(dept -> {
AsyncMain asyncMain = new AsyncMain();
asyncMain.setOrgCode(dept.getString("code"));
asyncMain.setOrgName(dept.getString("name"));
asyncMain.setDescr("同步中/待同步");
processingList.add(asyncMain);
});
result.put("errorList", errorList);
result.put("processingList", processingList);
result.put("successList", successList);
return result;
public List<AsyncMain> pageList(List<AsyncMain> records) {
return baseMapper.pageList(records);
}
}

View File

@ -113,9 +113,8 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
*/
@PostMapping("/async")
public Result<String> async(@RequestBody DirectiveMQDto dto) {
// List<DictModel> dicts = sysBaseAPI.getDictItems("mq_org_queue");
// String queue = dicts.stream().filter(d -> d.getValue().equals(dto.getOrgCode())).findFirst().map(DictModel::getText).orElse(null);
String queue = dto.getOrgCode() + ".fwzl.async";
List<DictModel> dicts = sysBaseAPI.getDictItems("mq_org_queue");
String queue = dicts.stream().filter(d -> d.getValue().equals(dto.getOrgCode())).findFirst().map(DictModel::getText).orElse(null);
if (StringUtils.isNotBlank(queue)) {
//先在数据同步表中插入数据
AsyncMain asyncMain = new AsyncMain();
@ -168,4 +167,5 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
}
}

View File

@ -9,10 +9,6 @@ import com.nu.modules.async.service.IAsyncMainService;
import com.nu.modules.async.service.IAsyncStatusService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.compress.utils.Lists;
import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@ -28,14 +24,16 @@ public class DirectiveMQListener {
@Autowired
private IAsyncStatusService asyncStatusService;
@RabbitListener(
bindings = @QueueBinding(
value = @Queue(name = "fwzl.async.result"),
exchange = @Exchange(name = "hldy.fwzl", type = ExchangeTypes.DIRECT),
key = "fwzl.async.result"
),
errorHandler = "directiveMQErrorHandler"
)
@RabbitListener(queues = "nu001.fwzl.status", errorHandler = "directiveMQErrorHandler")
public void handleNu001AsyncMessageStatus(StatusMQDto dto) {
try {
System.out.println("接收到了消息:" + dto.getStatus() + "消息体:" + dto.getMessage());
} catch (Exception e) {
System.out.println("异常了:" + e.getMessage());
}
}
@RabbitListener(queues = "nu002.fwzl.status", errorHandler = "directiveMQErrorHandler")
public void handleNu002AsyncMessageStatus(StatusMQDto dto) {
LambdaQueryWrapper<AsyncStatus> qw = new LambdaQueryWrapper<>();
qw.eq(AsyncStatus::getPkid, dto.getAsyncId());

View File

@ -544,9 +544,4 @@ public interface ISysBaseAPI extends CommonAPI {
*/
boolean dictTableWhiteListCheckByDict(String tableOrDictCode, String... fields);
/**
* 查询各业务机构 编码名称
*
*/
List<JSONObject> queryOpeDept();
}

View File

@ -25,12 +25,6 @@
<artifactId>hibernate-re</artifactId>
</dependency>
<dependency>
<groupId>com.nursingunit.boot</groupId>
<artifactId>nursing-unit-common</artifactId>
<version>${nursingunit.version}</version>
</dependency>
<!-- 企业微信/钉钉 api -->
<dependency>
<groupId>org.jeecgframework</groupId>

View File

@ -792,10 +792,4 @@ public class SysDictController {
sysDictService.editDictByLowAppId(sysDictVo);
return Result.ok("编辑成功");
}
@PostMapping("/async")
public Result<String> async(@RequestBody SysDict sysDict){
sysDictService.async(sysDict);
return Result.ok();
}
}

View File

@ -300,6 +300,4 @@ public interface ISysDictService extends IService<SysDict> {
* @param ids
*/
boolean removeLogicDeleted(List<String> ids);
void async(SysDict sysDict);
}

View File

@ -1,6 +1,5 @@
package org.jeecg.modules.system.service.impl;
import cn.hutool.core.collection.ListUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
@ -11,9 +10,6 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.base.Joiner;
import com.google.common.collect.Maps;
import org.apache.commons.compress.utils.Lists;
import org.apache.commons.lang3.ArrayUtils;
import org.jeecg.common.system.api.ISysBaseAPI;
import org.jeecg.modules.message.entity.SysMessageTemplate;
import org.jeecg.modules.message.handle.impl.DdSendMsgHandle;
@ -87,9 +83,7 @@ import java.util.stream.Collectors;
@Slf4j
@Service
public class SysBaseApiImpl implements ISysBaseAPI {
/**
* 当前系统数据库类型
*/
/** 当前系统数据库类型 */
private static String DB_TYPE = "";
@Autowired
@ -656,7 +650,6 @@ public class SysBaseApiImpl implements ISysBaseAPI {
/**
* 获取数据库类型
*
* @param dataSource
* @return
* @throws SQLException
@ -890,7 +883,6 @@ public class SysBaseApiImpl implements ISysBaseAPI {
/**
* 推送签到人员信息
*
* @param userId
*/
@Override
@ -967,7 +959,6 @@ public class SysBaseApiImpl implements ISysBaseAPI {
/**
* 判断用户的部门是否满足条件 -等于/不等于/--/不在--/为空/不为空
* QQYUN-5326简流获取组织人员 / 筛选条件 没有部门筛选
*
* @param departCondition
* @param departIds
* @return
@ -1119,7 +1110,6 @@ public class SysBaseApiImpl implements ISysBaseAPI {
/**
* 查询用户拥有的角色集合
*
* @param username
* @return
*/
@ -1134,7 +1124,6 @@ public class SysBaseApiImpl implements ISysBaseAPI {
/**
* 查询用户拥有的角色集合
*
* @param useId
* @return
*/
@ -1148,7 +1137,6 @@ public class SysBaseApiImpl implements ISysBaseAPI {
/**
* 查询用户拥有的权限集合
*
* @param userId
* @return
*/
@ -1180,7 +1168,6 @@ public class SysBaseApiImpl implements ISysBaseAPI {
/**
* 判断online菜单是否有权限
*
* @param onlineAuthDTO
* @return
*/
@ -1222,7 +1209,6 @@ public class SysBaseApiImpl implements ISysBaseAPI {
/**
* 查询用户拥有的角色集合 common api 里面的接口实现
*
* @param username
* @return
*/
@ -1238,7 +1224,6 @@ public class SysBaseApiImpl implements ISysBaseAPI {
/**
* 查询用户拥有的权限集合 common api 里面的接口实现
*
* @param userId
* @return
*/
@ -1249,7 +1234,6 @@ public class SysBaseApiImpl implements ISysBaseAPI {
/**
* 36根据多个用户账号(逗号分隔)查询返回多个用户信息
*
* @param usernames
* @return
*/
@ -1269,7 +1253,6 @@ public class SysBaseApiImpl implements ISysBaseAPI {
/**
* 37根据多个部门编码(逗号分隔)查询返回多个部门信息
*
* @param orgCodes
* @return
*/
@ -1289,7 +1272,6 @@ public class SysBaseApiImpl implements ISysBaseAPI {
/**
* 发消息
*
* @param fromUser
* @param toUser
* @param title
@ -1336,7 +1318,6 @@ public class SysBaseApiImpl implements ISysBaseAPI {
/**
* 发消息 带业务参数
*
* @param fromUser
* @param toUser
* @param title
@ -1388,7 +1369,6 @@ public class SysBaseApiImpl implements ISysBaseAPI {
/**
* 发送邮件消息
*
* @param email
* @param title
* @param content
@ -1401,7 +1381,6 @@ public class SysBaseApiImpl implements ISysBaseAPI {
/**
* 发送html模版邮件消息
*
* @param email
* @param title
* @param emailTemplateEnum
@ -1438,7 +1417,6 @@ public class SysBaseApiImpl implements ISysBaseAPI {
/**
* 获取公司下级部门和所有用户id信息
*
* @param orgCode
* @return
*/
@ -1761,13 +1739,11 @@ public class SysBaseApiImpl implements ISysBaseAPI {
}
//update-begin-author:taoyan date:2023-2-21 for: 解决参数顺序问题
/**
* 获取带参数的报表地址因为多个参数可能顺序会变所以要将参数顺序重排获取所有可能的地址集合
* 如下参数顺序调整使用in查询就能查询出菜单数据
* /online/cgreport/1624393012494286850?name=1&age=16
* /online/cgreport/1624393012494286850?age=16&name=1
*
* @param path
* @return
*/
@ -1796,7 +1772,6 @@ public class SysBaseApiImpl implements ISysBaseAPI {
/**
* 获取数组元素的 不同排列 a(n,m)
*
* @param list
* @return
*/
@ -1853,22 +1828,4 @@ public class SysBaseApiImpl implements ISysBaseAPI {
}
}
@Override
public List<JSONObject> queryOpeDept() {
QueryWrapper<SysDepart> qw = new QueryWrapper<>();
qw.eq("org_category", "1");
qw.eq("del_flag","0");
List<SysDepart> list = sysDepartService.list(qw);
List<JSONObject> result = Lists.newArrayList();
if (list != null && !list.isEmpty()) {
list.stream().forEach(d -> {
Map<String, Object> map = Maps.newHashMap();
map.put("code",d.getOrgCode());
map.put("name",d.getDepartName());
result.add(new JSONObject(map));
});
}
return result;
}
}

View File

@ -1,19 +1,12 @@
package org.jeecg.modules.system.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.RandomUtil;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Lists;
import com.nu.dto.SysDictItemMQDto;
import com.nu.dto.SysDictMQDto;
import com.nu.modules.async.entity.AsyncMain;
import com.nu.modules.async.service.IAsyncMainService;
import com.nu.utils.RabbitMQUtil;
import org.jeecg.modules.system.security.DictQueryBlackListHandler;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
@ -73,11 +66,6 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
private SysDictItemMapper sysDictItemMapper;
@Autowired
private DictQueryBlackListHandler dictQueryBlackListHandler;
@Autowired
private RabbitMQUtil rabbitMQUtil;
@Lazy
@Autowired
private IAsyncMainService asyncMainService;
@Lazy
@Autowired
@ -906,21 +894,6 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
return line > 0;
}
@Override
public void async(SysDict sysDict) {
QueryWrapper<AsyncMain> asyncMainQueryWrapper = new QueryWrapper<>();
asyncMainQueryWrapper.eq("primary_key",sysDict.getId());
asyncMainService.remove(asyncMainQueryWrapper);
SysDict sd = baseMapper.selectById(sysDict.getId());
List<SysDictItem> sysDictItems = sysDictItemMapper.selectItemsByMainId(sysDict.getId());
SysDictMQDto sysDictMQDto = new SysDictMQDto();
BeanUtils.copyProperties(sd,sysDictMQDto);
sysDictMQDto.setSysDictItemList(BeanUtil.copyToList(sysDictItems, SysDictItemMQDto.class));
rabbitMQUtil.sendToExchange("hldy.sysdict.fanout","",sysDictMQDto);
}
/**
* 添加字典
*

View File

@ -1,28 +0,0 @@
package com.nu.mq.directive.exceptionhandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.AmqpRejectAndDontRequeueException;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.listener.api.RabbitListenerErrorHandler;
import org.springframework.amqp.rabbit.support.ListenerExecutionFailedException;
import org.springframework.stereotype.Component;
@Slf4j
@Component("dictMQErrorHandler")
public class DictMQExceptionHandler implements RabbitListenerErrorHandler {
@Override
public Object handleError(Message message, org.springframework.messaging.Message<?> message1, ListenerExecutionFailedException e) {
log.error("MQ消息处理失败 | 消息体: {} | 异常原因: {}", new String(message.getBody()), e.getCause().getMessage());
// 根据异常类型选择处理策略
// if (isRetryable(e)) {
// // 可重试异常抛出异常触发重试
// throw e;
// } else {
// 不可恢复异常拒绝消息且不重新入队
throw new AmqpRejectAndDontRequeueException("消息处理失败且禁止重试", e);
// }
}
}

View File

@ -1,29 +0,0 @@
package org.jeecg.mq.dict.listener;
import com.nu.dto.StatusMQDto;
import com.nu.modules.async.entity.AsyncMain;
import com.nu.modules.async.service.IAsyncMainService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Slf4j
@Component
public class DictMQListener {
@Autowired
private IAsyncMainService asyncMainService;
@RabbitListener(queues = "sysdict.async.result", errorHandler = "dictMQErrorHandler")
public void handleMessage(StatusMQDto dto) {
AsyncMain asyncMain = new AsyncMain();
asyncMain.setPrimaryKey(dto.getDictId());
asyncMain.setStatus(dto.getStatus()+"");
asyncMain.setOrgCode(dto.getOrgCode());
asyncMain.setOrgName(dto.getOrgName());
asyncMain.setDescr(dto.getMessage());
asyncMainService.save(asyncMain);
}
}

View File

@ -186,12 +186,6 @@ spring:
host: redis
port: 6379
password: uUgrUus4JAYuwxzo
rabbitmq:
host: rabbitm
prot: 5672
username: hldy
password: SJ+lhRn6nZ43KeXE
virtual-host: /hldy
#mybatis plus 设置
mybatis-plus:
mapper-locations: classpath*:org/jeecg/**/xml/*Mapper.xml,classpath*:com/nu/**/xml/*Mapper.xml