parent
96c0d4a944
commit
5d5956f44d
|
@ -6,5 +6,8 @@ import java.util.List;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class DirectiveMQDto {
|
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>
|
<artifactId>nursing-unit-common</artifactId>
|
||||||
<version>${nursingunit.version}</version>
|
<version>${nursingunit.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
<dependency>
|
||||||
|
<groupId>com.nursingunit.boot</groupId>
|
||||||
|
<artifactId>nu-system-local-api</artifactId>
|
||||||
|
<version>2.0.0</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.nu.dto.DirectiveMQDto;
|
import com.nu.dto.DirectiveMQDto;
|
||||||
import com.nu.modules.directivetag.entity.DirectiveTag;
|
|
||||||
import com.nu.modules.servicedirective.entity.ConfigServiceDirective;
|
import com.nu.modules.servicedirective.entity.ConfigServiceDirective;
|
||||||
import com.nu.modules.servicedirective.service.IConfigServiceDirectiveService;
|
import com.nu.modules.servicedirective.service.IConfigServiceDirectiveService;
|
||||||
import com.nu.utils.RabbitMQUtil;
|
import com.nu.utils.RabbitMQUtil;
|
||||||
|
@ -17,16 +16,21 @@ import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
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.base.controller.JeecgController;
|
||||||
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;
|
||||||
|
import org.jeecg.common.system.vo.DictModel;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
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;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -44,6 +48,8 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
||||||
private IConfigServiceDirectiveService configServiceDirectiveService;
|
private IConfigServiceDirectiveService configServiceDirectiveService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private RabbitMQUtil rabbitMQUtil;
|
private RabbitMQUtil rabbitMQUtil;
|
||||||
|
@Autowired
|
||||||
|
private ISysBaseAPI sysBaseAPI;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页列表查询
|
* 分页列表查询
|
||||||
|
@ -58,7 +64,7 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
||||||
@ApiOperation(value = "服务指令-分页列表查询", notes = "服务指令-分页列表查询")
|
@ApiOperation(value = "服务指令-分页列表查询", notes = "服务指令-分页列表查询")
|
||||||
@GetMapping(value = "/list")
|
@GetMapping(value = "/list")
|
||||||
@DS("#dataSourceCode")
|
@DS("#dataSourceCode")
|
||||||
public Result<IPage<ConfigServiceDirective>> queryPageList(String dataSourceCode,ConfigServiceDirective configServiceDirective,
|
public Result<IPage<ConfigServiceDirective>> queryPageList(String dataSourceCode, ConfigServiceDirective configServiceDirective,
|
||||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||||
HttpServletRequest req) {
|
HttpServletRequest req) {
|
||||||
|
@ -67,14 +73,6 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
||||||
pageNo = -1;
|
pageNo = -1;
|
||||||
pageSize = -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<>();
|
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
||||||
// 自定义多选的查询规则为:LIKE_WITH_OR
|
// 自定义多选的查询规则为:LIKE_WITH_OR
|
||||||
customeRuleMap.put("categoryId", QueryRuleEnum.LIKE_WITH_OR);
|
customeRuleMap.put("categoryId", QueryRuleEnum.LIKE_WITH_OR);
|
||||||
|
@ -102,6 +100,25 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
||||||
return Result.OK(list);
|
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,17 +169,17 @@ spring:
|
||||||
slow-sql-millis: 5000
|
slow-sql-millis: 5000
|
||||||
datasource:
|
datasource:
|
||||||
master:
|
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
|
# url: jdbc:mysql://localhost:3306/nursing_unit_001?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||||
username: root
|
username: nu_sys
|
||||||
password: root
|
password: nu_sys
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
# 多数据源配置
|
# 多数据源配置
|
||||||
#multi-datasource1:
|
# 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
|
# username: root
|
||||||
#password: root
|
# password: root
|
||||||
#driver-class-name: com.mysql.cj.jdbc.Driver
|
# driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
#redis 配置
|
#redis 配置
|
||||||
redis:
|
redis:
|
||||||
database: 0
|
database: 0
|
||||||
|
|
Loading…
Reference in New Issue