parent
96c0d4a944
commit
5d5956f44d
|
@ -6,5 +6,8 @@ import java.util.List;
|
|||
|
||||
@Data
|
||||
public class DirectiveMQDto {
|
||||
List<String> ids;
|
||||
private boolean izInc;//是否为增量 否则为全量
|
||||
private String orgCode;//机构编码
|
||||
private String idStr;
|
||||
private List<String> idList;
|
||||
}
|
||||
|
|
|
@ -43,6 +43,12 @@
|
|||
<artifactId>nursing-unit-common</artifactId>
|
||||
<version>${nursingunit.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nu-system-local-api</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nu.dto.DirectiveMQDto;
|
||||
import com.nu.modules.directivetag.entity.DirectiveTag;
|
||||
import com.nu.modules.servicedirective.entity.ConfigServiceDirective;
|
||||
import com.nu.modules.servicedirective.service.IConfigServiceDirectiveService;
|
||||
import com.nu.utils.RabbitMQUtil;
|
||||
|
@ -17,16 +16,21 @@ import org.apache.commons.lang.StringUtils;
|
|||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
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.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
@ -44,6 +48,8 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
|||
private IConfigServiceDirectiveService configServiceDirectiveService;
|
||||
@Autowired
|
||||
private RabbitMQUtil rabbitMQUtil;
|
||||
@Autowired
|
||||
private ISysBaseAPI sysBaseAPI;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
|
@ -67,14 +73,6 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
|||
pageNo = -1;
|
||||
pageSize = -1;
|
||||
}
|
||||
|
||||
DirectiveMQDto directiveMQDto = new DirectiveMQDto();
|
||||
List<String> ids = Lists.newArrayList();
|
||||
ids.add("aaa");
|
||||
ids.add("bbb");
|
||||
ids.add("ccc");
|
||||
directiveMQDto.setIds(ids);
|
||||
rabbitMQUtil.sendToExchange("hldy.fwzl", "nu001.fwzl.async", directiveMQDto);
|
||||
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
||||
// 自定义多选的查询规则为:LIKE_WITH_OR
|
||||
customeRuleMap.put("categoryId", QueryRuleEnum.LIKE_WITH_OR);
|
||||
|
@ -102,6 +100,25 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
|||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务指令数据同步
|
||||
* 未到运营时间时为全量 否则只能增量
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@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);
|
||||
if (StringUtils.isNotBlank(queue)) {
|
||||
rabbitMQUtil.sendToExchange("hldy.fwzl", queue, dto);
|
||||
}else{
|
||||
return Result.error("机构未配置MQ映射关系,需先在数据字典(mq_org_queue)中添加相应对应数据!");
|
||||
}
|
||||
return Result.ok("");
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
|
|
|
@ -169,14 +169,14 @@ spring:
|
|||
slow-sql-millis: 5000
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:mysql://1.92.152.160:33061/nursing_unit?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||
url: jdbc:mysql://192.168.2.199:3306/nursing_unit?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||
# url: jdbc:mysql://localhost:3306/nursing_unit_001?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: root
|
||||
username: nu_sys
|
||||
password: nu_sys
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
# 多数据源配置
|
||||
# multi-datasource1:
|
||||
#url: jdbc:mysql://localhost:3306/jeecg-boot2?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||
# url: jdbc:mysql://1.92.152.160:33061/nursing_unit?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||
# username: root
|
||||
# password: root
|
||||
# driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
|
|
Loading…
Reference in New Issue