编写basic http和view同步和jms mq 同步

segment2.0
linrf 2 years ago
parent 5e59ed431c
commit 2caaf31014

@ -9,7 +9,7 @@ import java.util.Map;
public class WsResultImpl implements IWsResult { public class WsResultImpl implements IWsResult {
@Override @Override
public String ok(Map<String,String> params) { public String ok(Map<String, Object> params) {
return null; return null;
} }

@ -0,0 +1,20 @@
package com.docus.server.collect.basic;
import com.docus.server.collect.service.IHttpTBasicCollectService;
import com.docus.server.record.pojo.dto.TBasicDTO;
import com.google.common.collect.Lists;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
@Service
public class HttpTBasicCollectServiceImpl implements IHttpTBasicCollectService {
@Override
public List<TBasicDTO> getTBasics(Date startDate, Date endDate, long pageNum, long pageSize) {
TBasicDTO deptDTO = new TBasicDTO();
TBasicDTO deptDTO1 = new TBasicDTO();
return Lists.newArrayList(deptDTO, deptDTO1);
}
}

@ -1,7 +1,7 @@
package com.docus.server.collect.dept; package com.docus.server.collect.dept;
import com.docus.server.collect.service.IHttpTBasicCollectService; import com.docus.server.collect.service.IHttpDeptCollectService;
import com.docus.server.sys.pojo.dto.DeptDTO; import com.docus.server.sys.common.pojo.dto.DeptDTO;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -9,7 +9,7 @@ import java.util.Date;
import java.util.List; import java.util.List;
@Service @Service
public class HttpDeptCollectServiceImpl implements IHttpTBasicCollectService { public class HttpDeptCollectServiceImpl implements IHttpDeptCollectService {
@Override @Override
public List<DeptDTO> getDepts(Date startDate, Date endDate, long pageNum, long pageSize) { public List<DeptDTO> getDepts(Date startDate, Date endDate, long pageNum, long pageSize) {
DeptDTO deptDTO = new DeptDTO(); DeptDTO deptDTO = new DeptDTO();

@ -0,0 +1,78 @@
package com.docus.server.collect.dept;
import com.docus.core.util.XmlUtil;
import com.docus.server.collect.mq.dept.AbstractDeptMqCollectService;
import com.docus.server.sys.common.pojo.dto.DeptDTO;
import org.springframework.stereotype.Service;
import org.w3c.dom.Node;
@Service
public class JmsIbmMqDeptCollectServiceImpl extends AbstractDeptMqCollectService {
/**
*
*
* @param message
*/
//@JmsIbmListener(destination = "TJ_createDepartment")
@Override
public void addDept(String message) {
super.addDept(message);
}
/**
*
*
* @param message
*/
//@JmsIbmListener(destination = "TJ_updateDepartment")
@Override
public void updateDept(String message) {
super.updateDept(message);
}
/**
* ,
*
* @param xml
* @return
*/
@Override
public DeptDTO parseAddDeptXml(String xml) {
XmlUtil xmlParseUtil = XmlUtil.of(xml);
Node deptCodeNode = xmlParseUtil.getNode("/PRPM_IN401030UV01/controlActProcess/subject/registrationRequest/subject1/assignedEntity/id/item/@extension");
Node deptNameNode = xmlParseUtil.getNode("/PRPM_IN401030UV01/controlActProcess/subject/registrationRequest/subject1/assignedEntity/assignedPrincipalOrganization/name/item[@use='OR']/part/@value");
Node authorIdNode = xmlParseUtil.getNode("/PRPM_IN401030UV01/controlActProcess/subject/registrationRequest/author/assignedEntity/id/item/@extension");
Node authorNameNode = xmlParseUtil.getNode("/PRPM_IN401030UV01/controlActProcess/subject/registrationRequest/author/assignedEntity/assignedPerson/name/item/part/@value");
DeptDTO deptDto = new DeptDTO();
deptDto.setDeptCode(deptCodeNode.getNodeValue());
deptDto.setDeptName(deptNameNode.getNodeValue());
deptDto.setAuthorId(authorIdNode.getNodeValue());
deptDto.setAuthorName(authorNameNode.getNodeValue());
return deptDto;
}
/**
* ,
*
* @param xml
* @return
*/
@Override
public DeptDTO parseUpdateDeptXml(String xml) {
XmlUtil xmlParseUtil = XmlUtil.of(xml);
Node deptCodeNode = xmlParseUtil.getNode("/PRPM_IN403010UV01/controlActProcess/subject/registrationRequest/subject1/assignedEntity/id/item/@extension");
Node deptNameNode = xmlParseUtil.getNode("/PRPM_IN403010UV01/controlActProcess/subject/registrationRequest/subject1/assignedEntity/assignedPrincipalOrganization/name/item[@use='OR']/part/@value");
Node authorIdNode = xmlParseUtil.getNode("/PRPM_IN403010UV01/controlActProcess/subject/registrationRequest/author/assignedEntity/id/item/@extension");
Node authorNameNode = xmlParseUtil.getNode("/PRPM_IN403010UV01/controlActProcess/subject/registrationRequest/author/assignedEntity/assignedPerson/name/item/part/@value");
DeptDTO deptDto = new DeptDTO();
deptDto.setDeptCode(deptCodeNode.getNodeValue());
deptDto.setDeptName(deptNameNode.getNodeValue());
deptDto.setAuthorId(authorIdNode.getNodeValue());
deptDto.setAuthorName(authorNameNode.getNodeValue());
return deptDto;
}
}

@ -1,9 +1,11 @@
package com.docus.server.collect.medical.record; package com.docus.server.collect.medical.record;
import com.docus.core.util.XmlUtil;
import com.docus.server.collect.service.IParseService; import com.docus.server.collect.service.IParseService;
import com.docus.server.record.pojo.entity.MedicalRecord; import com.docus.server.record.pojo.entity.MedicalRecord;
import com.docus.server.sys.service.Dept; import com.docus.server.sys.common.pojo.dto.DeptDTO;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.w3c.dom.Node;
@Service @Service
public class ParseServiceImpl implements IParseService { public class ParseServiceImpl implements IParseService {
@ -15,9 +17,32 @@ public class ParseServiceImpl implements IParseService {
} }
/**
* / webservice
*
* @param deptXml
* @return
*/
@Override @Override
public Dept parseDeptXml(String deptXml) { public DeptDTO parseDeptXml(String deptXml) {
//TODO 根据协议进行解析。 //TODO 根据协议进行解析。
return null; XmlUtil xmlParseUtil = XmlUtil.of(deptXml);
Node msgIdNode = xmlParseUtil.getNode("/PRVS_IN000002UV01/id/@extension");
Node receiverNode = xmlParseUtil.getNode("/PRVS_IN000002UV01/receiver/device/id/item/@extension");
Node operateTypeNode = xmlParseUtil.getNode("/PRVS_IN000002UV01/controlActProcess/subject/registrationRequest/subject1/valueSet/valueSetItems/@operateType");
Node deptCodeNode = xmlParseUtil.getNode("/PRVS_IN000002UV01/controlActProcess/subject/registrationRequest/subject1/valueSet/valueSetItems/DEPT_CODE/@value");
Node deptNameNode = xmlParseUtil.getNode("/PRVS_IN000002UV01/controlActProcess/subject/registrationRequest/subject1/valueSet/valueSetItems/DEPT_NAME/@value");
Node authorIdNode = xmlParseUtil.getNode("/PRVS_IN000002UV01/controlActProcess/subject/registrationRequest/author/assignedEntity/id/item/@extension");
Node authorNameNode = xmlParseUtil.getNode("/PRVS_IN000002UV01/controlActProcess/subject/registrationRequest/author/assignedEntity/assignedPerson/name/item/part/@value");
DeptDTO deptDto = new DeptDTO();
deptDto.setMessageId(msgIdNode.getNodeValue());
deptDto.setReceiver(receiverNode.getNodeValue());
deptDto.setOperateType(operateTypeNode.getNodeValue());
deptDto.setDeptCode(deptCodeNode.getNodeValue());
deptDto.setDeptName(deptNameNode.getNodeValue());
deptDto.setAuthorId(authorIdNode.getNodeValue());
deptDto.setAuthorName(authorNameNode.getNodeValue());
return deptDto;
} }
} }

@ -1,7 +1,7 @@
package com.docus.server.collect.user; package com.docus.server.collect.user;
import com.docus.server.collect.service.IHttpUserCollectService; import com.docus.server.collect.service.IHttpUserCollectService;
import com.docus.server.sys.pojo.dto.UserDTO; import com.docus.server.sys.common.pojo.dto.UserDTO;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;

@ -0,0 +1,88 @@
package com.docus.server.collect.user;
import com.docus.core.util.XmlUtil;
import com.docus.server.collect.mq.user.AbstractUserMqCollectService;
import com.docus.server.sys.common.pojo.dto.UserDTO;
import org.springframework.stereotype.Service;
import org.w3c.dom.Node;
@Service
public class JmsIbmMqUserCollectServiceImpl extends AbstractUserMqCollectService {
/**
*
*
* @param message
*/
//@JmsIbmListener(destination = "TJ_createPractitioner")
@Override
public void addUser(String message) {
super.addUser(message);
}
/**
*
*
* @param message
*/
//@JmsIbmListener(destination = "TJ_updatePractitioner")
@Override
public void updateUser(String message) {
super.updateUser(message);
}
/**
* ,
*
* @param xml
* @return
*/
@Override
public UserDTO parseAddUserXml(String xml) {
XmlUtil xmlParseUtil = XmlUtil.of(xml);
Node employeeCodeNode = xmlParseUtil.getNode("/PRPM_IN301010UV01/controlActProcess/subject/registrationRequest/subject1/healthCareProvider/id/item/@extension");
Node employeeNameNode = xmlParseUtil.getNode("/PRPM_IN301010UV01/controlActProcess/subject/registrationRequest/subject1/healthCareProvider/healthCarePrincipalPerson/name/item[@use='OR']/part/@value");
Node deptCodeNode = xmlParseUtil.getNode("/PRPM_IN301010UV01/controlActProcess/subject/registrationRequest/subject1/healthCareProvider/healthCarePrincipalPerson/asAffiliate/affiliatedPrincipalOrganization/id/item/@extension");
Node positionNode = xmlParseUtil.getNode("/PRPM_IN301010UV01/controlActProcess/subject/registrationRequest/subject1/healthCareProvider/relatedTo/assignedEntity/relatedTo/assignedEntity/code[@codeSystem='2.16.156.10011.0.9.2.3.2.122']/displayName/@value");
Node authorIdNode = xmlParseUtil.getNode("/PRPM_IN301010UV01/controlActProcess/subject/registrationRequest/author/assignedEntity/id/item/@extension");
Node authorNameNode = xmlParseUtil.getNode("/PRPM_IN301010UV01/controlActProcess/subject/registrationRequest/author/assignedEntity/assignedPerson/name/item/part/@value");
UserDTO userDto = new UserDTO();
userDto.setDeptId(deptCodeNode.getNodeValue());
userDto.setUserName(employeeCodeNode.getNodeValue());
userDto.setName(employeeNameNode.getNodeValue());
userDto.setPosition(positionNode.getNodeValue());
userDto.setAuthorId(authorIdNode.getNodeValue());
userDto.setAuthorName(authorNameNode.getNodeValue());
userDto.setRoleId(0L);
return userDto;
}
/**
* ,
*
* @param xml
* @return
*/
@Override
public UserDTO parseUpdateUserXml(String xml) {
XmlUtil xmlParseUtil = XmlUtil.of(xml);
Node employeeCodeNode = xmlParseUtil.getNode("/PRPM_IN303010UV01/controlActProcess/subject/registrationRequest/subject1/healthCareProvider/id/item/@extension");
Node employeeNameNode = xmlParseUtil.getNode("/PRPM_IN303010UV01/controlActProcess/subject/registrationRequest/subject1/healthCareProvider/healthCarePrincipalPerson/name/item[@use='OR']/part/@value");
Node deptCodeNode = xmlParseUtil.getNode("/PRPM_IN303010UV01/controlActProcess/subject/registrationRequest/subject1/healthCareProvider/healthCarePrincipalPerson/asAffiliate/affiliatedPrincipalOrganization/id/item/@extension");
Node positionNode = xmlParseUtil.getNode("/PRPM_IN303010UV01/controlActProcess/subject/registrationRequest/subject1/healthCareProvider/relatedTo/assignedEntity/relatedTo/assignedEntity/code[@codeSystem='2.16.156.10011.0.9.2.3.2.122']/displayName/@value");
Node authorIdNode = xmlParseUtil.getNode("/PRPM_IN303010UV01/controlActProcess/subject/registrationRequest/author/assignedEntity/id/item/@extension");
Node authorNameNode = xmlParseUtil.getNode("/PRPM_IN303010UV01/controlActProcess/subject/registrationRequest/author/assignedEntity/assignedPerson/name/item/part/@value");
UserDTO userDto = new UserDTO();
userDto.setDeptId(deptCodeNode.getNodeValue());
userDto.setUserName(employeeCodeNode.getNodeValue());
userDto.setName(employeeNameNode.getNodeValue());
userDto.setPosition(positionNode.getNodeValue());
userDto.setAuthorId(authorIdNode.getNodeValue());
userDto.setAuthorName(authorNameNode.getNodeValue());
userDto.setRoleId(0L);
return userDto;
}
}

@ -12,19 +12,21 @@ spring:
datasource: datasource:
master: master:
url: jdbc:log4jdbc:mysql://db.docus.cn:3306/docus_archivefile?autoReconnect=true&allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai url: jdbc:log4jdbc:mysql://db.docus.cn:3306/docus_archivefile?autoReconnect=true&allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
username: root username: docus
password: root password: docus702
driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource
his: his:
url: jdbc:log4jdbc:mysql://127.0.0.1:3306/his?autoReconnect=true&allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai url: jdbc:log4jdbc:mysql://db.docus.cn:3306/docus_archivefile?autoReconnect=true&allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
username: root username: docus
password: root password: docus702
driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource
redis: redis:
host: redis.docus.cn host: redis.docus.cn
# password: JSdocus@702 password: JSdocus@702
cloud: cloud:
nacos: nacos:
discovery: discovery:
@ -37,6 +39,7 @@ spring:
shared-configs: shared-configs:
- comm.${spring.cloud.nacos.config.file-extension} - comm.${spring.cloud.nacos.config.file-extension}
docus: docus:
dbtype: mysql dbtype: mysql
@ -44,33 +47,34 @@ mybatis-plus:
configuration: configuration:
map-underscore-to-camel-case: true map-underscore-to-camel-case: true
call-setters-on-nulls: true call-setters-on-nulls: true
jdbc-type-for-null: null
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
global-config: global-config:
db-config: db-config:
update-strategy: ignored
field-strategy: NOT_EMPTY field-strategy: NOT_EMPTY
db-type: MYSQL db-type: MYSQL
mapper-locations: classpath*:/mapper/*Mapper.xml
xxl: xxl:
job: job:
accessToken: accessToken:
admin: admin:
addresses: http://job.docus.cn:8180/xxl-job-admin addresses: http://job.docus.cn:8180/xxl-job-admin
executor: executor:
appname: xxl-job-executor-test appname: docus-inspection
address: address:
ip: ip:
port: 17781 port: 17781
logretentiondays: 30 logretentiondays: 30
logpath: D:/xxl-job/inspection logpath: D:/xxl-job/inspection
api: #
soft-delete-column-name=state #ibm:
soft-delete-column-value=1 # mq:
logging: # queueManager: MqManager01
level: # channel: chl_server01
com: # connName: 10.222.23.130(1414)
baomidou: # ackUrl: 10.222.23.159:7800/ack
mybatisplus: DEBUG # domain: CDR
# key: cdr-0012-adef
# replica:
# queueManager: MqManager02
# channel: chl_server02
# connName: 10.222.23.131(1414)

@ -4,10 +4,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.docus.server.collect.domain.TaskConfig; import com.docus.server.collect.domain.TaskConfig;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
/**
* @Author : linrf
* @create 2023/5/30 9:11
*/
@Mapper @Mapper
public interface TaskConfigMapper extends BaseMapper<TaskConfig> { public interface TaskConfigMapper extends BaseMapper<TaskConfig> {
} }

@ -3,8 +3,8 @@ package com.docus.server.collect.job.basic;
import com.docus.core.util.Func; import com.docus.core.util.Func;
import com.docus.server.collect.domain.TaskConfig; import com.docus.server.collect.domain.TaskConfig;
import com.docus.server.collect.service.ITaskConfigService; import com.docus.server.collect.service.ITaskConfigService;
import com.docus.server.sys.pojo.dto.TBasicDTO; import com.docus.server.record.pojo.dto.TBasicDTO;
import com.docus.server.sys.service.ITBasicService; import com.docus.server.record.service.ITBasicService;
import com.docus.server.tool.PeriodTime; import com.docus.server.tool.PeriodTime;
import com.xxl.job.core.context.XxlJobHelper; import com.xxl.job.core.context.XxlJobHelper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -32,7 +32,7 @@ public abstract class AbstractTBasicCollectJob {
List<PeriodTime> periodTimes = taskConfig.getAllPeriodTimes(); List<PeriodTime> periodTimes = taskConfig.getAllPeriodTimes();
for (PeriodTime periodTime : periodTimes) { for (PeriodTime periodTime : periodTimes) {
doGetDepts(periodTime, taskConfig); getTBasic(periodTime, taskConfig);
taskConfigService.updateAllPointerDate(taskConfigId, periodTime.getPeriodEndDate()); taskConfigService.updateAllPointerDate(taskConfigId, periodTime.getPeriodEndDate());
} }
} }
@ -45,7 +45,7 @@ public abstract class AbstractTBasicCollectJob {
List<PeriodTime> periodTimes = taskConfig.getIncPeriodTimes(); List<PeriodTime> periodTimes = taskConfig.getIncPeriodTimes();
periodTimes.forEach(periodTime -> { periodTimes.forEach(periodTime -> {
doGetDepts(periodTime, taskConfig); getTBasic(periodTime, taskConfig);
taskConfigService.updateIncPointerDate(taskConfigId, periodTime.getPeriodEndDate()); taskConfigService.updateIncPointerDate(taskConfigId, periodTime.getPeriodEndDate());
}); });
@ -61,26 +61,27 @@ public abstract class AbstractTBasicCollectJob {
* @param periodTime * @param periodTime
* @param taskConfig * @param taskConfig
*/ */
private void doGetDepts(PeriodTime periodTime, TaskConfig taskConfig) { private void getTBasic(PeriodTime periodTime, TaskConfig taskConfig) {
//考虑到性能,应该把起始时间和结束时间进行切割拆分到每天。按段查询。 //考虑到性能,应该把起始时间和结束时间进行切割拆分到每天。按段查询。
List<TBasicDTO> depts; List<TBasicDTO> basics;
int pageNum = 1; int pageNum = 1;
for (; true; pageNum++) { for (; true; pageNum++) {
depts = this.getBasics( basics = this.getTBasics(
periodTime.getPeriodStartDate(), periodTime.getPeriodStartDate(),
periodTime.getPeriodEndDate(), periodTime.getPeriodEndDate(),
pageNum, pageNum,
taskConfig.getPageSize() taskConfig.getPageSize()
); );
if (Func.isEmpty(depts)) { if (Func.isEmpty(basics)) {
break; break;
} }
basicService.batchSaveBasics(depts); //保存
basicService.batchSaveBasics(basics);
} }
} }
/** /**
* *
* *
* @param startDate * @param startDate
* @param endDate * @param endDate
@ -88,7 +89,7 @@ public abstract class AbstractTBasicCollectJob {
* @param pageSize * @param pageSize
* @return * @return
*/ */
public abstract List<TBasicDTO> getBasics(Date startDate, Date endDate, long pageNum, long pageSize); public abstract List<TBasicDTO> getTBasics(Date startDate, Date endDate, long pageNum, long pageSize);
} }

@ -2,8 +2,8 @@ package com.docus.server.collect.job.basic;
import com.docus.server.collect.service.IHttpTBasicCollectService; import com.docus.server.collect.service.IHttpTBasicCollectService;
import com.docus.server.collect.service.ITaskConfigService; import com.docus.server.collect.service.ITaskConfigService;
import com.docus.server.sys.pojo.dto.TBasicDTO; import com.docus.server.record.pojo.dto.TBasicDTO;
import com.docus.server.sys.service.ITBasicService; import com.docus.server.record.service.ITBasicService;
import com.xxl.job.core.handler.annotation.XxlJob; import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -16,17 +16,17 @@ import java.util.List;
public class TBasicHttpCollectJob extends AbstractTBasicCollectJob { public class TBasicHttpCollectJob extends AbstractTBasicCollectJob {
@Resource @Resource
private final IHttpTBasicCollectService httpDeptCollectService; private final IHttpTBasicCollectService iHttpTBasicCollectService;
public TBasicHttpCollectJob(ITBasicService deptService, ITaskConfigService taskConfigService, IHttpTBasicCollectService httpDeptCollectService) { public TBasicHttpCollectJob(ITBasicService deptService, ITaskConfigService taskConfigService, IHttpTBasicCollectService iHttpTBasicCollectService) {
super(deptService, taskConfigService); super(deptService, taskConfigService);
this.httpDeptCollectService = httpDeptCollectService; this.iHttpTBasicCollectService = iHttpTBasicCollectService;
} }
/** /**
* xxl jobhandler * xxl jobhandler
*/ */
@XxlJob("startAllDeptHttpCollect") @XxlJob("startAllTBasicHttpCollect")
public void startAllDeptHttpCollect() { public void startAllDeptHttpCollect() {
super.startCollectAll(getJobParam()); super.startCollectAll(getJobParam());
} }
@ -34,17 +34,17 @@ public class TBasicHttpCollectJob extends AbstractTBasicCollectJob {
/** /**
* xxl jobhandler * xxl jobhandler
*/ */
@XxlJob("startIncDeptHttpCollect") @XxlJob("startIncTBasicHttpCollect")
public void startIncDeptHttpCollect() { public void startIncDeptHttpCollect() {
super.startCollectIncrement(getJobParam()); super.startCollectIncrement(getJobParam());
} }
@Override @Override
public List<TBasicDTO> getBasics(Date startDate, Date endDate, long pazeNum, long pageSize) { public List<TBasicDTO> getTBasics(Date startDate, Date endDate, long pazeNum, long pageSize) {
//需要根据不同医院去解析不同的内容。使用接口实现的方式。 //需要根据不同医院去解析不同的内容。使用接口实现的方式。
return httpDeptCollectService.getDepts(startDate, endDate, pazeNum, pageSize); return iHttpTBasicCollectService.getTBasics(startDate, endDate, pazeNum, pageSize);
} }
} }

@ -2,8 +2,8 @@ package com.docus.server.collect.job.basic;
import com.docus.server.collect.service.ITaskConfigService; import com.docus.server.collect.service.ITaskConfigService;
import com.docus.server.his.service.IHisService; import com.docus.server.his.service.IHisService;
import com.docus.server.sys.pojo.dto.DeptDTO; import com.docus.server.record.pojo.dto.TBasicDTO;
import com.docus.server.sys.service.ITBasicService; import com.docus.server.record.service.ITBasicService;
import com.xxl.job.core.handler.annotation.XxlJob; import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -24,7 +24,7 @@ public class TBasicViewCollectJob extends AbstractTBasicCollectJob {
/** /**
* xxl jobhandler * xxl jobhandler
*/ */
@XxlJob("startAllDeptViewCollect") @XxlJob("startAllTBasicViewCollect")
public void startAllDeptViewCollect() { public void startAllDeptViewCollect() {
super.startCollectAll(getJobParam()); super.startCollectAll(getJobParam());
} }
@ -33,17 +33,17 @@ public class TBasicViewCollectJob extends AbstractTBasicCollectJob {
/** /**
* xxl jobhandler * xxl jobhandler
*/ */
@XxlJob("startIncDeptViewCollect") @XxlJob("startIncTBasicViewCollect")
public void startIncDeptViewCollect() { public void startIncDeptViewCollect() {
super.startCollectIncrement(getJobParam()); super.startCollectIncrement(getJobParam());
} }
@Override @Override
public List<DeptDTO> getBasics(Date startDate, Date endDate, long pageNum, long pageSize) { public List<TBasicDTO> getTBasics(Date startDate, Date endDate, long pageNum, long pageSize) {
//每家医院按照固定的格式写sql不同医院需要替换不同的sql即可。 //每家医院按照固定的格式写sql不同医院需要替换不同的sql即可。
return hisService.getDeptListView(startDate, endDate, pageNum, pageSize); return hisService.getTBasicListView(startDate, endDate, pageNum, pageSize);
} }
} }

@ -1,10 +1,10 @@
package com.docus.server.collect.job.dept; package com.docus.server.collect.job.dept;
import com.docus.core.util.Func; import com.docus.core.util.Func;
import com.docus.server.collect.service.ITaskConfigService;
import com.docus.server.collect.domain.TaskConfig; import com.docus.server.collect.domain.TaskConfig;
import com.docus.server.sys.pojo.dto.DeptDTO; import com.docus.server.collect.service.ITaskConfigService;
import com.docus.server.sys.service.ITBasicService; import com.docus.server.sys.common.pojo.dto.DeptDTO;
import com.docus.server.sys.service.IPowerDeptService;
import com.docus.server.tool.PeriodTime; import com.docus.server.tool.PeriodTime;
import com.xxl.job.core.context.XxlJobHelper; import com.xxl.job.core.context.XxlJobHelper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -15,11 +15,11 @@ import java.util.List;
public abstract class AbstractDeptCollectJob { public abstract class AbstractDeptCollectJob {
@Autowired @Autowired
private final ITBasicService deptService; private final IPowerDeptService deptService;
@Resource @Resource
private final ITaskConfigService taskConfigService; private final ITaskConfigService taskConfigService;
protected AbstractDeptCollectJob(ITBasicService deptService, ITaskConfigService taskConfigService) { protected AbstractDeptCollectJob(IPowerDeptService deptService, ITaskConfigService taskConfigService) {
this.deptService = deptService; this.deptService = deptService;
this.taskConfigService = taskConfigService; this.taskConfigService = taskConfigService;
} }
@ -67,15 +67,15 @@ public abstract class AbstractDeptCollectJob {
int pageNum = 1; int pageNum = 1;
for (; true; pageNum++) { for (; true; pageNum++) {
depts = this.getDepts( depts = this.getDepts(
periodTime.getPeriodStartDate(), periodTime.getPeriodStartDate(),
periodTime.getPeriodEndDate(), periodTime.getPeriodEndDate(),
pageNum, pageNum,
taskConfig.getPageSize() taskConfig.getPageSize()
); );
if (Func.isEmpty(depts)) { if (Func.isEmpty(depts)) {
break; break;
} }
deptService.batchSaveBasics(depts); deptService.batchSaveOrUpdatePowerDept(depts);
} }
} }

@ -1,9 +1,9 @@
package com.docus.server.collect.job.dept; package com.docus.server.collect.job.dept;
import com.docus.server.collect.service.IHttpDeptCollectService;
import com.docus.server.collect.service.ITaskConfigService; import com.docus.server.collect.service.ITaskConfigService;
import com.docus.server.collect.service.IHttpTBasicCollectService; import com.docus.server.sys.common.pojo.dto.DeptDTO;
import com.docus.server.sys.pojo.dto.DeptDTO; import com.docus.server.sys.service.IPowerDeptService;
import com.docus.server.sys.service.ITBasicService;
import com.xxl.job.core.handler.annotation.XxlJob; import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -16,9 +16,9 @@ import java.util.List;
public class DeptHttpCollectJob extends AbstractDeptCollectJob { public class DeptHttpCollectJob extends AbstractDeptCollectJob {
@Resource @Resource
private final IHttpTBasicCollectService httpDeptCollectService; private final IHttpDeptCollectService httpDeptCollectService;
public DeptHttpCollectJob(ITBasicService deptService, ITaskConfigService taskConfigService, IHttpTBasicCollectService httpDeptCollectService) { public DeptHttpCollectJob(IPowerDeptService deptService, ITaskConfigService taskConfigService, IHttpDeptCollectService httpDeptCollectService) {
super(deptService, taskConfigService); super(deptService, taskConfigService);
this.httpDeptCollectService = httpDeptCollectService; this.httpDeptCollectService = httpDeptCollectService;
} }

@ -2,8 +2,8 @@ package com.docus.server.collect.job.dept;
import com.docus.server.collect.service.ITaskConfigService; import com.docus.server.collect.service.ITaskConfigService;
import com.docus.server.his.service.IHisService; import com.docus.server.his.service.IHisService;
import com.docus.server.sys.pojo.dto.DeptDTO; import com.docus.server.sys.common.pojo.dto.DeptDTO;
import com.docus.server.sys.service.ITBasicService; import com.docus.server.sys.service.IPowerDeptService;
import com.xxl.job.core.handler.annotation.XxlJob; import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -16,7 +16,7 @@ public class DeptViewCollectJob extends AbstractDeptCollectJob {
@Resource @Resource
private final IHisService hisService; private final IHisService hisService;
protected DeptViewCollectJob(ITBasicService deptService, ITaskConfigService taskConfigService, IHisService hisService) { protected DeptViewCollectJob(IPowerDeptService deptService, ITaskConfigService taskConfigService, IHisService hisService) {
super(deptService, taskConfigService); super(deptService, taskConfigService);
this.hisService = hisService; this.hisService = hisService;
} }

@ -3,7 +3,7 @@ package com.docus.server.collect.job.user;
import com.docus.core.util.Func; import com.docus.core.util.Func;
import com.docus.server.collect.domain.TaskConfig; import com.docus.server.collect.domain.TaskConfig;
import com.docus.server.collect.service.ITaskConfigService; import com.docus.server.collect.service.ITaskConfigService;
import com.docus.server.sys.pojo.dto.UserDTO; import com.docus.server.sys.common.pojo.dto.UserDTO;
import com.docus.server.sys.service.IPowerUserService; import com.docus.server.sys.service.IPowerUserService;
import com.docus.server.tool.PeriodTime; import com.docus.server.tool.PeriodTime;
import com.xxl.job.core.context.XxlJobHelper; import com.xxl.job.core.context.XxlJobHelper;
@ -67,20 +67,20 @@ public abstract class AbstractUserCollectJob {
int pageNum = 1; int pageNum = 1;
for (; true; pageNum++) { for (; true; pageNum++) {
users = this.getUsers( users = this.getUsers(
periodTime.getPeriodStartDate(), periodTime.getPeriodStartDate(),
periodTime.getPeriodEndDate(), periodTime.getPeriodEndDate(),
pageNum, pageNum,
taskConfig.getPageSize() taskConfig.getPageSize()
); );
if (Func.isEmpty(users)) { if (Func.isEmpty(users)) {
break; break;
} }
userService.batchSavePowerUser(users); userService.batchSaveOrUpdatePowerUser(users);
} }
} }
/** /**
* *
* *
* @param startDate * @param startDate
* @param endDate * @param endDate

@ -2,7 +2,7 @@ package com.docus.server.collect.job.user;
import com.docus.server.collect.service.IHttpUserCollectService; import com.docus.server.collect.service.IHttpUserCollectService;
import com.docus.server.collect.service.ITaskConfigService; import com.docus.server.collect.service.ITaskConfigService;
import com.docus.server.sys.pojo.dto.UserDTO; import com.docus.server.sys.common.pojo.dto.UserDTO;
import com.docus.server.sys.service.IPowerUserService; import com.docus.server.sys.service.IPowerUserService;
import com.xxl.job.core.handler.annotation.XxlJob; import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -26,7 +26,7 @@ public class UserHttpCollectJob extends AbstractUserCollectJob {
/** /**
* xxl jobhandler * xxl jobhandler
*/ */
@XxlJob("startAllDeptHttpCollect") @XxlJob("startAllUserHttpCollect")
public void startAllDeptHttpCollect() { public void startAllDeptHttpCollect() {
super.startCollectAll(getJobParam()); super.startCollectAll(getJobParam());
} }
@ -34,7 +34,7 @@ public class UserHttpCollectJob extends AbstractUserCollectJob {
/** /**
* xxl jobhandler * xxl jobhandler
*/ */
@XxlJob("startIncDeptHttpCollect") @XxlJob("startIncUserHttpCollect")
public void startIncDeptHttpCollect() { public void startIncDeptHttpCollect() {
super.startCollectIncrement(getJobParam()); super.startCollectIncrement(getJobParam());
} }

@ -2,7 +2,7 @@ package com.docus.server.collect.job.user;
import com.docus.server.collect.service.ITaskConfigService; import com.docus.server.collect.service.ITaskConfigService;
import com.docus.server.his.service.IHisService; import com.docus.server.his.service.IHisService;
import com.docus.server.sys.pojo.dto.UserDTO; import com.docus.server.sys.common.pojo.dto.UserDTO;
import com.docus.server.sys.service.IPowerUserService; import com.docus.server.sys.service.IPowerUserService;
import com.xxl.job.core.handler.annotation.XxlJob; import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;

@ -0,0 +1,6 @@
package com.docus.server.collect.mq;
public interface IMqCollectService {
}

@ -1,35 +0,0 @@
package com.docus.server.collect.mq;
import com.docus.server.sys.service.Dept;
import com.docus.server.sys.service.IPowerDeptService;
import com.docus.server.ws.IWsResult;
import lombok.extern.slf4j.Slf4j;
import javax.annotation.Resource;
/**
* mq
*/
@Slf4j
public class MqCollect {
@Resource
private IPowerDeptService deptService;
@Resource
private IWsResult wsResult;
public String receiveDept(String deptXml) {
log.info("收到科室消息:{}", deptXml);
try {
Dept dept = this.parseDeptXml(deptXml);
deptService.save(dept);
return wsResult.ok(dept.getParams());
} catch (Exception e) {
return wsResult.fail(e.getMessage());
}
}
public Dept parseDeptXml(String deptXml) {
return null;
}
}

@ -0,0 +1,48 @@
package com.docus.server.collect.mq.dept;
import com.docus.server.sys.common.pojo.dto.DeptDTO;
import com.docus.server.sys.service.IPowerDeptService;
import lombok.extern.slf4j.Slf4j;
import javax.annotation.Resource;
/**
* mq
*/
@Slf4j
public abstract class AbstractDeptMqCollectService implements IMqDeptCollectService {
@Resource
private IPowerDeptService deptService;
/**
*
*
* @param message
*/
@Override
public void addDept(String message) {
log.info("注册科室 队列接收信息:{}", message);
DeptDTO dept = this.parseAddDeptXml(message);
deptService.saveOrUpdatePowerDept(dept);
}
/**
*
*
* @param message
*/
@Override
public void updateDept(String message) {
log.info("变更科室 队列接收信息:{}", message);
DeptDTO deptDto = this.parseUpdateDeptXml(message);
deptService.saveOrUpdatePowerDept(deptDto);
}
protected abstract DeptDTO parseAddDeptXml(String message);
protected abstract DeptDTO parseUpdateDeptXml(String message);
}

@ -0,0 +1,21 @@
package com.docus.server.collect.mq.dept;
import com.docus.server.collect.mq.IMqCollectService;
public interface IMqDeptCollectService extends IMqCollectService {
/**
*
*
* @param message
*/
void addDept(String message);
/**
*
*
* @param message
*/
void updateDept(String message);
}

@ -0,0 +1,47 @@
package com.docus.server.collect.mq.user;
import com.docus.server.sys.common.pojo.dto.UserDTO;
import com.docus.server.sys.service.IPowerUserService;
import lombok.extern.slf4j.Slf4j;
import javax.annotation.Resource;
/**
* mq
*/
@Slf4j
public abstract class AbstractUserMqCollectService implements IMqUserCollectService {
@Resource
private IPowerUserService userService;
/**
*
*
* @param message
*/
@Override
public void addUser(String message) {
log.info("人员注册 队列接收信息:{}", message);
UserDTO userDto = this.parseAddUserXml(message);
userService.saveOrUpdatePowerUser(userDto);
}
/**
*
*
* @param message
*/
@Override
public void updateUser(String message) {
log.info("人员变更 队列接收信息:{}", message);
UserDTO userDto = this.parseUpdateUserXml(message);
userService.saveOrUpdatePowerUser(userDto);
}
protected abstract UserDTO parseAddUserXml(String message);
protected abstract UserDTO parseUpdateUserXml(String message);
}

@ -0,0 +1,24 @@
package com.docus.server.collect.mq.user;
import com.docus.server.collect.mq.IMqCollectService;
public interface IMqUserCollectService extends IMqCollectService {
/**
*
*
* @param message
*/
void addUser(String message);
/**
*
*
* @param message
*/
void updateUser(String message);
}

@ -2,7 +2,7 @@ package com.docus.server.collect.service;
import com.docus.server.collect.infrastructure.dao.ReceiveDeptInfoEntity; import com.docus.server.collect.infrastructure.dao.ReceiveDeptInfoEntity;
import com.docus.server.collect.infrastructure.mapper.ReceiveDeptInfoMapper; import com.docus.server.collect.infrastructure.mapper.ReceiveDeptInfoMapper;
import com.docus.server.sys.service.Dept; import com.docus.server.sys.common.pojo.dto.DeptDTO;
import com.docus.server.sys.service.IPowerDeptService; import com.docus.server.sys.service.IPowerDeptService;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -18,7 +18,7 @@ public class CollectService {
@Resource @Resource
private ReceiveDeptInfoMapper receiveDeptInfoMapper; private ReceiveDeptInfoMapper receiveDeptInfoMapper;
public void receiveDept(Dept dept) { public void receiveDept(DeptDTO dept) {
//判断任务是否存在。 //判断任务是否存在。
//保存数据库 //保存数据库
@ -27,7 +27,7 @@ public class CollectService {
receiveDeptInfoMapper.insert(receiveDeptInfoEntity); receiveDeptInfoMapper.insert(receiveDeptInfoEntity);
//异步写入归档系统,失败自动重试。 //异步写入归档系统,失败自动重试。
deptService.save(dept); deptService.saveOrUpdatePowerDept(dept);
} }

@ -1,10 +0,0 @@
package com.docus.server.collect.service;
import com.docus.server.sys.pojo.dto.TBasicDTO;
import java.util.Date;
import java.util.List;
public interface IHttpBasicCollectService {
List<TBasicDTO> getBasics(Date startDate, Date endDate, long pageNum, long pageSize);
}

@ -0,0 +1,10 @@
package com.docus.server.collect.service;
import com.docus.server.sys.common.pojo.dto.DeptDTO;
import java.util.Date;
import java.util.List;
public interface IHttpDeptCollectService {
List<DeptDTO> getDepts(Date startDate, Date endDate, long pageNum, long pageSize);
}

@ -1,10 +1,10 @@
package com.docus.server.collect.service; package com.docus.server.collect.service;
import com.docus.server.sys.pojo.dto.TBasicDTO; import com.docus.server.record.pojo.dto.TBasicDTO;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
public interface IHttpTBasicCollectService { public interface IHttpTBasicCollectService {
List<TBasicDTO> getDepts(Date startDate, Date endDate, long pageNum, long pageSize); List<TBasicDTO> getTBasics(Date startDate, Date endDate, long pageNum, long pageSize);
} }

@ -1,6 +1,6 @@
package com.docus.server.collect.service; package com.docus.server.collect.service;
import com.docus.server.sys.pojo.dto.UserDTO; import com.docus.server.sys.common.pojo.dto.UserDTO;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;

@ -1,10 +1,10 @@
package com.docus.server.collect.service; package com.docus.server.collect.service;
import com.docus.server.record.pojo.entity.MedicalRecord; import com.docus.server.record.pojo.entity.MedicalRecord;
import com.docus.server.sys.service.Dept; import com.docus.server.sys.common.pojo.dto.DeptDTO;
public interface IParseService { public interface IParseService {
MedicalRecord parseHandNumbness(String handNumbness); MedicalRecord parseHandNumbness(String handNumbness);
Dept parseDeptXml(String deptXml); DeptDTO parseDeptXml(String deptXml);
} }

@ -6,15 +6,73 @@ import javax.jws.WebService;
public interface IWebserviceServer { public interface IWebserviceServer {
/** /**
* xml * xml
*/ */
String receiveHandNumbness(String handNumbness); String receiveHandNumbness(String handNumbness);
/** /**
* xml * xml
*
* @param deptXml * @param deptXml
* @return * @return
*/ */
String receiveDept(String deptXml); String receiveDept(String deptXml);
/**
*
*
* @param receiveUser
* @return
*/
String deptModify(String receiveUser);
String setTBasic(String str);
String updateTBasic(String str);
/**
*
*
* @param receiveUser
* @return
*/
String userModify(String receiveUser);
/**
*
*
* @param icuReportMessage
* @return
*/
String pushICUReport(String icuReportMessage);
/**
* -
*
* @param inspectionReportMessage -
* @return
*/
String pushAddInspectionReport(String inspectionReportMessage);
/**
* -
*
* @param inspectionReportMessage -
* @return
*/
String pushUpdateInspectionReport(String inspectionReportMessage);
/**
* -
*
* @param xml -
* @return
*/
String querySdJxIndexTest(String xml);
String querySdJxIndexNoResultTest(String xml);
} }

@ -4,7 +4,7 @@ import java.util.Map;
public interface IWsResult { public interface IWsResult {
String ok(Map<String, String> params); String ok(Map<String, Object> params);
String fail(String message); String fail(String message);

@ -4,7 +4,7 @@ import com.docus.server.collect.service.CollectService;
import com.docus.server.collect.service.IParseService; import com.docus.server.collect.service.IParseService;
import com.docus.server.record.pojo.entity.MedicalRecord; import com.docus.server.record.pojo.entity.MedicalRecord;
import com.docus.server.record.service.IMedicalRecordService; import com.docus.server.record.service.IMedicalRecordService;
import com.docus.server.sys.service.Dept; import com.docus.server.sys.common.pojo.dto.DeptDTO;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -34,17 +34,16 @@ public class WsCollect {
} }
} }
public String receiveDept(String deptXml) { public String receiveDept(String deptXml) {
log.info("收到科室消息:{}", deptXml); log.info("收到科室消息:{}", deptXml);
try { try {
Dept dept = parseService.parseDeptXml(deptXml); DeptDTO dept = parseService.parseDeptXml(deptXml);
//此处需要存储原xml内容。 //此处需要存储原xml内容。
collectService.receiveDept(dept); collectService.receiveDept(dept);
return wsResult.ok(dept.getParams()); return wsResult.ok(dept.getParams());
} catch (Exception e) { } catch (Exception e) {
return wsResult.fail(e.getMessage()); return wsResult.fail(e.getMessage(), dept.getParams());
} }
} }

@ -24,4 +24,49 @@ public class WebserviceServer implements IWebserviceServer {
return wsCollect.receiveDept(deptXml); return wsCollect.receiveDept(deptXml);
} }
@Override
public String deptModify(String receiveUser) {
return null;
}
@Override
public String setTBasic(String str) {
return null;
}
@Override
public String updateTBasic(String str) {
return null;
}
@Override
public String userModify(String receiveUser) {
return null;
}
@Override
public String pushICUReport(String icuReportMessage) {
return null;
}
@Override
public String pushAddInspectionReport(String inspectionReportMessage) {
return null;
}
@Override
public String pushUpdateInspectionReport(String inspectionReportMessage) {
return null;
}
@Override
public String querySdJxIndexTest(String xml) {
return null;
}
@Override
public String querySdJxIndexNoResultTest(String xml) {
return null;
}
} }

@ -25,7 +25,8 @@ public interface TBasicMapper extends BaseMapper<TBasic> {
* @param admissTimes * @param admissTimes
* @return * @return
*/ */
String getPatientIdByInpatientNoAndAdminssTimes(@Param("inpatientNo") String inpatientNo, @Param("adminssTimes") Integer admissTimes); String getPatientIdByInpatientNoAndAdminssTimes(@Param("inpatientNo") String inpatientNo,
@Param("adminssTimes") Integer admissTimes);
Integer selectOne(@Param("jzh") String jzh); Integer selectOne(@Param("jzh") String jzh);
@ -35,11 +36,14 @@ public interface TBasicMapper extends BaseMapper<TBasic> {
Integer insertExtend(@Param("tBasicExtend") TBasicExtend tBasicExtend); Integer insertExtend(@Param("tBasicExtend") TBasicExtend tBasicExtend);
Integer update(@Param("tBasic") TBasic tBasic); Integer updateTBasic(@Param("tBasic") TBasic tBasic);
Integer updateExtend(@Param("tBasicExtend") TBasicExtend tBasicExtend); Integer updateExtend(@Param("tBasicExtend") TBasicExtend tBasicExtend);
List<TBasic> selectBasicListByAdmissDate(@Param("admissStartDate") String admissStartDate, @Param("admissEndDate") String admissEndDate, @Param("offset") int offset, @Param("size") int size); List<TBasic> selectBasicListByAdmissDate(@Param("admissStartDate") String admissStartDate,
@Param("admissEndDate") String admissEndDate,
@Param("offset") int offset,
@Param("size") int size);
/** /**
* *
@ -49,7 +53,10 @@ public interface TBasicMapper extends BaseMapper<TBasic> {
*/ */
String getSdRyIndexByPatientId(@Param("patientId") String patientId); String getSdRyIndexByPatientId(@Param("patientId") String patientId);
List<TBasic> selectBasicListByCreateOrUpdateTime(@Param("startDate") String queryBasicStartDate, @Param("endDate") String queryBasicEndDate, @Param("offset") int offset, @Param("size") int size); List<TBasic> selectBasicListByCreateOrUpdateTime(@Param("startDate") String queryBasicStartDate,
@Param("endDate") String queryBasicEndDate,
@Param("offset") int offset,
@Param("size") int size);
List<TBasic> selectBasicListByPatientIds(@Param("patientIds") List<String> patientIds); List<TBasic> selectBasicListByPatientIds(@Param("patientIds") List<String> patientIds);
} }

@ -18,12 +18,15 @@ public class TBasicDTO {
private String jzh; private String jzh;
private String inpatientNo; private String inpatientNo;
private String admissTimes; private String admissTimes;
private String name ; private String name;
private String admissDate ; private String admissDate;
private String disDate ; private String disDate;
private String admissDeptName ; private String admissDeptName;
private String disDeptName ; private String disDeptName;
private String attending;
private String attendingName; private String attendingName;
private String dutyNurse;
private String admissDept;
private String age; private String age;
private String sex; private String sex;
private String idCard; private String idCard;

@ -68,13 +68,13 @@ public class MedicalRecord {
/** /**
* *
*/ */
private Map<String, String> params; private Map<String, Object> params;
public MedicalRecord(InpatientNo inpatientNo, String jzh, Integer admisstimes, public MedicalRecord(InpatientNo inpatientNo, String jzh, Integer admisstimes,
String sysFlag, String downUrl, String fileTitle, String serialnum, String sysFlag, String downUrl, String fileTitle, String serialnum,
String assortId, String fileSource, String assortId, String fileSource,
String patientId, String sourceInfo, IdType idType, Map<String, String> params) { String patientId, String sourceInfo, IdType idType, Map<String, Object> params) {
this.inpatientNo = inpatientNo; this.inpatientNo = inpatientNo;
this.jzh = jzh; this.jzh = jzh;
this.admisstimes = admisstimes; this.admisstimes = admisstimes;

@ -153,4 +153,7 @@ public class TBasic implements Serializable {
@ApiModelProperty(value = "床位号") @ApiModelProperty(value = "床位号")
private String bedNum; private String bedNum;
@ApiModelProperty(value = "责任护士")
private String dutyNurse;
} }

@ -2,10 +2,30 @@ package com.docus.server.record.service;
import com.docus.server.record.pojo.dto.TBasicDTO; import com.docus.server.record.pojo.dto.TBasicDTO;
import java.util.List;
public interface ITBasicService { public interface ITBasicService {
public void setTBasic(TBasicDTO dto) throws Exception; /**
*
*
* @param dto
* @throws Exception
*/
void addTBasic(TBasicDTO dto) throws Exception;
public void updateTBasic(TBasicDTO dto) throws Exception; /**
*
*
* @param dto
* @throws Exception
*/
void updateTBasic(TBasicDTO dto) throws Exception;
/**
*
*
* @param basicDTOList
*/
void batchSaveBasics(List<TBasicDTO> basicDTOList);
} }

@ -3,10 +3,10 @@ package com.docus.server.record.service.impl;
import com.docus.server.record.pojo.dto.IdType; import com.docus.server.record.pojo.dto.IdType;
import com.docus.server.record.pojo.entity.MedicalRecord; import com.docus.server.record.pojo.entity.MedicalRecord;
import com.docus.server.record.service.IMedicalRecordService; import com.docus.server.record.service.IMedicalRecordService;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Service;
@Component @Service
public class MedicalRecordService implements IMedicalRecordService { public class MedicalRecordServiceImpl implements IMedicalRecordService {
@Override @Override
public void receive(MedicalRecord medicalRecord) { public void receive(MedicalRecord medicalRecord) {

@ -15,6 +15,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Date; import java.util.Date;
import java.util.List;
@Service @Service
public class TBasicServiceImpl extends ServiceImpl<TBasicMapper, TBasic> implements ITBasicService { public class TBasicServiceImpl extends ServiceImpl<TBasicMapper, TBasic> implements ITBasicService {
@ -27,7 +28,7 @@ public class TBasicServiceImpl extends ServiceImpl<TBasicMapper, TBasic> impleme
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void setTBasic(TBasicDTO tBasicDTO) throws Exception { public void addTBasic(TBasicDTO tBasicDTO) {
//判断jzh是否重复 //判断jzh是否重复
Integer num = tBasicMapper.selectOne(tBasicDTO.getJzh()); Integer num = tBasicMapper.selectOne(tBasicDTO.getJzh());
if (num > 0) { if (num > 0) {
@ -85,6 +86,10 @@ public class TBasicServiceImpl extends ServiceImpl<TBasicMapper, TBasic> impleme
tBasic.setAdmissDeptName(tBasicDTO.getAdmissDeptName()); tBasic.setAdmissDeptName(tBasicDTO.getAdmissDeptName());
tBasic.setDisDeptName(tBasicDTO.getDisDeptName()); tBasic.setDisDeptName(tBasicDTO.getDisDeptName());
tBasic.setAttendingName(tBasicDTO.getAttendingName()); tBasic.setAttendingName(tBasicDTO.getAttendingName());
tBasic.setAttending(tBasicDTO.getAttending());
tBasic.setDutyNurse(tBasicDTO.getDutyNurse());
tBasic.setAdmissDept(tBasicDTO.getAdmissDept());
tBasic.setCreateTime(DateUtil.now());
tBasic.setAge(age); tBasic.setAge(age);
tBasic.setSex(tBasicDTO.getSex()); tBasic.setSex(tBasicDTO.getSex());
tBasic.setIdCard(tBasicDTO.getIdCard()); tBasic.setIdCard(tBasicDTO.getIdCard());
@ -101,19 +106,20 @@ public class TBasicServiceImpl extends ServiceImpl<TBasicMapper, TBasic> impleme
tBasicExtend.setSdryIndex(tBasicDTO.getSdryIndex()); tBasicExtend.setSdryIndex(tBasicDTO.getSdryIndex());
//持久化 //持久化
tBasicMapper.insert(tBasic); tBasicMapper.insertTBasic(tBasic);
tBasicMapper.insertExtend(tBasicExtend); tBasicMapper.insertExtend(tBasicExtend);
} }
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void updateTBasic(TBasicDTO tBasicDTO) throws Exception { public void updateTBasic(TBasicDTO tBasicDTO) {
//判断jzh是否存在 //判断jzh是否存在
String patientId = tBasicMapper.getPatientId(tBasicDTO.getJzh()); String patientId = tBasicMapper.getPatientId(tBasicDTO.getJzh());
if (Func.isEmpty(patientId)) { if (Func.isEmpty(patientId)) {
setTBasic(tBasicDTO); addTBasic(tBasicDTO);
return; return;
} }
//数据类型转化,格式处理 //数据类型转化,格式处理
Date admissDate = null; Date admissDate = null;
if (Func.isNotEmpty(tBasicDTO.getAdmissDate())) { if (Func.isNotEmpty(tBasicDTO.getAdmissDate())) {
@ -172,6 +178,10 @@ public class TBasicServiceImpl extends ServiceImpl<TBasicMapper, TBasic> impleme
tBasic.setBedNum(tBasicDTO.getBedNum()); tBasic.setBedNum(tBasicDTO.getBedNum());
tBasic.setAdmissDays(admissDays); tBasic.setAdmissDays(admissDays);
tBasic.setIsDead(isDead); tBasic.setIsDead(isDead);
tBasic.setAttending(tBasicDTO.getAttending());
tBasic.setDutyNurse(tBasicDTO.getDutyNurse());
tBasic.setAdmissDept(tBasicDTO.getAdmissDept());
tBasic.setCreateTime(DateUtil.now());
TBasicExtend tBasicExtend = new TBasicExtend(); TBasicExtend tBasicExtend = new TBasicExtend();
tBasicExtend.setPatientId(patientId); tBasicExtend.setPatientId(patientId);
@ -180,9 +190,19 @@ public class TBasicServiceImpl extends ServiceImpl<TBasicMapper, TBasic> impleme
tBasicExtend.setSdryIndex(tBasicDTO.getSdryIndex()); tBasicExtend.setSdryIndex(tBasicDTO.getSdryIndex());
//持久化 //持久化
tBasicMapper.update(tBasic); tBasicMapper.updateTBasic(tBasic);
tBasicMapper.updateExtend(tBasicExtend); tBasicMapper.updateExtend(tBasicExtend);
} }
private void convert() {
}
@Transactional(rollbackFor = Exception.class)
@Override
public void batchSaveBasics(List<TBasicDTO> basicDTOList) {
basicDTOList.forEach(this::updateTBasic);
}
} }

@ -28,7 +28,7 @@
(#{tBasicExtend.patientId},#{tBasicExtend.wardCode},#{tBasicExtend.wardName},#{tBasicExtend.sdryIndex}) (#{tBasicExtend.patientId},#{tBasicExtend.wardCode},#{tBasicExtend.wardName},#{tBasicExtend.sdryIndex})
</insert> </insert>
<update id="update"> <update id="updateTBasic">
UPDATE `docus_medicalrecord`.`t_basic` UPDATE `docus_medicalrecord`.`t_basic`
<set> <set>
<if test="tBasic.admissDays !=null "> <if test="tBasic.admissDays !=null ">

@ -1,7 +1,10 @@
package com.docus.server.sys.pojo.dto; package com.docus.server.sys.common.pojo.dto;
import lombok.Data; import lombok.Data;
import java.util.HashMap;
import java.util.Map;
/** /**
* @author Fang Ruichuan * @author Fang Ruichuan
* @date 2022-11-14 19:02 * @date 2022-11-14 19:02
@ -58,4 +61,20 @@ public class DeptDTO {
deptModifyParam.setAuthorId(this.authorId); deptModifyParam.setAuthorId(this.authorId);
return deptModifyParam; return deptModifyParam;
} }
/**
*
*/
private Map<String, Object> params;
public Object getParams(String key) {
return params != null ? params.get(key) : null;
}
public void setParams(String key, Object value) {
if (this.params == null) {
this.params = new HashMap<>();
}
this.params.put(key, value);
}
} }

@ -1,4 +1,4 @@
package com.docus.server.sys.pojo.dto; package com.docus.server.sys.common.pojo.dto;
import lombok.Data; import lombok.Data;

@ -1,4 +1,4 @@
package com.docus.server.sys.pojo.dto; package com.docus.server.sys.common.pojo.dto;
import lombok.Data; import lombok.Data;

@ -1,4 +1,4 @@
package com.docus.server.sys.pojo.dto; package com.docus.server.sys.common.pojo.dto;
import lombok.Data; import lombok.Data;

@ -1,4 +1,4 @@
package com.docus.server.sys.pojo.entity; package com.docus.server.sys.common.pojo.entity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;

@ -1,4 +1,4 @@
package com.docus.server.sys.pojo.entity; package com.docus.server.sys.common.pojo.entity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;

@ -1,18 +0,0 @@
package com.docus.server.sys.infrastructure.dao;
import com.docus.server.sys.service.Dept;
import org.springframework.stereotype.Component;
@Component
public class DeptDao implements IDeptDao {
@Override
public void save(Dept dept) {
}
@Override
public Dept getDept(String code) {
return null;
}
}

@ -1,13 +0,0 @@
package com.docus.server.sys.infrastructure.dao;
import com.docus.server.sys.service.Dept;
public interface IDeptDao {
public void save(Dept dept);
public Dept getDept(String code);
}

@ -1,8 +1,8 @@
package com.docus.server.sys.mapper; package com.docus.server.sys.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.docus.server.sys.pojo.dto.DeptModifyParam; import com.docus.server.sys.common.pojo.dto.DeptModifyParam;
import com.docus.server.sys.pojo.entity.PowerDept; import com.docus.server.sys.common.pojo.entity.PowerDept;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;

@ -1,8 +1,8 @@
package com.docus.server.sys.mapper; package com.docus.server.sys.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.docus.server.sys.pojo.dto.UserModifyParam; import com.docus.server.sys.common.pojo.dto.UserModifyParam;
import com.docus.server.sys.pojo.entity.PowerUser; import com.docus.server.sys.common.pojo.entity.PowerUser;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;

@ -1,38 +0,0 @@
package com.docus.server.sys.pojo.dto;
import lombok.Data;
/**
* @BelongsProject: docus-webservice-sdry
* @BelongsPackage: com.docus.server.collection.webservice
* @Author: chierhao
* @CreateTime: 2023-02-25 14:44
* @Description: TODO
* @Version: 1.0
*/
@Data
public class TBasicDTO {
private String serialId;
private String receive;
private String send;
private String jzh;
private String inpatientNo;
private String admissTimes;
private String name ;
private String admissDate ;
private String disDate ;
private String admissDeptName ;
private String disDeptName ;
private String attendingName;
private String age;
private String sex;
private String idCard;
private String disDept;
private String sexName;
private String bedNum;
private String isDead;
private String admissDays;
private String wardCode;
private String wardName;
private String sdryIndex;
}

@ -1,24 +0,0 @@
package com.docus.server.sys.service;
import lombok.Data;
import java.util.Date;
import java.util.Map;
@Data
public class Dept {
private String deptCode;
private String deptName;
private Date dataUpdateTime;
private String source;
/**
*
*/
private Map<String, String> params;
}

@ -1,6 +1,6 @@
package com.docus.server.sys.service; package com.docus.server.sys.service;
import com.docus.server.sys.pojo.dto.DeptDTO; import com.docus.server.sys.common.pojo.dto.DeptDTO;
import java.util.List; import java.util.List;
@ -12,7 +12,7 @@ public interface IPowerDeptService {
* @param deptDto * @param deptDto
* @return * @return
*/ */
boolean register(DeptDTO deptDto); boolean saveOrUpdatePowerDept(DeptDTO deptDto);
/** /**
* *
@ -22,5 +22,10 @@ public interface IPowerDeptService {
*/ */
boolean delDeptByDeptCode(String deptCode); boolean delDeptByDeptCode(String deptCode);
void batchSavePowerDept(List<DeptDTO> deptDTOList); /**
*
*
* @param deptDTOList
*/
void batchSaveOrUpdatePowerDept(List<DeptDTO> deptDTOList);
} }

@ -1,6 +1,6 @@
package com.docus.server.sys.service; package com.docus.server.sys.service;
import com.docus.server.sys.pojo.dto.UserDTO; import com.docus.server.sys.common.pojo.dto.UserDTO;
import java.util.List; import java.util.List;
@ -14,7 +14,7 @@ public interface IPowerUserService {
* @param userDTO * @param userDTO
* @return * @return
*/ */
boolean register(UserDTO userDTO); boolean saveOrUpdatePowerUser(UserDTO userDTO);
/** /**
* *
@ -29,5 +29,5 @@ public interface IPowerUserService {
* *
* @param users * @param users
*/ */
void batchSavePowerUser(List<UserDTO> users); void batchSaveOrUpdatePowerUser(List<UserDTO> users);
} }

@ -1,34 +0,0 @@
package com.docus.server.sys.service;
import com.docus.server.sys.pojo.dto.TBasicDTO;
import java.util.List;
/**
*
*/
public interface ITBasicService {
/**
*
*
* @param deptDTOList
* @return
*/
void batchSaveBasics(List<TBasicDTO> deptDTOList);
/**
*
*
* @param deptDTO
* @return
*/
boolean register(TBasicDTO deptDTO);
/**
*
*
* @param deptCode
* @return
*/
boolean delDeptByDeptCode(String deptCode);
}

@ -3,10 +3,10 @@ package com.docus.server.sys.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.docus.core.util.Func; import com.docus.core.util.Func;
import com.docus.infrastructure.redis.service.IdService; import com.docus.infrastructure.redis.service.IdService;
import com.docus.server.sys.common.pojo.dto.DeptDTO;
import com.docus.server.sys.common.pojo.dto.DeptModifyParam;
import com.docus.server.sys.common.pojo.entity.PowerDept;
import com.docus.server.sys.mapper.PowerDeptMapper; import com.docus.server.sys.mapper.PowerDeptMapper;
import com.docus.server.sys.pojo.dto.DeptDTO;
import com.docus.server.sys.pojo.dto.DeptModifyParam;
import com.docus.server.sys.pojo.entity.PowerDept;
import com.docus.server.sys.service.IPowerDeptService; import com.docus.server.sys.service.IPowerDeptService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -24,12 +24,12 @@ public class PowerDeptServiceImpl extends ServiceImpl<PowerDeptMapper, PowerDept
private IdService idService; private IdService idService;
@Override @Override
public void batchSavePowerDept(List<DeptDTO> deptDTOList) { public void batchSaveOrUpdatePowerDept(List<DeptDTO> deptDTOList) {
deptDTOList.forEach(this::register); deptDTOList.forEach(this::saveOrUpdatePowerDept);
} }
@Override @Override
public boolean register(DeptDTO deptDTO) { public boolean saveOrUpdatePowerDept(DeptDTO deptDTO) {
PowerDept powerDept = baseMapper.getDeptByDeptCode(deptDTO.getDeptCode()); PowerDept powerDept = baseMapper.getDeptByDeptCode(deptDTO.getDeptCode());
DeptModifyParam deptModifyParam = deptDTO.transDeptAddParam(); DeptModifyParam deptModifyParam = deptDTO.transDeptAddParam();
if (Func.isEmpty(powerDept)) { if (Func.isEmpty(powerDept)) {

@ -5,9 +5,9 @@ import com.docus.core.util.Func;
import com.docus.infrastructure.redis.service.IdService; import com.docus.infrastructure.redis.service.IdService;
import com.docus.server.sys.common.UserProperties; import com.docus.server.sys.common.UserProperties;
import com.docus.server.sys.mapper.PowerUserMapper; import com.docus.server.sys.mapper.PowerUserMapper;
import com.docus.server.sys.pojo.dto.UserDTO; import com.docus.server.sys.common.pojo.dto.UserDTO;
import com.docus.server.sys.pojo.dto.UserModifyParam; import com.docus.server.sys.common.pojo.dto.UserModifyParam;
import com.docus.server.sys.pojo.entity.PowerUser; import com.docus.server.sys.common.pojo.entity.PowerUser;
import com.docus.server.sys.service.IPowerUserService; import com.docus.server.sys.service.IPowerUserService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -27,12 +27,12 @@ public class PowerUserServiceImpl extends ServiceImpl<PowerUserMapper, PowerUser
private UserProperties userProperties; private UserProperties userProperties;
@Override @Override
public void batchSavePowerUser(List<UserDTO> userDTOList) { public void batchSaveOrUpdatePowerUser(List<UserDTO> userDTOList) {
userDTOList.forEach(this::register); userDTOList.forEach(this::saveOrUpdatePowerUser);
} }
@Override @Override
public boolean register(UserDTO userDTO) { public boolean saveOrUpdatePowerUser(UserDTO userDTO) {
PowerUser powerUser = baseMapper.getUserByUserName(userDTO.getUserName()); PowerUser powerUser = baseMapper.getUserByUserName(userDTO.getUserName());
UserModifyParam userModifyParam = userDTO.transUserAddParam(); UserModifyParam userModifyParam = userDTO.transUserAddParam();
if (Func.isEmpty(powerUser)) { if (Func.isEmpty(powerUser)) {

@ -1,59 +0,0 @@
package com.docus.server.sys.service.impl;
import com.docus.core.util.Func;
import com.docus.infrastructure.redis.service.IdService;
import com.docus.server.sys.common.UserProperties;
import com.docus.server.sys.pojo.dto.UserDTO;
import com.docus.server.sys.pojo.dto.UserModifyParam;
import com.docus.server.sys.pojo.entity.PowerUser;
import com.docus.server.sys.service.ITBasicService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
*
*
* @author wyb
*/
@Service
public class TBasicServiceImpl extends ServiceImpl<TBasicMapper, TBasic> implements ITBasicService {
@Resource
private IdService idService;
@Resource
private UserProperties userProperties;
@Override
public void batchSavePowerUser(List<UserDTO> userDTOList) {
userDTOList.forEach(this::register);
}
@Override
public boolean register(UserDTO userDTO) {
PowerUser powerUser = baseMapper.getUserByUserName(userDTO.getUserName());
UserModifyParam userModifyParam = userDTO.transUserAddParam();
if (Func.isEmpty(powerUser)) {
long userId = idService.getDateSeq();
userModifyParam.setUserId(userId);
userModifyParam.setUserPwd(userProperties.getPassword());
baseMapper.addUser(userModifyParam);
return true;
}
userModifyParam.setUserId(powerUser.getUserId());
baseMapper.updateUser(userModifyParam);
return true;
}
@Override
public boolean delUserByUserName(String userName) {
PowerUser powerUser = baseMapper.getUserByUserName(userName);
if (Func.isEmpty(powerUser)) {
return true;
}
baseMapper.delUserByUserName(userName);
return true;
}
}

@ -24,7 +24,7 @@
delete from `docus_system`.`power_dept` where `dept_code` = #{deptCode} delete from `docus_system`.`power_dept` where `dept_code` = #{deptCode}
</delete> </delete>
<select id="getDeptByDeptCode" resultType="com.docus.server.sys.pojo.entity.PowerDept"> <select id="getDeptByDeptCode" resultType="com.docus.server.sys.common.pojo.entity.PowerDept">
SELECT `dept_id`,`dept_code`,`dept_name` FROM `docus_system`.`power_dept` SELECT `dept_id`,`dept_code`,`dept_name` FROM `docus_system`.`power_dept`
WHERE `dept_code` = #{deptCode} LIMIT 1 WHERE `dept_code` = #{deptCode} LIMIT 1
</select> </select>

@ -31,7 +31,7 @@
delete from `docus_system`.`power_user` where `user_name` = #{userName} delete from `docus_system`.`power_user` where `user_name` = #{userName}
</delete> </delete>
<select id="getUserByUserName" resultType="com.docus.server.sys.pojo.entity.PowerUser"> <select id="getUserByUserName" resultType="com.docus.server.sys.common.pojo.entity.PowerUser">
SELECT `user_id`,`user_name`,`user_pwd` FROM `docus_system`.`power_user` SELECT `user_id`,`user_name`,`user_pwd` FROM `docus_system`.`power_user`
WHERE `user_name` = #{userName} LIMIT 1 WHERE `user_name` = #{userName} LIMIT 1
</select> </select>

@ -16,6 +16,12 @@
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>com.docus</groupId>
<artifactId>docus-medical-record</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>
<build> <build>

@ -1,9 +1,11 @@
package com.docus.server.his.infrastructure; package com.docus.server.his.infrastructure;
import com.docus.server.his.infrastructure.mapper.HisDeptMapper; import com.docus.server.his.infrastructure.mapper.HisDeptMapper;
import com.docus.server.his.infrastructure.mapper.HisTBasicMapper;
import com.docus.server.his.infrastructure.mapper.HisUserMapper; import com.docus.server.his.infrastructure.mapper.HisUserMapper;
import com.docus.server.sys.pojo.dto.DeptDTO; import com.docus.server.record.pojo.dto.TBasicDTO;
import com.docus.server.sys.pojo.dto.UserDTO; import com.docus.server.sys.common.pojo.dto.DeptDTO;
import com.docus.server.sys.common.pojo.dto.UserDTO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -17,6 +19,7 @@ public class HisSysDao {
private final HisDeptMapper hisDeptMapper; private final HisDeptMapper hisDeptMapper;
private final HisUserMapper hisUserMapper; private final HisUserMapper hisUserMapper;
private final HisTBasicMapper hisTBasicMapper;
public List<DeptDTO> getDeptListView(Date startDate, Date endDate, long pageNum, long pageSize) { public List<DeptDTO> getDeptListView(Date startDate, Date endDate, long pageNum, long pageSize) {
@ -28,9 +31,11 @@ public class HisSysDao {
return hisUserMapper.getUserListView(startDate, endDate, (pageNum - 1) * pageSize, pageSize); return hisUserMapper.getUserListView(startDate, endDate, (pageNum - 1) * pageSize, pageSize);
} }
public void getMedicalRecordListView() { public void getMedicalRecordListView() {
} }
public List<TBasicDTO> getTBasicListView(Date startDate, Date endDate, long pageNum, long pageSize) {
return hisTBasicMapper.getTBasicListView(startDate, endDate, (pageNum - 1) * pageSize, pageSize);
}
} }

@ -1,7 +1,7 @@
package com.docus.server.his.infrastructure.mapper; package com.docus.server.his.infrastructure.mapper;
import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.annotation.DS;
import com.docus.server.sys.pojo.dto.DeptDTO; import com.docus.server.sys.common.pojo.dto.DeptDTO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;

@ -0,0 +1,21 @@
package com.docus.server.his.infrastructure.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.docus.server.record.pojo.dto.TBasicDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
@Mapper
@DS("his")
public interface HisTBasicMapper {
List<TBasicDTO> getTBasicListView(@Param("startDate") Date startDate,
@Param("endDate") Date endDate,
@Param("offset") long offset,
@Param("pageSize") long pageSize);
}

@ -1,7 +1,7 @@
package com.docus.server.his.infrastructure.mapper; package com.docus.server.his.infrastructure.mapper;
import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.annotation.DS;
import com.docus.server.sys.pojo.dto.UserDTO; import com.docus.server.sys.common.pojo.dto.UserDTO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -12,7 +12,10 @@ import java.util.List;
@DS("his") @DS("his")
public interface HisUserMapper { public interface HisUserMapper {
List<UserDTO> getUserListView(@Param("startDate") Date startDate, @Param("endDate") Date endDate, @Param("offset") long offset, @Param("pageSize") long pageSize); List<UserDTO> getUserListView(@Param("startDate") Date startDate,
@Param("endDate") Date endDate,
@Param("offset") long offset,
@Param("pageSize") long pageSize);
} }

@ -1,13 +1,16 @@
package com.docus.server.his.service; package com.docus.server.his.service;
import com.docus.server.sys.pojo.dto.DeptDTO; import com.docus.server.record.pojo.dto.TBasicDTO;
import com.docus.server.sys.pojo.dto.UserDTO; import com.docus.server.sys.common.pojo.dto.DeptDTO;
import com.docus.server.sys.common.pojo.dto.UserDTO;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
public interface IHisService { public interface IHisService {
List<DeptDTO> getDeptListView(Date startDate, Date endDate, long pazeNum, long pageSize); List<DeptDTO> getDeptListView(Date startDate, Date endDate, long pageNum, long pageSize);
List<UserDTO> getUserListView(Date startDate, Date endDate, long pazeNum, long pageSize); List<UserDTO> getUserListView(Date startDate, Date endDate, long pageNum, long pageSize);
List<TBasicDTO> getTBasicListView(Date startDate, Date endDate, long pageNum, long pageSize);
} }

@ -2,8 +2,9 @@ package com.docus.server.his.service.impl;
import com.docus.server.his.infrastructure.HisSysDao; import com.docus.server.his.infrastructure.HisSysDao;
import com.docus.server.his.service.IHisService; import com.docus.server.his.service.IHisService;
import com.docus.server.sys.pojo.dto.DeptDTO; import com.docus.server.record.pojo.dto.TBasicDTO;
import com.docus.server.sys.pojo.dto.UserDTO; import com.docus.server.sys.common.pojo.dto.DeptDTO;
import com.docus.server.sys.common.pojo.dto.UserDTO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -16,7 +17,6 @@ public class HisService implements IHisService {
private final HisSysDao hisSysDao; private final HisSysDao hisSysDao;
@Override @Override
public List<DeptDTO> getDeptListView(Date startDate, Date endDate, long pageNum, long pageSize) { public List<DeptDTO> getDeptListView(Date startDate, Date endDate, long pageNum, long pageSize) {
return hisSysDao.getDeptListView(startDate, endDate, pageNum, pageSize); return hisSysDao.getDeptListView(startDate, endDate, pageNum, pageSize);
@ -27,4 +27,9 @@ public class HisService implements IHisService {
return hisSysDao.getUserListView(startDate, endDate, pageNum, pageSize); return hisSysDao.getUserListView(startDate, endDate, pageNum, pageSize);
} }
@Override
public List<TBasicDTO> getTBasicListView(Date startDate, Date endDate, long pageNum, long pageSize) {
return hisSysDao.getTBasicListView(startDate, endDate, pageNum, pageSize);
}
} }

@ -4,7 +4,7 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.docus.server.his.infrastructure.mapper.HisDeptMapper"> <mapper namespace="com.docus.server.his.infrastructure.mapper.HisDeptMapper">
<select id="getDeptListView" resultType="com.docus.server.sys.pojo.dto.DeptDTO"> <select id="getDeptListView" resultType="com.docus.server.sys.common.pojo.dto.DeptDTO">
SELECT `update_time` as update_time ,`dept_code` as dept_code,`dept_name` as dept_name FROM `his_dept` SELECT `update_time` as update_time ,`dept_code` as dept_code,`dept_name` as dept_name FROM `his_dept`
WHERE update_time between #{startDate} and #{endDate} WHERE update_time between #{startDate} and #{endDate}
order by update_time asc order by update_time asc
@ -13,7 +13,7 @@
<!-- mysql <!-- mysql
<select id="getDeptListView" resultType="com.docus.server.sys.pojo.dto.DeptDTO"> <select id="getDeptListView" resultType="com.docus.server.sys.common.pojo.dto.DeptDTO">
SELECT `update_time` as update_time ,`dept_code` as dept_code,`dept_name` as dept_name FROM `his`.`his_dept` SELECT `update_time` as update_time ,`dept_code` as dept_code,`dept_name` as dept_name FROM `his`.`his_dept`
WHERE update_time between #{startDate} and #{endDate} WHERE update_time between #{startDate} and #{endDate}
order by update_time asc order by update_time asc
@ -23,7 +23,7 @@
<!-- mssqsql <!-- mssqsql
<select id="getDeptListView" resultType="com.docus.server.sys.pojo.dto.DeptDTO"> <select id="getDeptListView" resultType="com.docus.server.sys.common.pojo.dto.DeptDTO">
select top pageSize `update_time` as update_time ,`dept_code` as dept_code,`dept_name` as dept_name select top pageSize `update_time` as update_time ,`dept_code` as dept_code,`dept_name` as dept_name
from (select row_number() from (select row_number()
over(order by sno asc) as rownumber,* over(order by sno asc) as rownumber,*
@ -33,7 +33,7 @@
--> -->
<!-- oracle <!-- oracle
<select id="getDeptListView" resultType="com.docus.server.sys.pojo.dto.DeptDTO"> <select id="getDeptListView" resultType="com.docus.server.sys.common.pojo.dto.DeptDTO">
SELECT * FROM SELECT * FROM
(SELECT tt.*,ROWNUM AS RN FROM (SELECT tt.*,ROWNUM AS RN FROM
(SELECT t.* FROM ${tableName} t (SELECT t.* FROM ${tableName} t

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.docus.server.his.infrastructure.mapper.HisTBasicMapper">
<select id="getTBasicListView" resultType="com.docus.server.record.pojo.dto.TBasicDTO">
SELECT `update_time` as update_time ,`dept_code` as dept_code,`dept_name` as dept_name FROM `his_basic`
WHERE update_time between #{startDate} and #{endDate}
order by update_time asc
LIMIT #{offset}, #{pageSize}
</select>
<!-- mysql
<select id="getDeptListView" resultType="com.docus.server.sys.common.pojo.dto.DeptDTO">
SELECT `update_time` as update_time ,`dept_code` as dept_code,`dept_name` as dept_name FROM `his`.`his_dept`
WHERE update_time between #{startDate} and #{endDate}
order by update_time asc
LIMIT (#{pageNum} - 1) * #{pageSize} , #{pageSize}
</select>
-->
<!-- mssqsql
<select id="getDeptListView" resultType="com.docus.server.sys.common.pojo.dto.DeptDTO">
select top pageSize `update_time` as update_time ,`dept_code` as dept_code,`dept_name` as dept_name
from (select row_number()
over(order by sno asc) as rownumber,*
from student) temp_row
where rownumber>((pageNum-1)*pageSize);
</select>
-->
<!-- oracle
<select id="getDeptListView" resultType="com.docus.server.sys.common.pojo.dto.DeptDTO">
SELECT * FROM
(SELECT tt.*,ROWNUM AS RN FROM
(SELECT t.* FROM ${tableName} t
where 1=1
ORDER BY t.createTime DESC,t.id ) tt
WHERE tt.ROWNUM <= #{pageNum}*#{pageSize}
) rs
WHERE rs.RN > #{pageNum-1}*#{pageSize}
</select>
-->
</mapper>

@ -4,8 +4,8 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.docus.server.his.infrastructure.mapper.HisUserMapper"> <mapper namespace="com.docus.server.his.infrastructure.mapper.HisUserMapper">
<select id="getUserListView" resultType="com.docus.server.sys.pojo.dto.UserDTO"> <select id="getUserListView" resultType="com.docus.server.sys.common.pojo.dto.UserDTO">
SELECT `update_time` as update_time ,`dept_code` as dept_code,`dept_name` as dept_name FROM `his_dept` SELECT `update_time` as update_time ,`dept_code` as dept_code,`dept_name` as dept_name FROM `his_user`
WHERE update_time between #{startDate} and #{endDate} WHERE update_time between #{startDate} and #{endDate}
order by update_time asc order by update_time asc
LIMIT #{offset}, #{pageSize} LIMIT #{offset}, #{pageSize}
@ -13,7 +13,7 @@
<!-- mysql <!-- mysql
<select id="getDeptListView" resultType="com.docus.server.sys.pojo.dto.DeptDTO"> <select id="getDeptListView" resultType="com.docus.server.sys.common.pojo.dto.DeptDTO">
SELECT `update_time` as update_time ,`dept_code` as dept_code,`dept_name` as dept_name FROM `his`.`his_dept` SELECT `update_time` as update_time ,`dept_code` as dept_code,`dept_name` as dept_name FROM `his`.`his_dept`
WHERE update_time between #{startDate} and #{endDate} WHERE update_time between #{startDate} and #{endDate}
order by update_time asc order by update_time asc
@ -23,7 +23,7 @@
<!-- mssqsql <!-- mssqsql
<select id="getDeptListView" resultType="com.docus.server.sys.pojo.dto.DeptDTO"> <select id="getDeptListView" resultType="com.docus.server.sys.common.pojo.dto.DeptDTO">
select top pageSize `update_time` as update_time ,`dept_code` as dept_code,`dept_name` as dept_name select top pageSize `update_time` as update_time ,`dept_code` as dept_code,`dept_name` as dept_name
from (select row_number() from (select row_number()
over(order by sno asc) as rownumber,* over(order by sno asc) as rownumber,*
@ -33,7 +33,7 @@
--> -->
<!-- oracle <!-- oracle
<select id="getDeptListView" resultType="com.docus.server.sys.pojo.dto.DeptDTO"> <select id="getDeptListView" resultType="com.docus.server.sys.common.pojo.dto.DeptDTO">
SELECT * FROM SELECT * FROM
(SELECT tt.*,ROWNUM AS RN FROM (SELECT tt.*,ROWNUM AS RN FROM
(SELECT t.* FROM ${tableName} t (SELECT t.* FROM ${tableName} t

Loading…
Cancel
Save