修改baseservice的collection<?>类型

segment2.0
linrf 2 years ago
parent 1919a573cb
commit eb08b033de

@ -16,6 +16,7 @@ import org.springframework.retry.annotation.EnableRetry;
@SpringBootApplication(scanBasePackages = {"com.docus"}) @SpringBootApplication(scanBasePackages = {"com.docus"})
@EnableRetry @EnableRetry
@EnableTrackGroup @EnableTrackGroup
//@EnableRabbit
public class AppRunBootstrap { public class AppRunBootstrap {
public static void main(String[] args) { public static void main(String[] args) {
System.setProperty("javax.xml.parsers.DocumentBuilderFactory", "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl"); System.setProperty("javax.xml.parsers.DocumentBuilderFactory", "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl");

@ -23,6 +23,8 @@ import com.docus.server.collect.web.utils.RedisMq;
import com.docus.server.collect.web.utils.SpringRestTemplateUtils; import com.docus.server.collect.web.utils.SpringRestTemplateUtils;
import com.docus.server.common.message.MqMessage; import com.docus.server.common.message.MqMessage;
import com.docus.server.common.util.SpringUtils; import com.docus.server.common.util.SpringUtils;
import com.docus.server.record.common.pojo.entity.TBasic;
import com.docus.server.record.service.ITBasicService;
import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -62,6 +64,8 @@ public abstract class BaseViewJobResultImpl implements IJobResult<List<Map<Strin
private RedisMq redisMq; private RedisMq redisMq;
@Resource @Resource
private IAfViewCollectionLogService afViewCollectionLogService; private IAfViewCollectionLogService afViewCollectionLogService;
@Resource
private ITBasicService basicService;
private String jzhkey = "FVISIT_ID"; private String jzhkey = "FVISIT_ID";
private String syscodekey = "SYS_CODE"; private String syscodekey = "SYS_CODE";
@ -449,20 +453,26 @@ public abstract class BaseViewJobResultImpl implements IJobResult<List<Map<Strin
* @return * @return
*/ */
private List<Map<String, Object>> getBasicForZYHs(List<String> zyhs) { private List<Map<String, Object>> getBasicForZYHs(List<String> zyhs) {
List<Map<String, Object>> datas = new ArrayList<>();
String url = String.format("http://localhost:%s", getPort());
String requstParam = JSON.toJSONString(zyhs);
String sendPost = SpringRestTemplateUtils.getInstance().sendPost(url + "/api/conllection/getBasicForZYHs", requstParam, MediaType.APPLICATION_JSON, null, true);
ObjectMapper objectMapper = new ObjectMapper();
try {
datas = objectMapper.readValue(sendPost, new TypeReference<List<Map<String, Object>>>() {
});
} catch (Exception ex) {
log.error("解析失败:" + sendPost);
return null;
}
return datas; List<TBasic> tBasics = basicService.findByList("inpatientNo", zyhs);
String s = com.docus.core.util.json.JSON.toJSON(tBasics);
return com.docus.core.util.json.JSON.fromJSONWithGeneric(s, new TypeReference<List<Map<String, Object>>>() {
});
// List<Map<String, Object>> datas = new ArrayList<>();
// String url = String.format("http://localhost:%s", getPort());
// String requstParam = JSON.toJSONString(zyhs);
// String sendPost = SpringRestTemplateUtils.getInstance().sendPost(url + "/api/conllection/getBasicForZYHs", requstParam, MediaType.APPLICATION_JSON, null, true);
// ObjectMapper objectMapper = new ObjectMapper();
// try {
// datas = objectMapper.readValue(sendPost, new TypeReference<List<Map<String, Object>>>() {
// });
// } catch (Exception ex) {
// log.error("解析失败:" + sendPost);
// return null;
// }
//
// return datas;
} }
/** /**

@ -30,13 +30,4 @@ public class Invoker {
return this.command.execute(messageData); return this.command.execute(messageData);
} }
public static void main(String[] args) {
Invoker invoker = new Invoker();
invoker.setCommand(new AbstractCommand() {
@Override
public HandleResult execute(MessageData messageData) {
return null;
}
});
}
} }

@ -15,7 +15,7 @@ public interface IBaseService<T> extends IService<T> {
List<T> findBy(String propertyName, Object propertyValue); List<T> findBy(String propertyName, Object propertyValue);
List<T> findByList(String propertyName, Collection<Object> propertyValue); List<T> findByList(String propertyName, Collection<?> propertyValue);
List<T> findActiveBy(String propertyName, Object propertyValue); List<T> findActiveBy(String propertyName, Object propertyValue);
@ -25,7 +25,7 @@ public interface IBaseService<T> extends IService<T> {
T findOneBy(String propertyName, Object propertyValue); T findOneBy(String propertyName, Object propertyValue);
T findOneByList(String propertyName, Collection<Object> propertyValue); T findOneByList(String propertyName, Collection<?> propertyValue);
T findActiveOneBy(String propertyName, Object propertyValue); T findActiveOneBy(String propertyName, Object propertyValue);

@ -11,7 +11,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.docus.server.common.service.IBaseService; import com.docus.server.common.service.IBaseService;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.util.*; import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Objects;
public abstract class BaseServiceImpl<M extends BaseMapper<T>, T> extends ServiceImpl<M, T> implements IBaseService<T> { public abstract class BaseServiceImpl<M extends BaseMapper<T>, T> extends ServiceImpl<M, T> implements IBaseService<T> {
@ -44,7 +48,7 @@ public abstract class BaseServiceImpl<M extends BaseMapper<T>, T> extends Servic
* , in * , in
*/ */
@Override @Override
public List<T> findByList(String propertyName, Collection<Object> propertyValue) { public List<T> findByList(String propertyName, Collection<?> propertyValue) {
String columnName = getColumnName(propertyName); String columnName = getColumnName(propertyName);
return baseMapper.selectList(new QueryWrapper<T>().in(!Objects.isNull(propertyValue), columnName, propertyValue)); return baseMapper.selectList(new QueryWrapper<T>().in(!Objects.isNull(propertyValue), columnName, propertyValue));
} }
@ -86,7 +90,7 @@ public abstract class BaseServiceImpl<M extends BaseMapper<T>, T> extends Servic
} }
@Override @Override
public T findOneByList(String propertyName, Collection<Object> propertyValue) { public T findOneByList(String propertyName, Collection<?> propertyValue) {
String columnName = getColumnName(propertyName); String columnName = getColumnName(propertyName);
List<T> list = baseMapper.selectList(new QueryWrapper<T>().eq(!Objects.isNull(propertyValue), columnName, propertyValue)); List<T> list = baseMapper.selectList(new QueryWrapper<T>().eq(!Objects.isNull(propertyValue), columnName, propertyValue));
return (list == null || list.size() == 0) ? null : list.get(0); return (list == null || list.size() == 0) ? null : list.get(0);

@ -1,5 +1,6 @@
package com.docus.server.record.common.pojo.entity; package com.docus.server.record.common.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@ -30,6 +31,7 @@ public class TBasic implements Serializable {
private Integer admissTimes; private Integer admissTimes;
@ApiModelProperty(value = "病案号") @ApiModelProperty(value = "病案号")
@TableField("inpatientNo")
private String inpatientNo; private String inpatientNo;
@ApiModelProperty(value = "住院ID号") @ApiModelProperty(value = "住院ID号")

Loading…
Cancel
Save