Commit ec6cdc69e073256971d6ce07b8842912e88de812
Exists in
master
Merge branch 'master' of https://git.healthbaby.com.cn/jiangjiazhi/center
Showing 63 changed files
- parent/base.common/src/main/java/com/lyms/base/common/dao/sys/SyncDataBasicMapper.java
- parent/base.common/src/main/java/com/lyms/base/common/dao/sys/SyncDataBasicMapper.xml
- parent/base.common/src/main/java/com/lyms/base/common/entity/sys/SyncDataBasic.java
- parent/base.common/src/main/java/com/lyms/base/common/entity/user/SysUserDataPermissions.java
- parent/base.common/src/main/java/com/lyms/base/common/enums/SyncParamEnum.java
- parent/base.common/src/main/java/com/lyms/base/common/service/conf/DiagnoseMapsService.java
- parent/base.common/src/main/java/com/lyms/base/common/service/conf/DiagnoseVersionService.java
- parent/base.common/src/main/java/com/lyms/base/common/service/conf/HighriskVersionService.java
- parent/base.common/src/main/java/com/lyms/base/common/service/conf/impl/DiagnoseConfServiceImpl.java
- parent/base.common/src/main/java/com/lyms/base/common/service/conf/impl/DiagnoseMapsServiceImpl.java
- parent/base.common/src/main/java/com/lyms/base/common/service/conf/impl/DiagnoseSourceServiceImpl.java
- parent/base.common/src/main/java/com/lyms/base/common/service/conf/impl/DiagnoseVersionServiceImpl.java
- parent/base.common/src/main/java/com/lyms/base/common/service/conf/impl/HighriskConfServiceImpl.java
- parent/base.common/src/main/java/com/lyms/base/common/service/conf/impl/HighriskSourceServiceImpl.java
- parent/base.common/src/main/java/com/lyms/base/common/service/conf/impl/HighriskVersionServiceImpl.java
- parent/base.common/src/main/java/com/lyms/base/common/service/organ/OrganizationsService.java
- parent/base.common/src/main/java/com/lyms/base/common/service/organ/SysOrganizationsConfService.java
- parent/base.common/src/main/java/com/lyms/base/common/service/organ/impl/OrganGroupServiceImpl.java
- parent/base.common/src/main/java/com/lyms/base/common/service/organ/impl/SysOrganizationsConfServiceImpl.java
- parent/base.common/src/main/java/com/lyms/base/common/service/role/impl/RolesServiceImpl.java
- parent/base.common/src/main/java/com/lyms/base/common/service/sys/SyncDataBasicService.java
- parent/base.common/src/main/java/com/lyms/base/common/service/sys/impl/SyncDataBasicServiceImpl.java
- parent/base.common/src/main/java/com/lyms/base/common/service/user/impl/UsersServiceImpl.java
- parent/base.common/src/main/java/com/lyms/base/common/utils/SyncComponent.java
- parent/center.manager/src/main/java/com/lyms/cm/controller/conf/DiagnoseVersionController.java
- parent/center.manager/src/main/java/com/lyms/cm/controller/conf/HighriskVersionController.java
- parent/center.manager/src/main/java/com/lyms/cm/job/SyncFixJob.java
- parent/center.manager/src/main/java/com/lyms/cm/job/SyncTmpJob.java
- parent/center.manager/src/main/resources/dev/redis.properties
- parent/center.manager/src/main/resources/xml/app-datasource.xml
- parent/center.manager/src/main/webapp/WEB-INF/views/conf/diagnose/version_list.html
- parent/center.manager/src/main/webapp/WEB-INF/views/conf/highrisk/version_list.html
- parent/center.manager/src/test/java/center/manager/test/user/WorkTest.java
- parent/hospital.mac/src/main/java/com/lyms/hospital/entity/assist/DiagnoseAssit.java
- parent/hospital.mac/src/main/java/com/lyms/hospital/entity/diagnose/DiagnoseInfo.java
- parent/hospital.mac/src/main/java/com/lyms/hospital/entity/history/HistoryMaps.java
- parent/hospital.mac/src/main/java/com/lyms/hospital/entity/history/HistorySource.java
- parent/hospital.mac/src/main/java/com/lyms/hospital/enums/ServiceStatusEnums.java
- parent/hospital.mac/src/main/java/com/lyms/hospital/enums/business/FetalEnums.java
- parent/hospital.mac/src/main/java/com/lyms/hospital/enums/business/FetalPositionEnums.java
- parent/hospital.mac/src/main/java/com/lyms/hospital/enums/business/FuZhongEnums.java
- parent/hospital.mac/src/main/java/com/lyms/hospital/enums/business/JoinEnums.java
- parent/hospital.mac/src/main/java/com/lyms/hospital/enums/business/ServiceStatusEnums.java
- parent/hospital.mac/src/main/java/com/lyms/hospital/enums/business/TaiShuEnums.java
- parent/hospital.mac/src/main/java/com/lyms/hospital/service/diagnose/impl/DiagnoseInfoServiceImpl.java
- parent/hospital.mac/src/main/java/com/lyms/hospital/service/diagnose/impl/DiagnoseTaiServiceImpl.java
- parent/hospital.mac/src/main/java/com/lyms/hospital/service/history/impl/HistoryMapsServiceImpl.java
- parent/hospital.mac/src/main/java/com/lyms/hospital/service/history/impl/HistorySourceServiceImpl.java
- parent/hospital.web/src/main/java/com/lyms/hospital/controller/CommonApiController.java
- parent/hospital.web/src/main/java/com/lyms/hospital/controller/RouterController.java
- parent/hospital.web/src/main/java/com/lyms/hospital/controller/woman/WomanExamController.java
- parent/hospital.web/src/main/java/com/lyms/hospital/dao/sys/SyncDataBasicMapper.java
- parent/hospital.web/src/main/java/com/lyms/hospital/dao/sys/SyncDataBasicMapper.xml
- parent/hospital.web/src/main/java/com/lyms/hospital/entity/sys/SyncDataBasic.java
- parent/hospital.web/src/main/java/com/lyms/hospital/request/exam/ExamAddRequest.java
- parent/hospital.web/src/main/java/com/lyms/hospital/request/exam/ExamAddRequestWrapper.java
- parent/hospital.web/src/main/java/com/lyms/hospital/response/keymap/WomanExamKeymap.java
- parent/hospital.web/src/main/java/com/lyms/hospital/service/sys/SyncDataBasicService.java
- parent/hospital.web/src/main/java/com/lyms/hospital/service/sys/impl/SyncDataBasicServiceImpl.java
- parent/hospital.web/src/main/java/com/lyms/hospital/util/trans/XjhMapUtil.java
- parent/hospital.web/src/main/resources/dev/conf.properties
- parent/hospital.web/src/main/resources/xml/app-datasource.xml
- parent/hospital.web/src/test/java/test/hospital/sync/SyncTest.java
parent/base.common/src/main/java/com/lyms/base/common/dao/sys/SyncDataBasicMapper.java
View file @
ec6cdc6
| 1 | +package com.lyms.base.common.dao.sys; | |
| 2 | + | |
| 3 | +import java.io.Serializable; | |
| 4 | +import java.util.List; | |
| 5 | + | |
| 6 | +import org.springframework.stereotype.Repository; | |
| 7 | + | |
| 8 | +import com.baomidou.mybatisplus.mapper.BaseMapper; | |
| 9 | +import com.lyms.base.common.entity.sys.SyncDataBasic; | |
| 10 | + | |
| 11 | +/** | |
| 12 | + * <p> | |
| 13 | + * Mapper接口 | |
| 14 | + * </p> | |
| 15 | + * | |
| 16 | + * @author maliang | |
| 17 | + * @since 2017-03-15 | |
| 18 | + */ | |
| 19 | +@Repository | |
| 20 | +public interface SyncDataBasicMapper extends BaseMapper<SyncDataBasic> { | |
| 21 | + | |
| 22 | + public Integer deleteLogicById(Serializable id); | |
| 23 | + | |
| 24 | + /** | |
| 25 | + * <li>@Description: 批量更新 | |
| 26 | + * <li>@param ids | |
| 27 | + * <li>@return | |
| 28 | + * <li>创建人:maliang | |
| 29 | + * <li>创建时间:2017年3月15日 | |
| 30 | + * <li>修改人: | |
| 31 | + * <li>修改时间: | |
| 32 | + */ | |
| 33 | + public Integer updateBatchByIds(List<Serializable> ids); | |
| 34 | + | |
| 35 | +} |
parent/base.common/src/main/java/com/lyms/base/common/dao/sys/SyncDataBasicMapper.xml
View file @
ec6cdc6
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |
| 3 | +"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
| 4 | +<mapper namespace="com.lyms.base.common.dao.sys.SyncDataBasicMapper"> | |
| 5 | + | |
| 6 | + <!-- 通用查询映射结果 --> | |
| 7 | + <resultMap id="BaseResultMap" type="com.lyms.base.common.entity.sys.SyncDataBasic"> | |
| 8 | + <id column="ID" property="id" /> | |
| 9 | + <result column="DATA" property="data" /> | |
| 10 | + <result column="CREATE_TIME" property="createTime" /> | |
| 11 | + <result column="IFSUC" property="ifsuc" /> | |
| 12 | + </resultMap> | |
| 13 | + | |
| 14 | + <!-- 通用查询结果列 --> | |
| 15 | + <sql id="Base_Column_List"> | |
| 16 | + ID AS id, DATA AS data, CREATE_TIME AS createTime, IFSUC AS ifsuc | |
| 17 | + </sql> | |
| 18 | + | |
| 19 | + <sql id="Base_table"> | |
| 20 | + SYNC_DATA_BASIC | |
| 21 | + </sql> | |
| 22 | + | |
| 23 | + | |
| 24 | + <update id="updateBatchByIds" parameterType="list"> | |
| 25 | + update from <include refid="Base_table" /> as sb set sb.ifsuc=1 | |
| 26 | + where sb.id in | |
| 27 | + <foreach item="item" collection="ids" open="(" close=")" separator=","> | |
| 28 | + #{item} | |
| 29 | + </foreach> | |
| 30 | + </update> | |
| 31 | + | |
| 32 | +</mapper> |
parent/base.common/src/main/java/com/lyms/base/common/entity/sys/SyncDataBasic.java
View file @
ec6cdc6
| 1 | +package com.lyms.base.common.entity.sys; | |
| 2 | + | |
| 3 | +import java.io.Serializable; | |
| 4 | +import java.util.Date; | |
| 5 | + | |
| 6 | +import com.baomidou.mybatisplus.annotations.TableField; | |
| 7 | +import com.baomidou.mybatisplus.annotations.TableId; | |
| 8 | +import com.baomidou.mybatisplus.annotations.TableName; | |
| 9 | +import com.lyms.sync.channel.ChannelData; | |
| 10 | + | |
| 11 | +/** | |
| 12 | + * | |
| 13 | + * <p> | |
| 14 | + * 用户、角色、权限、医院、部门等基础数据同步 | |
| 15 | + * </p> | |
| 16 | + * | |
| 17 | + * @author maliang | |
| 18 | + * @since 2017-03-15 | |
| 19 | + */ | |
| 20 | +@TableName("SYNC_DATA_BASIC") | |
| 21 | +public class SyncDataBasic implements Serializable { | |
| 22 | + | |
| 23 | + private static final long serialVersionUID = 1L; | |
| 24 | + | |
| 25 | + /** | |
| 26 | + * 该ID 一定要与data 中的ID一致 | |
| 27 | + */ | |
| 28 | + @TableId(value = "ID") | |
| 29 | + private String id; | |
| 30 | + /** | |
| 31 | + * 数据对象 {@link ChannelData} json 数据格式 | |
| 32 | + */ | |
| 33 | + @TableField(value = "DATA") | |
| 34 | + private String data; | |
| 35 | + /** | |
| 36 | + * 创建时间 | |
| 37 | + */ | |
| 38 | + @TableField(value = "CREATE_TIME") | |
| 39 | + private Date createTime; | |
| 40 | + /** | |
| 41 | + * 数据上传是否成功 | |
| 42 | + */ | |
| 43 | + @TableField(value = "IFSUC") | |
| 44 | + private Integer ifsuc; | |
| 45 | + | |
| 46 | + public String getId() { | |
| 47 | + return id; | |
| 48 | + } | |
| 49 | + | |
| 50 | + public void setId(String id) { | |
| 51 | + this.id = id; | |
| 52 | + } | |
| 53 | + | |
| 54 | + public String getData() { | |
| 55 | + return data; | |
| 56 | + } | |
| 57 | + | |
| 58 | + public void setData(String data) { | |
| 59 | + this.data = data; | |
| 60 | + } | |
| 61 | + | |
| 62 | + public Date getCreateTime() { | |
| 63 | + return createTime; | |
| 64 | + } | |
| 65 | + | |
| 66 | + public void setCreateTime(Date createTime) { | |
| 67 | + this.createTime = createTime; | |
| 68 | + } | |
| 69 | + | |
| 70 | + public Integer getIfsuc() { | |
| 71 | + return ifsuc; | |
| 72 | + } | |
| 73 | + | |
| 74 | + public void setIfsuc(Integer ifsuc) { | |
| 75 | + this.ifsuc = ifsuc; | |
| 76 | + } | |
| 77 | + | |
| 78 | +} |
parent/base.common/src/main/java/com/lyms/base/common/entity/user/SysUserDataPermissions.java
View file @
ec6cdc6
| 1 | 1 | package com.lyms.base.common.entity.user; |
| 2 | 2 | |
| 3 | -import com.baomidou.mybatisplus.annotations.TableId; | |
| 3 | +import java.io.Serializable; | |
| 4 | + | |
| 4 | 5 | import com.baomidou.mybatisplus.annotations.TableField; |
| 5 | 6 | import com.baomidou.mybatisplus.annotations.TableName; |
| 6 | -import java.io.Serializable; | |
| 7 | 7 | |
| 8 | 8 | /** |
| 9 | 9 | * <p> |
parent/base.common/src/main/java/com/lyms/base/common/enums/SyncParamEnum.java
View file @
ec6cdc6
| ... | ... | @@ -26,6 +26,37 @@ |
| 26 | 26 | DEPART_INSERT(com.lyms.base.common.service.organ.impl.DepartmentsServiceImpl.class.getName(),"createDepart"), |
| 27 | 27 | DEPART_UPDATE(com.lyms.base.common.service.organ.impl.DepartmentsServiceImpl.class.getName(),"updateDepart"), |
| 28 | 28 | DEPART_DELETE(com.lyms.base.common.service.organ.impl.DepartmentsServiceImpl.class.getName(),"deleteDepartById"), |
| 29 | + | |
| 30 | + //诊断 | |
| 31 | + DIAGNOSE_CONF_INSERT(com.lyms.base.common.service.conf.impl.DiagnoseConfServiceImpl.class.getName(),"insert"), | |
| 32 | + DIAGNOSE_CONF_UPDATE(com.lyms.base.common.service.conf.impl.DiagnoseConfServiceImpl.class.getName(),"updateById"), | |
| 33 | + DIAGNOSE_CONF_DELETE(com.lyms.base.common.service.conf.impl.DiagnoseConfServiceImpl.class.getName(),"deleteLogicById"), | |
| 34 | + | |
| 35 | + DIAGNOSE_VERSION_INSERT(com.lyms.base.common.service.conf.impl.DiagnoseVersionServiceImpl.class.getName(),"insert"), | |
| 36 | + DIAGNOSE_VERSION_UPDATE(com.lyms.base.common.service.conf.impl.DiagnoseVersionServiceImpl.class.getName(),"updateById"), | |
| 37 | + DIAGNOSE_VERSION_DELETE(com.lyms.base.common.service.conf.impl.DiagnoseVersionServiceImpl.class.getName(),"deleteLogicById"), | |
| 38 | + DIAGNOSE_VERSION_COPY_INSERT(com.lyms.base.common.service.conf.impl.DiagnoseVersionServiceImpl.class.getName(),"copyInsert"), | |
| 39 | + | |
| 40 | + DIAGNOSE_SOURCE_INSERT(com.lyms.base.common.service.conf.impl.DiagnoseSourceServiceImpl.class.getName(),"insert"), | |
| 41 | + DIAGNOSE_SOURCE_UPDATE(com.lyms.base.common.service.conf.impl.DiagnoseSourceServiceImpl.class.getName(),"updateById"), | |
| 42 | + DIAGNOSE_SOURCE_DELETE(com.lyms.base.common.service.conf.impl.DiagnoseSourceServiceImpl.class.getName(),"deleteLogicById"), | |
| 43 | + | |
| 44 | + | |
| 45 | + //高危 | |
| 46 | + HIGHRISK_CONF_INSERT(com.lyms.base.common.service.conf.impl.HighriskConfServiceImpl.class.getName(),"insert"), | |
| 47 | + HIGHRISK_CONF_UPDATE(com.lyms.base.common.service.conf.impl.HighriskConfServiceImpl.class.getName(),"updateById"), | |
| 48 | + HIGHRISK_CONF_DELETE(com.lyms.base.common.service.conf.impl.HighriskConfServiceImpl.class.getName(),"deleteLogicById"), | |
| 49 | + | |
| 50 | + HIGHRISK_VERSION_INSERT(com.lyms.base.common.service.conf.impl.HighriskVersionServiceImpl.class.getName(),"insert"), | |
| 51 | + HIGHRISK_VERSION_UPDATE(com.lyms.base.common.service.conf.impl.HighriskVersionServiceImpl.class.getName(),"updateById"), | |
| 52 | + HIGHRISK_VERSION_DELETE(com.lyms.base.common.service.conf.impl.HighriskVersionServiceImpl.class.getName(),"deleteLogicById"), | |
| 53 | + HIGHRISK_VERSION_COPY_INSERT(com.lyms.base.common.service.conf.impl.HighriskVersionServiceImpl.class.getName(),"copyInsert"), | |
| 54 | + | |
| 55 | + HIGHRISK_SOURCE_INSERT(com.lyms.base.common.service.conf.impl.HighriskSourceServiceImpl.class.getName(),"insert"), | |
| 56 | + HIGHRISK_SOURCE_UPDATE(com.lyms.base.common.service.conf.impl.HighriskSourceServiceImpl.class.getName(),"updateById"), | |
| 57 | + HIGHRISK_SOURCE_DELETE(com.lyms.base.common.service.conf.impl.HighriskSourceServiceImpl.class.getName(),"deleteLogicById"), | |
| 58 | + | |
| 59 | + | |
| 29 | 60 | ; |
| 30 | 61 | |
| 31 | 62 |
parent/base.common/src/main/java/com/lyms/base/common/service/conf/DiagnoseMapsService.java
View file @
ec6cdc6
| 1 | 1 | package com.lyms.base.common.service.conf; |
| 2 | 2 | |
| 3 | -import com.lyms.base.common.entity.conf.DiagnoseMaps; | |
| 4 | -import com.lyms.base.common.entity.conf.HighriskMaps; | |
| 5 | -import com.lyms.web.service.BaseService; | |
| 6 | 3 | import java.io.Serializable; |
| 7 | 4 | import java.util.List; |
| 5 | + | |
| 6 | +import com.lyms.base.common.entity.conf.DiagnoseMaps; | |
| 7 | +import com.lyms.web.service.BaseService; | |
| 8 | 8 | |
| 9 | 9 | /** |
| 10 | 10 | * <p> |
parent/base.common/src/main/java/com/lyms/base/common/service/conf/DiagnoseVersionService.java
View file @
ec6cdc6
| ... | ... | @@ -62,13 +62,14 @@ |
| 62 | 62 | /** |
| 63 | 63 | * <li>@Description:复制一个版本 |
| 64 | 64 | * <li>@param id |
| 65 | + * <li>@param versionName | |
| 65 | 66 | * <li>@return |
| 66 | 67 | * <li>创建人:方承 |
| 67 | 68 | * <li>创建时间:2017年4月7日 |
| 68 | 69 | * <li>修改人: |
| 69 | 70 | * <li>修改时间: |
| 70 | 71 | */ |
| 71 | - public Integer copy(Serializable id); | |
| 72 | + public Integer copy(Serializable id,String versionName); | |
| 72 | 73 | |
| 73 | 74 | } |
parent/base.common/src/main/java/com/lyms/base/common/service/conf/HighriskVersionService.java
View file @
ec6cdc6
| ... | ... | @@ -62,13 +62,14 @@ |
| 62 | 62 | /** |
| 63 | 63 | * <li>@Description:复制一个版本 |
| 64 | 64 | * <li>@param id |
| 65 | + * <li>@param versionName | |
| 65 | 66 | * <li>@return |
| 66 | 67 | * <li>创建人:方承 |
| 67 | 68 | * <li>创建时间:2017年4月6日 |
| 68 | 69 | * <li>修改人: |
| 69 | 70 | * <li>修改时间: |
| 70 | 71 | */ |
| 71 | - public Integer copy(Serializable id); | |
| 72 | + public Integer copy(Serializable id,String versionName); | |
| 72 | 73 | |
| 73 | 74 | } |
parent/base.common/src/main/java/com/lyms/base/common/service/conf/impl/DiagnoseConfServiceImpl.java
View file @
ec6cdc6
| 1 | 1 | package com.lyms.base.common.service.conf.impl; |
| 2 | 2 | |
| 3 | 3 | import com.lyms.base.common.entity.conf.DiagnoseConf; |
| 4 | +import com.lyms.base.common.enums.SyncParamEnum; | |
| 4 | 5 | import com.lyms.base.common.dao.conf.DiagnoseConfMapper; |
| 5 | 6 | import com.lyms.base.common.service.conf.DiagnoseConfService; |
| 7 | +import com.lyms.base.common.utils.SyncComponent; | |
| 6 | 8 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| 9 | + | |
| 10 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 7 | 11 | import org.springframework.stereotype.Service; |
| 8 | 12 | import java.io.Serializable; |
| 9 | 13 | |
| 10 | 14 | |
| ... | ... | @@ -17,9 +21,34 @@ |
| 17 | 21 | */ |
| 18 | 22 | @Service |
| 19 | 23 | public class DiagnoseConfServiceImpl extends ServiceImpl<DiagnoseConfMapper, DiagnoseConf> implements DiagnoseConfService { |
| 24 | + | |
| 25 | + @Autowired | |
| 26 | + private SyncComponent syncComponent; | |
| 20 | 27 | |
| 21 | 28 | public Integer deleteLogicById(Serializable id){ |
| 22 | - return baseMapper.deleteLogicById(id); | |
| 29 | + Integer tag = baseMapper.deleteLogicById(id); | |
| 30 | + if(tag > 0){ | |
| 31 | + syncComponent.addPushSyncOperation(SyncParamEnum.DIAGNOSE_CONF_DELETE, id); | |
| 32 | + } | |
| 33 | + return tag; | |
| 34 | + } | |
| 35 | + | |
| 36 | + @Override | |
| 37 | + public boolean insert(DiagnoseConf entity) { | |
| 38 | + boolean tag = super.insert(entity); | |
| 39 | + if(tag){ | |
| 40 | + syncComponent.addPushSyncOperation(SyncParamEnum.DIAGNOSE_CONF_INSERT, entity); | |
| 41 | + } | |
| 42 | + return tag; | |
| 43 | + } | |
| 44 | + | |
| 45 | + @Override | |
| 46 | + public boolean updateById(DiagnoseConf entity) { | |
| 47 | + boolean tag = super.updateById(entity); | |
| 48 | + if(tag){ | |
| 49 | + syncComponent.addPushSyncOperation(SyncParamEnum.DIAGNOSE_CONF_UPDATE, entity); | |
| 50 | + } | |
| 51 | + return tag; | |
| 23 | 52 | } |
| 24 | 53 | } |
parent/base.common/src/main/java/com/lyms/base/common/service/conf/impl/DiagnoseMapsServiceImpl.java
View file @
ec6cdc6
| 1 | 1 | package com.lyms.base.common.service.conf.impl; |
| 2 | 2 | |
| 3 | -import com.lyms.base.common.entity.conf.DiagnoseMaps; | |
| 4 | -import com.lyms.base.common.entity.conf.HighriskMaps; | |
| 5 | -import com.lyms.base.common.dao.conf.DiagnoseMapsMapper; | |
| 6 | -import com.lyms.base.common.service.conf.DiagnoseMapsService; | |
| 7 | -import com.baomidou.mybatisplus.service.impl.ServiceImpl; | |
| 8 | -import org.springframework.stereotype.Service; | |
| 9 | 3 | import java.io.Serializable; |
| 10 | 4 | import java.util.List; |
| 5 | + | |
| 6 | +import org.springframework.stereotype.Service; | |
| 7 | + | |
| 8 | +import com.baomidou.mybatisplus.service.impl.ServiceImpl; | |
| 9 | +import com.lyms.base.common.dao.conf.DiagnoseMapsMapper; | |
| 10 | +import com.lyms.base.common.entity.conf.DiagnoseMaps; | |
| 11 | +import com.lyms.base.common.service.conf.DiagnoseMapsService; | |
| 11 | 12 | |
| 12 | 13 | /** |
| 13 | 14 | * <p> |
parent/base.common/src/main/java/com/lyms/base/common/service/conf/impl/DiagnoseSourceServiceImpl.java
View file @
ec6cdc6
| ... | ... | @@ -3,6 +3,7 @@ |
| 3 | 3 | import java.io.Serializable; |
| 4 | 4 | import java.util.List; |
| 5 | 5 | |
| 6 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 6 | 7 | import org.springframework.stereotype.Service; |
| 7 | 8 | |
| 8 | 9 | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| 9 | 10 | |
| ... | ... | @@ -10,7 +11,9 @@ |
| 10 | 11 | import com.lyms.base.common.dao.conf.DiagnoseSourceMapper; |
| 11 | 12 | import com.lyms.base.common.entity.conf.DiagnoseSource; |
| 12 | 13 | import com.lyms.base.common.enums.StatusEnum; |
| 14 | +import com.lyms.base.common.enums.SyncParamEnum; | |
| 13 | 15 | import com.lyms.base.common.service.conf.DiagnoseSourceService; |
| 16 | +import com.lyms.base.common.utils.SyncComponent; | |
| 14 | 17 | import com.lyms.exception.SystemException; |
| 15 | 18 | import com.lyms.util.StrUtils; |
| 16 | 19 | |
| ... | ... | @@ -25,9 +28,37 @@ |
| 25 | 28 | public class DiagnoseSourceServiceImpl extends ServiceImpl<DiagnoseSourceMapper, DiagnoseSource> |
| 26 | 29 | implements DiagnoseSourceService { |
| 27 | 30 | |
| 28 | - public Integer deleteLogicById(Serializable id) { | |
| 29 | - return baseMapper.deleteLogicById(id); | |
| 30 | - } | |
| 31 | + @Autowired | |
| 32 | + private SyncComponent syncComponent; | |
| 33 | + | |
| 34 | + @Override | |
| 35 | + public Integer deleteLogicById(Serializable id){ | |
| 36 | + Integer tag = baseMapper.deleteLogicById(id); | |
| 37 | + if(tag > 0){ | |
| 38 | + syncComponent.addPushSyncOperation(SyncParamEnum.DIAGNOSE_SOURCE_DELETE, id); | |
| 39 | + } | |
| 40 | + return tag; | |
| 41 | + } | |
| 42 | + | |
| 43 | + @Override | |
| 44 | + public boolean insert(DiagnoseSource entity) { | |
| 45 | + String id = StrUtils.uuid(); | |
| 46 | + entity.setId(id); | |
| 47 | + boolean tag = super.insert(entity); | |
| 48 | + if(tag){ | |
| 49 | + syncComponent.addPushSyncOperation(SyncParamEnum.DIAGNOSE_SOURCE_DELETE, entity); | |
| 50 | + } | |
| 51 | + return tag; | |
| 52 | + } | |
| 53 | + | |
| 54 | + @Override | |
| 55 | + public boolean updateById(DiagnoseSource entity) { | |
| 56 | + boolean tag = super.updateById(entity); | |
| 57 | + if(tag){ | |
| 58 | + syncComponent.addPushSyncOperation(SyncParamEnum.DIAGNOSE_SOURCE_DELETE, entity); | |
| 59 | + } | |
| 60 | + return tag; | |
| 61 | + } | |
| 31 | 62 | |
| 32 | 63 | private void throwCheckException(DiagnoseSource diagnoseSource) throws SystemException { |
| 33 | 64 | if (diagnoseSource == null) { |
parent/base.common/src/main/java/com/lyms/base/common/service/conf/impl/DiagnoseVersionServiceImpl.java
View file @
ec6cdc6
| ... | ... | @@ -13,12 +13,12 @@ |
| 13 | 13 | import com.lyms.base.common.dao.conf.DiagnoseVersionMapper; |
| 14 | 14 | import com.lyms.base.common.entity.conf.DiagnoseConf; |
| 15 | 15 | import com.lyms.base.common.entity.conf.DiagnoseVersion; |
| 16 | -import com.lyms.base.common.entity.conf.HighriskConf; | |
| 17 | -import com.lyms.base.common.entity.conf.HighriskVersion; | |
| 18 | 16 | import com.lyms.base.common.enums.StatusEnum; |
| 17 | +import com.lyms.base.common.enums.SyncParamEnum; | |
| 19 | 18 | import com.lyms.base.common.service.conf.DiagnoseVersionService; |
| 19 | +import com.lyms.base.common.utils.SyncComponent; | |
| 20 | 20 | import com.lyms.exception.SystemException; |
| 21 | -import com.lyms.util.DateTimeUtils; | |
| 21 | +import com.lyms.util.InstanceUtils; | |
| 22 | 22 | import com.lyms.util.StrUtils; |
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | 25 | |
| ... | ... | @@ -37,10 +37,37 @@ |
| 37 | 37 | @Autowired |
| 38 | 38 | private DiagnoseConfMapper confMapper; |
| 39 | 39 | |
| 40 | - public Integer deleteLogicById(Serializable id) { | |
| 41 | - return baseMapper.deleteLogicById(id); | |
| 42 | - } | |
| 40 | + @Autowired | |
| 41 | + private SyncComponent syncComponent; | |
| 42 | + | |
| 43 | + public Integer deleteLogicById(Serializable id){ | |
| 44 | + Integer tag = baseMapper.deleteLogicById(id); | |
| 45 | + if(tag > 0){ | |
| 46 | + syncComponent.addPushSyncOperation(SyncParamEnum.DIAGNOSE_VERSION_DELETE, id); | |
| 47 | + } | |
| 48 | + return tag; | |
| 49 | + } | |
| 43 | 50 | |
| 51 | + @Override | |
| 52 | + public boolean insert(DiagnoseVersion entity) { | |
| 53 | + String id = StrUtils.uuid(); | |
| 54 | + entity.setId(id); | |
| 55 | + boolean tag = super.insert(entity); | |
| 56 | + if(tag){ | |
| 57 | + syncComponent.addPushSyncOperation(SyncParamEnum.DIAGNOSE_VERSION_INSERT, entity); | |
| 58 | + } | |
| 59 | + return tag; | |
| 60 | + } | |
| 61 | + | |
| 62 | + @Override | |
| 63 | + public boolean updateById(DiagnoseVersion entity) { | |
| 64 | + boolean tag = super.updateById(entity); | |
| 65 | + if(tag){ | |
| 66 | + syncComponent.addPushSyncOperation(SyncParamEnum.DIAGNOSE_VERSION_UPDATE, entity); | |
| 67 | + } | |
| 68 | + return tag; | |
| 69 | + } | |
| 70 | + | |
| 44 | 71 | private void throwCheckExecption(DiagnoseVersion diagnoseVersion) throws SystemException { |
| 45 | 72 | if (diagnoseVersion == null) |
| 46 | 73 | throw new SystemException("诊断信息不能为空"); |
| 47 | 74 | |
| 48 | 75 | |
| 49 | 76 | |
| ... | ... | @@ -96,18 +123,42 @@ |
| 96 | 123 | |
| 97 | 124 | @Override |
| 98 | 125 | @Transactional |
| 99 | - public Integer copy(Serializable id) { | |
| 126 | + public Integer copy(Serializable id,String versionName) { | |
| 100 | 127 | DiagnoseVersion version = baseMapper.selectById(id); |
| 101 | 128 | DiagnoseVersion newVersion = new DiagnoseVersion(); |
| 102 | - String time = DateTimeUtils.getDateTime("yyyy_MM_dd_HH_mm_ss"); | |
| 103 | - String versionId = time; | |
| 104 | - newVersion.setId(versionId); | |
| 105 | - newVersion.setName(version.getName()+time); | |
| 129 | + String newVersionId = StrUtils.uuid(); | |
| 130 | + newVersion.setId(newVersionId); | |
| 131 | + newVersion.setName(versionName); | |
| 106 | 132 | Integer tag = baseMapper.insert(newVersion); |
| 107 | 133 | List<DiagnoseConf> confList = confMapper.selectList(new EntityWrapper<DiagnoseConf>().where("version_id={0}", version.getId())); |
| 134 | + List<DiagnoseConf> newVersionConfList = InstanceUtils.newArrayList(); | |
| 108 | 135 | for(DiagnoseConf conf : confList){ |
| 109 | 136 | conf.setId(StrUtils.uuid()); |
| 110 | - conf.setVersionId(versionId); | |
| 137 | + conf.setVersionId(newVersionId); | |
| 138 | + confMapper.insert(conf); | |
| 139 | + newVersionConfList.add(conf); | |
| 140 | + } | |
| 141 | + if(tag >= 0){ | |
| 142 | + syncComponent.addPushSyncOperation(SyncParamEnum.DIAGNOSE_VERSION_COPY_INSERT, newVersion,newVersionConfList); | |
| 143 | + } | |
| 144 | + return tag; | |
| 145 | + } | |
| 146 | + | |
| 147 | + | |
| 148 | + /** | |
| 149 | + * <li>@Description:插入一个新版本,用于中心复制版本,节点插入该版本 | |
| 150 | + * <li>@param newVersion | |
| 151 | + * <li>@param newVersionConfList | |
| 152 | + * <li>@return | |
| 153 | + * <li>创建人:方承 | |
| 154 | + * <li>创建时间:2017年5月4日 | |
| 155 | + * <li>修改人: | |
| 156 | + * <li>修改时间: | |
| 157 | + */ | |
| 158 | + @Transactional | |
| 159 | + private Integer copyInsert(DiagnoseVersion newVersion,List<DiagnoseConf> newVersionConfList){ | |
| 160 | + Integer tag = baseMapper.insert(newVersion); | |
| 161 | + for(DiagnoseConf conf : newVersionConfList){ | |
| 111 | 162 | confMapper.insert(conf); |
| 112 | 163 | } |
| 113 | 164 | return tag; |
parent/base.common/src/main/java/com/lyms/base/common/service/conf/impl/HighriskConfServiceImpl.java
View file @
ec6cdc6
| ... | ... | @@ -13,7 +13,9 @@ |
| 13 | 13 | import com.lyms.base.common.dao.conf.HighriskConfMapper; |
| 14 | 14 | import com.lyms.base.common.entity.conf.HighriskConf; |
| 15 | 15 | import com.lyms.base.common.enums.StatusEnum; |
| 16 | +import com.lyms.base.common.enums.SyncParamEnum; | |
| 16 | 17 | import com.lyms.base.common.service.conf.HighriskConfService; |
| 18 | +import com.lyms.base.common.utils.SyncComponent; | |
| 17 | 19 | import com.lyms.exception.SystemException; |
| 18 | 20 | import com.lyms.util.StrUtils; |
| 19 | 21 | |
| ... | ... | @@ -32,11 +34,36 @@ |
| 32 | 34 | @Autowired |
| 33 | 35 | private HighriskConfMapper confMapper; |
| 34 | 36 | |
| 35 | - @Override | |
| 36 | - @Transactional | |
| 37 | - public Integer deleteLogicById(Serializable id) { | |
| 38 | - return null; | |
| 39 | - } | |
| 37 | + @Autowired | |
| 38 | + private SyncComponent syncComponent; | |
| 39 | + | |
| 40 | + public Integer deleteLogicById(Serializable id){ | |
| 41 | + Integer tag = baseMapper.deleteLogicById(id); | |
| 42 | + if(tag > 0){ | |
| 43 | + syncComponent.addPushSyncOperation(SyncParamEnum.HIGHRISK_CONF_DELETE, id); | |
| 44 | + } | |
| 45 | + return tag; | |
| 46 | + } | |
| 47 | + | |
| 48 | + @Override | |
| 49 | + public boolean insert(HighriskConf entity) { | |
| 50 | + String id = StrUtils.uuid(); | |
| 51 | + entity.setId(id); | |
| 52 | + boolean tag = super.insert(entity); | |
| 53 | + if(tag){ | |
| 54 | + syncComponent.addPushSyncOperation(SyncParamEnum.HIGHRISK_CONF_INSERT, entity); | |
| 55 | + } | |
| 56 | + return tag; | |
| 57 | + } | |
| 58 | + | |
| 59 | + @Override | |
| 60 | + public boolean updateById(HighriskConf entity) { | |
| 61 | + boolean tag = super.updateById(entity); | |
| 62 | + if(tag){ | |
| 63 | + syncComponent.addPushSyncOperation(SyncParamEnum.HIGHRISK_CONF_UPDATE, entity); | |
| 64 | + } | |
| 65 | + return tag; | |
| 66 | + } | |
| 40 | 67 | |
| 41 | 68 | private void throwCheckException(HighriskConf highriskConf) throws SystemException { |
| 42 | 69 | if (highriskConf == null) { |
parent/base.common/src/main/java/com/lyms/base/common/service/conf/impl/HighriskSourceServiceImpl.java
View file @
ec6cdc6
| ... | ... | @@ -11,7 +11,9 @@ |
| 11 | 11 | import com.lyms.base.common.dao.conf.HighriskSourceMapper; |
| 12 | 12 | import com.lyms.base.common.entity.conf.HighriskSource; |
| 13 | 13 | import com.lyms.base.common.enums.StatusEnum; |
| 14 | +import com.lyms.base.common.enums.SyncParamEnum; | |
| 14 | 15 | import com.lyms.base.common.service.conf.HighriskSourceService; |
| 16 | +import com.lyms.base.common.utils.SyncComponent; | |
| 15 | 17 | import com.lyms.exception.SystemException; |
| 16 | 18 | import com.lyms.util.StrUtils; |
| 17 | 19 | |
| ... | ... | @@ -30,10 +32,36 @@ |
| 30 | 32 | @Autowired |
| 31 | 33 | private HighriskSourceMapper sourceMapper; |
| 32 | 34 | |
| 33 | - @Override | |
| 34 | - public Integer deleteLogicById(Serializable id) { | |
| 35 | - return null; | |
| 36 | - } | |
| 35 | + @Autowired | |
| 36 | + private SyncComponent syncComponent; | |
| 37 | + | |
| 38 | + public Integer deleteLogicById(Serializable id){ | |
| 39 | + Integer tag = baseMapper.deleteLogicById(id); | |
| 40 | + if(tag > 0){ | |
| 41 | + syncComponent.addPushSyncOperation(SyncParamEnum.HIGHRISK_SOURCE_DELETE, id); | |
| 42 | + } | |
| 43 | + return tag; | |
| 44 | + } | |
| 45 | + | |
| 46 | + @Override | |
| 47 | + public boolean insert(HighriskSource entity) { | |
| 48 | + String id = StrUtils.uuid(); | |
| 49 | + entity.setId(id); | |
| 50 | + boolean tag = super.insert(entity); | |
| 51 | + if(tag){ | |
| 52 | + syncComponent.addPushSyncOperation(SyncParamEnum.HIGHRISK_SOURCE_INSERT, entity); | |
| 53 | + } | |
| 54 | + return tag; | |
| 55 | + } | |
| 56 | + | |
| 57 | + @Override | |
| 58 | + public boolean updateById(HighriskSource entity) { | |
| 59 | + boolean tag = super.updateById(entity); | |
| 60 | + if(tag){ | |
| 61 | + syncComponent.addPushSyncOperation(SyncParamEnum.HIGHRISK_SOURCE_UPDATE, entity); | |
| 62 | + } | |
| 63 | + return tag; | |
| 64 | + } | |
| 37 | 65 | |
| 38 | 66 | private void throwCheckException(HighriskSource highriskSource) throws SystemException { |
| 39 | 67 | if (highriskSource == null) { |
parent/base.common/src/main/java/com/lyms/base/common/service/conf/impl/HighriskVersionServiceImpl.java
View file @
ec6cdc6
| ... | ... | @@ -14,9 +14,11 @@ |
| 14 | 14 | import com.lyms.base.common.entity.conf.HighriskConf; |
| 15 | 15 | import com.lyms.base.common.entity.conf.HighriskVersion; |
| 16 | 16 | import com.lyms.base.common.enums.StatusEnum; |
| 17 | +import com.lyms.base.common.enums.SyncParamEnum; | |
| 17 | 18 | import com.lyms.base.common.service.conf.HighriskVersionService; |
| 19 | +import com.lyms.base.common.utils.SyncComponent; | |
| 18 | 20 | import com.lyms.exception.SystemException; |
| 19 | -import com.lyms.util.DateTimeUtils; | |
| 21 | +import com.lyms.util.InstanceUtils; | |
| 20 | 22 | import com.lyms.util.StrUtils; |
| 21 | 23 | |
| 22 | 24 | /** |
| 23 | 25 | |
| ... | ... | @@ -36,11 +38,37 @@ |
| 36 | 38 | @Autowired |
| 37 | 39 | private HighriskConfMapper confMapper; |
| 38 | 40 | |
| 39 | - @Override | |
| 40 | - public Integer deleteLogicById(Serializable id) { | |
| 41 | - return null; | |
| 42 | - } | |
| 41 | + @Autowired | |
| 42 | + private SyncComponent syncComponent; | |
| 43 | + | |
| 44 | + public Integer deleteLogicById(Serializable id){ | |
| 45 | + Integer tag = baseMapper.deleteLogicById(id); | |
| 46 | + if(tag > 0){ | |
| 47 | + syncComponent.addPushSyncOperation(SyncParamEnum.HIGHRISK_VERSION_DELETE, id); | |
| 48 | + } | |
| 49 | + return tag; | |
| 50 | + } | |
| 43 | 51 | |
| 52 | + @Override | |
| 53 | + public boolean insert(HighriskVersion entity) { | |
| 54 | + String id = StrUtils.uuid(); | |
| 55 | + entity.setId(id); | |
| 56 | + boolean tag = super.insert(entity); | |
| 57 | + if(tag){ | |
| 58 | + syncComponent.addPushSyncOperation(SyncParamEnum.HIGHRISK_VERSION_INSERT, entity); | |
| 59 | + } | |
| 60 | + return tag; | |
| 61 | + } | |
| 62 | + | |
| 63 | + @Override | |
| 64 | + public boolean updateById(HighriskVersion entity) { | |
| 65 | + boolean tag = super.updateById(entity); | |
| 66 | + if(tag){ | |
| 67 | + syncComponent.addPushSyncOperation(SyncParamEnum.HIGHRISK_VERSION_UPDATE, entity); | |
| 68 | + } | |
| 69 | + return tag; | |
| 70 | + } | |
| 71 | + | |
| 44 | 72 | @Override |
| 45 | 73 | @Transactional |
| 46 | 74 | public boolean enable(Serializable id) { |
| 47 | 75 | |
| 48 | 76 | |
| 49 | 77 | |
| ... | ... | @@ -96,18 +124,41 @@ |
| 96 | 124 | |
| 97 | 125 | @Override |
| 98 | 126 | @Transactional |
| 99 | - public Integer copy(Serializable id) { | |
| 127 | + public Integer copy(Serializable id,String versionName) { | |
| 100 | 128 | HighriskVersion version = baseMapper.selectById(id); |
| 101 | 129 | HighriskVersion newVersion = new HighriskVersion(); |
| 102 | - String time = DateTimeUtils.getDateTime("yyyy_MM_dd_HH_mm_ss"); | |
| 103 | - String versionId = time; | |
| 104 | - newVersion.setId(versionId); | |
| 105 | - newVersion.setName(version.getName()+time); | |
| 130 | + String newVersionId = StrUtils.uuid(); | |
| 131 | + newVersion.setId(newVersionId); | |
| 132 | + newVersion.setName(versionName); | |
| 106 | 133 | Integer tag = baseMapper.insert(newVersion); |
| 107 | 134 | List<HighriskConf> confList = confMapper.selectList(new EntityWrapper<HighriskConf>().where("version_id={0}", version.getId())); |
| 135 | + List<HighriskConf> newVersionConfList = InstanceUtils.newArrayList(); | |
| 108 | 136 | for(HighriskConf conf : confList){ |
| 109 | 137 | conf.setId(StrUtils.uuid()); |
| 110 | - conf.setVersionId(versionId); | |
| 138 | + conf.setVersionId(newVersionId); | |
| 139 | + confMapper.insert(conf); | |
| 140 | + newVersionConfList.add(conf); | |
| 141 | + } | |
| 142 | + if(tag >= 0){ | |
| 143 | + syncComponent.addPushSyncOperation(SyncParamEnum.HIGHRISK_VERSION_COPY_INSERT, newVersion,newVersionConfList); | |
| 144 | + } | |
| 145 | + return tag; | |
| 146 | + } | |
| 147 | + | |
| 148 | + /** | |
| 149 | + * <li>@Description:插入一个新版本,用于中心复制版本,节点插入该版本 | |
| 150 | + * <li>@param newVersion | |
| 151 | + * <li>@param newVersionConfList | |
| 152 | + * <li>@return | |
| 153 | + * <li>创建人:方承 | |
| 154 | + * <li>创建时间:2017年5月4日 | |
| 155 | + * <li>修改人: | |
| 156 | + * <li>修改时间: | |
| 157 | + */ | |
| 158 | + @Transactional | |
| 159 | + private Integer copyInsert(HighriskVersion newVersion,List<HighriskConf> newVersionConfList){ | |
| 160 | + Integer tag = baseMapper.insert(newVersion); | |
| 161 | + for(HighriskConf conf : newVersionConfList){ | |
| 111 | 162 | confMapper.insert(conf); |
| 112 | 163 | } |
| 113 | 164 | return tag; |
parent/base.common/src/main/java/com/lyms/base/common/service/organ/OrganizationsService.java
View file @
ec6cdc6
| ... | ... | @@ -3,7 +3,6 @@ |
| 3 | 3 | import java.io.Serializable; |
| 4 | 4 | |
| 5 | 5 | import com.baomidou.mybatisplus.plugins.Page; |
| 6 | -import com.lyms.base.common.entity.organ.OrganGroup; | |
| 7 | 6 | import com.lyms.base.common.entity.organ.Organizations; |
| 8 | 7 | import com.lyms.exception.SystemException; |
| 9 | 8 | import com.lyms.web.service.BaseService; |
parent/base.common/src/main/java/com/lyms/base/common/service/organ/SysOrganizationsConfService.java
View file @
ec6cdc6
parent/base.common/src/main/java/com/lyms/base/common/service/organ/impl/OrganGroupServiceImpl.java
View file @
ec6cdc6
| ... | ... | @@ -15,7 +15,6 @@ |
| 15 | 15 | import com.lyms.base.common.entity.organ.OrganGroup; |
| 16 | 16 | import com.lyms.base.common.entity.organ.OrganGroupMaps; |
| 17 | 17 | import com.lyms.base.common.enums.SyncParamEnum; |
| 18 | -import com.lyms.base.common.service.organ.OrganGroupMapsService; | |
| 19 | 18 | import com.lyms.base.common.service.organ.OrganGroupService; |
| 20 | 19 | import com.lyms.base.common.utils.SyncComponent; |
| 21 | 20 | import com.lyms.exception.SystemException; |
parent/base.common/src/main/java/com/lyms/base/common/service/organ/impl/SysOrganizationsConfServiceImpl.java
View file @
ec6cdc6
| 1 | 1 | package com.lyms.base.common.service.organ.impl; |
| 2 | 2 | |
| 3 | -import com.lyms.base.common.entity.organ.SysOrganizationsConf; | |
| 3 | +import java.io.Serializable; | |
| 4 | + | |
| 5 | +import org.springframework.stereotype.Service; | |
| 6 | + | |
| 7 | +import com.baomidou.mybatisplus.service.impl.ServiceImpl; | |
| 4 | 8 | import com.lyms.base.common.dao.organ.SysOrganizationsConfMapper; |
| 9 | +import com.lyms.base.common.entity.organ.SysOrganizationsConf; | |
| 5 | 10 | import com.lyms.base.common.service.organ.SysOrganizationsConfService; |
| 6 | -import com.baomidou.mybatisplus.service.impl.ServiceImpl; | |
| 7 | -import org.springframework.stereotype.Service; | |
| 8 | -import java.io.Serializable; | |
| 9 | -import java.util.List; | |
| 10 | -import java.util.Map; | |
| 11 | 11 | |
| 12 | 12 | /** |
| 13 | 13 | * <p> |
parent/base.common/src/main/java/com/lyms/base/common/service/role/impl/RolesServiceImpl.java
View file @
ec6cdc6
| ... | ... | @@ -8,6 +8,7 @@ |
| 8 | 8 | import org.springframework.transaction.annotation.Transactional; |
| 9 | 9 | |
| 10 | 10 | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| 11 | +import com.baomidou.mybatisplus.mapper.SqlHelper; | |
| 11 | 12 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| 12 | 13 | import com.lyms.base.common.dao.role.RolesMapper; |
| 13 | 14 | import com.lyms.base.common.entity.role.RolePermissionMaps; |
| 14 | 15 | |
| 15 | 16 | |
| ... | ... | @@ -36,17 +37,21 @@ |
| 36 | 37 | |
| 37 | 38 | public Integer deleteLogicById(Serializable id) { |
| 38 | 39 | Integer tag = baseMapper.deleteLogicById(id); |
| 39 | - syncComponent.addPushSyncOperation(SyncParamEnum.ROLE_DELETE, id); | |
| 40 | + if(tag > 0 ){ | |
| 41 | + syncComponent.addPushSyncOperation(SyncParamEnum.ROLE_DELETE, id); | |
| 42 | + } | |
| 40 | 43 | return tag; |
| 41 | 44 | } |
| 42 | 45 | |
| 43 | 46 | @Override |
| 44 | 47 | @Transactional |
| 45 | 48 | public boolean createRole(Roles role, List<RolePermissionMaps> rpList) { |
| 46 | - baseMapper.insert(role); | |
| 49 | + Integer tag = baseMapper.insert(role); | |
| 47 | 50 | sysRolePermissionMapsService.insertBatch(rpList); |
| 48 | - syncComponent.addPushSyncOperation(SyncParamEnum.ROLE_INSERT, role,rpList); | |
| 49 | - return true; | |
| 51 | + if(tag > 0 ){ | |
| 52 | + syncComponent.addPushSyncOperation(SyncParamEnum.ROLE_INSERT, role,rpList); | |
| 53 | + } | |
| 54 | + return SqlHelper.retBool(tag); | |
| 50 | 55 | } |
| 51 | 56 | |
| 52 | 57 | @Override |
| 53 | 58 | |
| ... | ... | @@ -54,12 +59,14 @@ |
| 54 | 59 | public boolean updateRole(Roles role, List<RolePermissionMaps> rpList) { |
| 55 | 60 | EntityWrapper<RolePermissionMaps> ew = new EntityWrapper<RolePermissionMaps>(); |
| 56 | 61 | ew.where("role_id={0}", role.getId()); |
| 57 | - baseMapper.updateById(role); | |
| 62 | + Integer tag = baseMapper.updateById(role); | |
| 58 | 63 | sysRolePermissionMapsService.delete(ew); |
| 59 | 64 | if (!rpList.isEmpty()) { |
| 60 | 65 | sysRolePermissionMapsService.insertBatch(rpList); |
| 61 | 66 | } |
| 62 | - syncComponent.addPushSyncOperation(SyncParamEnum.ROLE_UPDATE, role,rpList); | |
| 67 | + if(tag > 0 ){ | |
| 68 | + syncComponent.addPushSyncOperation(SyncParamEnum.ROLE_UPDATE, role,rpList); | |
| 69 | + } | |
| 63 | 70 | return true; |
| 64 | 71 | } |
| 65 | 72 |
parent/base.common/src/main/java/com/lyms/base/common/service/sys/SyncDataBasicService.java
View file @
ec6cdc6
| 1 | +package com.lyms.base.common.service.sys; | |
| 2 | + | |
| 3 | +import java.io.Serializable; | |
| 4 | +import java.util.List; | |
| 5 | + | |
| 6 | +import com.lyms.base.common.entity.sys.SyncDataBasic; | |
| 7 | +import com.lyms.base.common.enums.SyncParamEnum; | |
| 8 | +import com.lyms.sync.channel.ChannelData; | |
| 9 | +import com.lyms.web.service.BaseService; | |
| 10 | + | |
| 11 | +/** | |
| 12 | + * <p> | |
| 13 | + * 数据同步模块 | |
| 14 | + * </p> | |
| 15 | + * | |
| 16 | + * @author maliang | |
| 17 | + * @since 2017-03-15 | |
| 18 | + */ | |
| 19 | +public interface SyncDataBasicService extends BaseService<SyncDataBasic> { | |
| 20 | + | |
| 21 | + /** | |
| 22 | + * <li>@Description:逻辑删除,ifDel = 1 为删除,否则为没有删除 | |
| 23 | + * <li>@param id 删除主键id | |
| 24 | + * <li>@return 大于0修改成功,否则为失败 | |
| 25 | + */ | |
| 26 | + public Integer deleteLogicById(Serializable id); | |
| 27 | + | |
| 28 | + /** | |
| 29 | + * <li>@Description:更新同步成功的数据 | |
| 30 | + * <li>@param ids | |
| 31 | + * <li>@return | |
| 32 | + * <li>创建人:maliang | |
| 33 | + * <li>创建时间:2017年3月15日 | |
| 34 | + * <li>修改人: | |
| 35 | + * <li>修改时间: | |
| 36 | + */ | |
| 37 | + public Boolean updateBasic(List<Serializable> ids); | |
| 38 | + | |
| 39 | + /** | |
| 40 | + * 获取一条数据 | |
| 41 | + * <li>@Description:TODO(方法描述) | |
| 42 | + * <li>@return | |
| 43 | + * <li>创建人:maliang | |
| 44 | + * <li>创建时间:2017年3月15日 | |
| 45 | + * <li>修改人: | |
| 46 | + * <li>修改时间: | |
| 47 | + */ | |
| 48 | + public ChannelData selectOne(); | |
| 49 | + | |
| 50 | + public Boolean updateBasic(Serializable id); | |
| 51 | + /** | |
| 52 | + * <li>@Description:向同步库插入一个需要提交给center的同步任务 | |
| 53 | + * <li>@param syncParamConf | |
| 54 | + * <li>@param dataObjects 对象方法参数列表 | |
| 55 | + * <li>@return | |
| 56 | + * <li>创建人:方承 | |
| 57 | + * <li>创建时间:2017年4月11日 | |
| 58 | + * <li>修改人: | |
| 59 | + * <li>修改时间: | |
| 60 | + */ | |
| 61 | + public boolean addSyncData(SyncParamEnum syncParamConf,Object ...dataObjects); | |
| 62 | + | |
| 63 | +} |
parent/base.common/src/main/java/com/lyms/base/common/service/sys/impl/SyncDataBasicServiceImpl.java
View file @
ec6cdc6
| 1 | +package com.lyms.base.common.service.sys.impl; | |
| 2 | + | |
| 3 | +import java.io.Serializable; | |
| 4 | +import java.util.Date; | |
| 5 | +import java.util.List; | |
| 6 | + | |
| 7 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 8 | +import org.springframework.stereotype.Service; | |
| 9 | +import org.springframework.transaction.annotation.Transactional; | |
| 10 | + | |
| 11 | +import com.baomidou.mybatisplus.mapper.EntityWrapper; | |
| 12 | +import com.baomidou.mybatisplus.service.impl.ServiceImpl; | |
| 13 | +import com.lyms.base.common.dao.sys.SyncDataBasicMapper; | |
| 14 | +import com.lyms.base.common.entity.sys.SyncDataBasic; | |
| 15 | +import com.lyms.base.common.enums.SyncParamEnum; | |
| 16 | +import com.lyms.base.common.service.sys.SyncDataBasicService; | |
| 17 | +import com.lyms.sync.ParamsAdpter; | |
| 18 | +import com.lyms.sync.channel.ChannelData; | |
| 19 | +import com.lyms.util.JsonUtils; | |
| 20 | +import com.lyms.util.StrUtils; | |
| 21 | + | |
| 22 | +/** | |
| 23 | + * <p> | |
| 24 | + * 用户、角色、权限、医院、部门等基础数据同步 服务实现类 | |
| 25 | + * </p> | |
| 26 | + * | |
| 27 | + * @author maliang | |
| 28 | + * @since 2017-03-15 | |
| 29 | + */ | |
| 30 | +@Service | |
| 31 | +public class SyncDataBasicServiceImpl extends ServiceImpl<SyncDataBasicMapper, SyncDataBasic> | |
| 32 | + implements SyncDataBasicService { | |
| 33 | + | |
| 34 | + @Autowired | |
| 35 | + private SyncDataBasicMapper basicMapper; | |
| 36 | + | |
| 37 | + public Integer deleteLogicById(Serializable id) { | |
| 38 | + return baseMapper.deleteLogicById(id); | |
| 39 | + } | |
| 40 | + | |
| 41 | + @Override | |
| 42 | + @Transactional | |
| 43 | + public Boolean updateBasic(List<Serializable> ids) { | |
| 44 | + Integer tag = basicMapper.updateBatchByIds(ids); | |
| 45 | + return tag >= 1 ? Boolean.TRUE : Boolean.FALSE; | |
| 46 | + } | |
| 47 | + | |
| 48 | + @Override | |
| 49 | + public Boolean updateBasic(Serializable id) { | |
| 50 | + SyncDataBasic dataBasic = baseMapper.selectById(id); | |
| 51 | + dataBasic.setIfsuc(1); | |
| 52 | + Integer tag = baseMapper.updateById(dataBasic); | |
| 53 | + return tag >= 1; | |
| 54 | + } | |
| 55 | + | |
| 56 | + @Override | |
| 57 | + public ChannelData selectOne() { | |
| 58 | + EntityWrapper<SyncDataBasic> ew = new EntityWrapper<SyncDataBasic>(); | |
| 59 | + ew.where("ifsuc=0"); | |
| 60 | + List<SyncDataBasic> datas = baseMapper.selectList(ew); | |
| 61 | + | |
| 62 | + // 单条同步,避免过于复杂的消息回执 | |
| 63 | + SyncDataBasic basic = datas != null && datas.size() > 0 ? datas.get(0) : null; | |
| 64 | + if (basic != null) { | |
| 65 | + ChannelData data = JsonUtils.jsonToBean(basic.getData(), ChannelData.class); | |
| 66 | + return data; | |
| 67 | + } | |
| 68 | + return ChannelData.emtpy(); | |
| 69 | + } | |
| 70 | + | |
| 71 | + @Override | |
| 72 | + public boolean addSyncData(SyncParamEnum syncParamConf, Object... dataObjects) { | |
| 73 | + SyncDataBasic entity = new SyncDataBasic(); | |
| 74 | + String uid = StrUtils.uuid(); | |
| 75 | + entity.setId(uid); | |
| 76 | + Date now = new Date(); | |
| 77 | + entity.setCreateTime(now); | |
| 78 | + | |
| 79 | + ChannelData cdata = new ChannelData(); | |
| 80 | + cdata.setAck(true); | |
| 81 | + ParamsAdpter adpter = ParamsAdpter.builder(); | |
| 82 | + for(Object param : dataObjects){ | |
| 83 | + adpter.push(param); | |
| 84 | + } | |
| 85 | + cdata.setData(adpter.toJsonString()); | |
| 86 | + cdata.setId(uid); | |
| 87 | + cdata.setLoop(false); | |
| 88 | + cdata.setRemoteClazz(syncParamConf.getRemoteClazz()); | |
| 89 | + cdata.setRemoteMethod(syncParamConf.getRemoteMethod()); | |
| 90 | + cdata.setTs(now.getTime()); | |
| 91 | + | |
| 92 | + entity.setData(cdata.toJsonString()); | |
| 93 | + Integer tag = baseMapper.insert(entity); | |
| 94 | + return tag >= 1 ? true : false; | |
| 95 | + } | |
| 96 | + | |
| 97 | +} |
parent/base.common/src/main/java/com/lyms/base/common/service/user/impl/UsersServiceImpl.java
View file @
ec6cdc6
| ... | ... | @@ -87,15 +87,16 @@ |
| 87 | 87 | this.initPwd(user); |
| 88 | 88 | |
| 89 | 89 | Integer tag = userMapper.insert(user); |
| 90 | - | |
| 91 | - String[] dataPermissionArray = user.getDataOrgIds().split(","); | |
| 92 | - if (dataPermissionArray != null && dataPermissionArray.length > 0) { | |
| 93 | - for (String orgid : dataPermissionArray) { | |
| 94 | - SysUserDataPermissions dataEntity = new SysUserDataPermissions(); | |
| 95 | - dataEntity.setId(StrUtils.uuid()); | |
| 96 | - dataEntity.setOrgId(orgid); | |
| 97 | - dataEntity.setUserId(user.getId()); | |
| 98 | - sysUserDataPermissionsMapper.insert(dataEntity); | |
| 90 | + if(StrUtils.isNotEmpty(user.getDataOrgIds())){ | |
| 91 | + String[] dataPermissionArray = user.getDataOrgIds().split(","); | |
| 92 | + if (dataPermissionArray != null && dataPermissionArray.length > 0) { | |
| 93 | + for (String orgid : dataPermissionArray) { | |
| 94 | + SysUserDataPermissions dataEntity = new SysUserDataPermissions(); | |
| 95 | + dataEntity.setId(StrUtils.uuid()); | |
| 96 | + dataEntity.setOrgId(orgid); | |
| 97 | + dataEntity.setUserId(user.getId()); | |
| 98 | + sysUserDataPermissionsMapper.insert(dataEntity); | |
| 99 | + } | |
| 99 | 100 | } |
| 100 | 101 | } |
| 101 | 102 | if (userRoleMapsList != null && !userRoleMapsList.isEmpty()) { |
parent/base.common/src/main/java/com/lyms/base/common/utils/SyncComponent.java
View file @
ec6cdc6
| ... | ... | @@ -5,13 +5,15 @@ |
| 5 | 5 | import org.slf4j.Logger; |
| 6 | 6 | import org.slf4j.LoggerFactory; |
| 7 | 7 | import org.springframework.beans.factory.annotation.Autowired; |
| 8 | +import org.springframework.beans.factory.annotation.Value; | |
| 8 | 9 | import org.springframework.stereotype.Component; |
| 9 | 10 | |
| 11 | +import com.alibaba.fastjson.JSONObject; | |
| 10 | 12 | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| 11 | -import com.lyms.base.common.conf.SyncConf; | |
| 12 | 13 | import com.lyms.base.common.entity.organ.OrganGroup; |
| 13 | 14 | import com.lyms.base.common.enums.SyncParamEnum; |
| 14 | 15 | import com.lyms.base.common.service.organ.OrganGroupService; |
| 16 | +import com.lyms.base.common.service.sys.SyncDataBasicService; | |
| 15 | 17 | import com.lyms.sync.ParamsAdpter; |
| 16 | 18 | import com.lyms.sync.SyncCenter; |
| 17 | 19 | import com.lyms.util.CollectionUtils; |
| ... | ... | @@ -28,7 +30,15 @@ |
| 28 | 30 | |
| 29 | 31 | @Autowired |
| 30 | 32 | private OrganGroupService organGroupService; |
| 31 | - | |
| 33 | + @Autowired | |
| 34 | + private SyncDataBasicService syncDataBasicService; | |
| 35 | + | |
| 36 | + @Value("${isCenterOperateSyncToNode}") | |
| 37 | + private boolean isCenterOperateSyncToNode; | |
| 38 | + | |
| 39 | + @SuppressWarnings("unused") | |
| 40 | + private boolean isNodeOperateSyncToCenter = false; | |
| 41 | + | |
| 32 | 42 | private List<String> getAllGroupIpList() { |
| 33 | 43 | List<String> ipList = InstanceUtils.newArrayList(); |
| 34 | 44 | List<OrganGroup> list = organGroupService.selectList(new EntityWrapper<OrganGroup>().where("ifDel=0")); |
| ... | ... | @@ -53,8 +63,7 @@ |
| 53 | 63 | * <li>修改时间: |
| 54 | 64 | */ |
| 55 | 65 | public boolean addPushSyncOperation(SyncParamEnum syncParamConf, Object... data) { |
| 56 | - if(SyncConf.isCenterOperateSyncToNode){ | |
| 57 | - log.debug("添加推送队列"); | |
| 66 | + if(isCenterOperateSyncToNode){ | |
| 58 | 67 | List<String> ipList = getAllGroupIpList(); |
| 59 | 68 | ParamsAdpter adpter = null; |
| 60 | 69 | if (data != null && data.length > 0) { |
| ... | ... | @@ -65,6 +74,7 @@ |
| 65 | 74 | } |
| 66 | 75 | for (String ip : ipList) { |
| 67 | 76 | String id = StrUtils.uuid(); |
| 77 | + log.info("====》 添加推送队列:【{}】【{}】【{}】【{}】",ip,syncParamConf.getRemoteClazz(),syncParamConf.getRemoteMethod(),JSONObject.toJSONString(adpter)); | |
| 68 | 78 | center.pushTmp(id, ip, syncParamConf.getRemoteClazz(), syncParamConf.getRemoteMethod(), adpter); |
| 69 | 79 | } |
| 70 | 80 | return true; |
parent/center.manager/src/main/java/com/lyms/cm/controller/conf/DiagnoseVersionController.java
View file @
ec6cdc6
| ... | ... | @@ -123,10 +123,12 @@ |
| 123 | 123 | * |
| 124 | 124 | * @return |
| 125 | 125 | */ |
| 126 | - @RequestMapping(value = "/{id}/copy", method = { RequestMethod.GET, RequestMethod.POST }) | |
| 126 | + @RequestMapping(value = "/copy", method = { RequestMethod.GET, RequestMethod.POST }) | |
| 127 | 127 | @ResponseBody |
| 128 | - public AjaxResult copy(@PathVariable String id, AjaxResult ajaxResult){ | |
| 129 | - int tag = diagnoseVersionService.copy(id); | |
| 128 | + public AjaxResult copy(AjaxResult ajaxResult){ | |
| 129 | + String id = getParameter("perId"); | |
| 130 | + String versionName = getParameter("versionName"); | |
| 131 | + int tag = diagnoseVersionService.copy(id,versionName); | |
| 130 | 132 | return handleAjaxResult(ajaxResult, tag, "复制"); |
| 131 | 133 | } |
| 132 | 134 |
parent/center.manager/src/main/java/com/lyms/cm/controller/conf/HighriskVersionController.java
View file @
ec6cdc6
| ... | ... | @@ -123,10 +123,12 @@ |
| 123 | 123 | * |
| 124 | 124 | * @return |
| 125 | 125 | */ |
| 126 | - @RequestMapping(value = "/{id}/copy", method = { RequestMethod.GET, RequestMethod.POST }) | |
| 126 | + @RequestMapping(value = "/copy", method = { RequestMethod.GET, RequestMethod.POST }) | |
| 127 | 127 | @ResponseBody |
| 128 | - public AjaxResult copy(@PathVariable String id, AjaxResult ajaxResult){ | |
| 129 | - int tag = highriskVersionService.copy(id); | |
| 128 | + public AjaxResult copy(AjaxResult ajaxResult){ | |
| 129 | + String id = getParameter("perId"); | |
| 130 | + String versionName = getParameter("versionName"); | |
| 131 | + int tag = highriskVersionService.copy(id,versionName); | |
| 130 | 132 | return handleAjaxResult(ajaxResult, tag, "复制"); |
| 131 | 133 | } |
| 132 | 134 |
parent/center.manager/src/main/java/com/lyms/cm/job/SyncFixJob.java
View file @
ec6cdc6
| ... | ... | @@ -14,6 +14,7 @@ |
| 14 | 14 | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| 15 | 15 | import com.lyms.base.common.entity.organ.OrganGroup; |
| 16 | 16 | import com.lyms.base.common.service.organ.OrganGroupService; |
| 17 | +import com.lyms.base.common.service.sys.impl.SyncDataBasicServiceImpl; | |
| 17 | 18 | import com.lyms.sync.ParamsAdpter; |
| 18 | 19 | import com.lyms.sync.SyncCallback; |
| 19 | 20 | import com.lyms.sync.SyncCenter; |
| ... | ... | @@ -46,7 +47,7 @@ |
| 46 | 47 | |
| 47 | 48 | private static List<String> pullUrlList = null; |
| 48 | 49 | |
| 49 | - private static String remoteClazz = "com.lyms.hospital.service.sys.impl.SyncDataBasicServiceImpl"; | |
| 50 | + private static String remoteClazz = SyncDataBasicServiceImpl.class.getName(); | |
| 50 | 51 | private static String remoteMethod = "selectOne"; |
| 51 | 52 | |
| 52 | 53 | private final AtomicBoolean reset = new AtomicBoolean(false); |
| ... | ... | @@ -60,7 +61,7 @@ |
| 60 | 61 | pullUrlList = InstanceUtils.newArrayList(); |
| 61 | 62 | for(OrganGroup entity : groupList){ |
| 62 | 63 | if(StrUtils.isNotEmpty(entity.getPulladdress()) && entity.getPulladdress().startsWith("http")){ |
| 63 | - LOG.info("添加固定拉取远程任务:pullAddress={}",entity.getPulladdress()); | |
| 64 | + LOG.info("添加固定拉取远程任务:医院组={},pullAddress={}",entity.getName(),entity.getPulladdress()); | |
| 64 | 65 | if( !pullUrlList.contains(entity.getPulladdress().trim()) ){ |
| 65 | 66 | pullUrlList.add(entity.getPulladdress().trim()); |
| 66 | 67 | center.pushFix(StrUtils.uuid(), entity.getPulladdress().trim(), remoteClazz, remoteMethod, null); |
| ... | ... | @@ -73,7 +74,7 @@ |
| 73 | 74 | } |
| 74 | 75 | reset.set(true); |
| 75 | 76 | // 拉取远端数据 |
| 76 | - LOG.debug("执行拉取远程数据任务..."); | |
| 77 | + //LOG.debug("执行拉取远程数据任务..."); | |
| 77 | 78 | final Work work = center.buildWork(); |
| 78 | 79 | try { |
| 79 | 80 | work.pullFix(new SyncCallback() { |
| 80 | 81 | |
| 81 | 82 | |
| 82 | 83 | |
| ... | ... | @@ -81,17 +82,19 @@ |
| 81 | 82 | public void callBack(Object object) { |
| 82 | 83 | if (object instanceof ChannelData) { |
| 83 | 84 | ChannelData oldData = (ChannelData) object; |
| 84 | - if (oldData != null && StringUtils.isNotBlank(oldData.getId())) { | |
| 85 | + if (oldData != null && StringUtils.isNotEmpty(oldData.getId())) { | |
| 85 | 86 | // 任务发送执行 |
| 86 | - LOG.info("拉取到本地任务: " + ToStringBuilder.reflectionToString(oldData)); | |
| 87 | + //LOG.info("拉取到本地任务: " + ToStringBuilder.reflectionToString(oldData)); | |
| 87 | 88 | String result = HttpUtils.REMOTE.post(oldData); |
| 88 | - LOG.info("返回结果: " + result); | |
| 89 | + //LOG.info("返回结果: " + result); | |
| 89 | 90 | if (StringUtils.isBlank(result)) |
| 90 | 91 | return; |
| 91 | 92 | ChannelData data = JsonUtils.jsonToBean(result, ChannelData.class); |
| 92 | 93 | // 处理回执消息 |
| 93 | 94 | if (data != null && data.getAck() && StrUtils.isNotEmpty(data.getRemoteClazz()) && StrUtils.isNotEmpty(data.getRemoteMethod())) { |
| 94 | 95 | // 拉取到数据执行本地方法 |
| 96 | + LOG.info("拉取到本地任务: " + ToStringBuilder.reflectionToString(oldData)); | |
| 97 | + LOG.info("返回结果: " + result); | |
| 95 | 98 | System.out.println("执行: " + ToStringBuilder.reflectionToString(data)); |
| 96 | 99 | Object handlResult = SyncHandler.handler(data); |
| 97 | 100 | // 要求处理成功都必须返回true | false; |
parent/center.manager/src/main/java/com/lyms/cm/job/SyncTmpJob.java
View file @
ec6cdc6
| ... | ... | @@ -35,7 +35,7 @@ |
| 35 | 35 | } |
| 36 | 36 | reset.set(true); |
| 37 | 37 | // 拉取远端数据 |
| 38 | - LOG.debug("执行推送远程数据任务..."); | |
| 38 | + //LOG.debug("执行推送远程数据任务..."); | |
| 39 | 39 | final Work work = center.buildWork(); |
| 40 | 40 | try { |
| 41 | 41 | work.pullTmp(new SyncCallback() { |
| 42 | 42 | |
| ... | ... | @@ -46,10 +46,14 @@ |
| 46 | 46 | if (model != null) { |
| 47 | 47 | // 任务发送执行 |
| 48 | 48 | String result = HttpUtils.REMOTE.post(model); |
| 49 | + if(result == null){//远程无法访问等情况 | |
| 50 | + work.backPressure(); | |
| 51 | + return; | |
| 52 | + } | |
| 49 | 53 | model = JsonUtils.jsonToBean(result, ChannelData.class); |
| 50 | 54 | if (model != null && model.getAck()) { |
| 51 | - work.backPressure(); | |
| 52 | - } | |
| 55 | + work.backPressure(); | |
| 56 | + } | |
| 53 | 57 | } |
| 54 | 58 | } |
| 55 | 59 | } |
parent/center.manager/src/main/resources/dev/redis.properties
View file @
ec6cdc6
parent/center.manager/src/main/resources/xml/app-datasource.xml
View file @
ec6cdc6
| ... | ... | @@ -74,8 +74,7 @@ |
| 74 | 74 | <property name="dataSource" ref="dynamicDataSource" /> |
| 75 | 75 | <property name="plugins"> |
| 76 | 76 | <array> |
| 77 | - <bean id="paginationInterceptor" | |
| 78 | - class="com.baomidou.mybatisplus.plugins.PaginationInterceptor"> | |
| 77 | + <bean id="paginationInterceptor" class="com.baomidou.mybatisplus.plugins.PaginationInterceptor"> | |
| 79 | 78 | <property name="dialectType" value="mysql" /> |
| 80 | 79 | <!-- <property name="dialectClazz" value="com.baomidou.mybatisplus.plugins.pagination.dialects.MySqlDialect" /> --> |
| 81 | 80 | </bean> |
parent/center.manager/src/main/webapp/WEB-INF/views/conf/diagnose/version_list.html
View file @
ec6cdc6
| ... | ... | @@ -21,7 +21,7 @@ |
| 21 | 21 | <div id="toolbar"> |
| 22 | 22 | <button class="btn btn-info " type="button" onclick="add();"><i class="fa fa-plus"></i> 新增</button> |
| 23 | 23 | <button class="btn btn-info " type="button" onclick="edit();"><i class="fa fa-paste"></i> 编辑</button> |
| 24 | - <button class="btn btn-info " type="button" onclick="copy();"><i class="fa fa-paste"></i> 复制</button> | |
| 24 | + <button class="btn btn-info " type="button" onclick="copyVer();"><i class="fa fa-paste"></i> 复制</button> | |
| 25 | 25 | <!-- |
| 26 | 26 | <button class="btn btn-info " type="button" onclick="del();"><i class="fa fa-trash"></i> 删除</button> |
| 27 | 27 | --> |
| ... | ... | @@ -52,6 +52,36 @@ |
| 52 | 52 | if(id){ |
| 53 | 53 | fullWindow("修改诊断版本", APP.PATH + controllerRequestMappint + id + "/toEdit"); |
| 54 | 54 | } |
| 55 | +} | |
| 56 | + | |
| 57 | +function copyVer(){ | |
| 58 | + var val = getSingleSelectedValue("dataTable","id"); | |
| 59 | + if(val){ | |
| 60 | + var name = getSingleSelectedValue("dataTable","name"); | |
| 61 | + layer.open({ | |
| 62 | + type: 1 //Page层类型 | |
| 63 | + ,area: ['530px', '300px'] | |
| 64 | + ,title: '复制诊断版本' | |
| 65 | + ,shade: 0.6 //遮罩透明度 | |
| 66 | + ,maxmin: true //允许全屏最小化 | |
| 67 | + ,anim: 2 //0-6的动画形式,-1不开启 | |
| 68 | + ,content: "<div class='col-sm-11 col-sm-offset-1'>" + | |
| 69 | + "<form class='form-horizontal m-t navbar-form navbar-left' id='validForm'>" + | |
| 70 | + "<div class='form-group'><label class='col-sm-5 control-label'>将要复制的版本名称:</label><div class='col-sm-5'><input type='hidden' name='perId' value='"+val+"'/>" + | |
| 71 | + "<input type='text' class='form-control w-lg' value='"+name+"' disabled></div></div>" + | |
| 72 | + "<div class='form-group'><label class='col-sm-6 control-label'>版本名称:</label><div class='col-sm-5'>" + | |
| 73 | + "<input type='text' class='form-control w-lg' placeholder='版本名称' name='versionName' required></div></div>" + | |
| 74 | + "<div class='col-sm-offset-9'><a onclick='saveVersion()' class='btn btn-primary navbar-btn'>提交</a></div></form></div>" | |
| 75 | + }); | |
| 76 | + }else{ | |
| 77 | + msg("请选择需要复制的数据"); | |
| 78 | + } | |
| 79 | +} | |
| 80 | +function saveVersion(){ | |
| 81 | + if($('#validForm').valid()){ | |
| 82 | + var data = $('#validForm').serialize(); | |
| 83 | + ajaxPost(APP.PATH +'/diagnoseVersion/copy',data); | |
| 84 | + } | |
| 55 | 85 | } |
| 56 | 86 | function copy() { |
| 57 | 87 | var val = getSelectedValue("dataTable","id"); |
parent/center.manager/src/main/webapp/WEB-INF/views/conf/highrisk/version_list.html
View file @
ec6cdc6
| ... | ... | @@ -21,7 +21,7 @@ |
| 21 | 21 | <div id="toolbar"> |
| 22 | 22 | <button class="btn btn-info " type="button" onclick="add();"><i class="fa fa-plus"></i> 新增</button> |
| 23 | 23 | <button class="btn btn-info " type="button" onclick="edit();"><i class="fa fa-paste"></i> 编辑</button> |
| 24 | - <button class="btn btn-info " type="button" onclick="copy();"><i class="fa fa-paste"></i> 复制</button> | |
| 24 | + <button class="btn btn-info " type="button" onclick="copyVer();"><i class="fa fa-paste"></i> 复制</button> | |
| 25 | 25 | <!-- |
| 26 | 26 | <button class="btn btn-info " type="button" onclick="del();"><i class="fa fa-trash"></i> 删除</button> |
| 27 | 27 | --> |
| 28 | 28 | |
| 29 | 29 | |
| ... | ... | @@ -53,25 +53,36 @@ |
| 53 | 53 | fullWindow("修改高危版本", APP.PATH + controllerRequestMappint + id + "/toEdit"); |
| 54 | 54 | } |
| 55 | 55 | } |
| 56 | -function copy() { | |
| 57 | - var val = getSelectedValue("dataTable","id"); | |
| 56 | + | |
| 57 | +function copyVer(){ | |
| 58 | + var val = getSingleSelectedValue("dataTable","id"); | |
| 58 | 59 | if(val){ |
| 59 | - layer.confirm('确定复制选中的数据', { | |
| 60 | - btn: ['确定','取消'] //按钮 | |
| 61 | - }, function(){ | |
| 62 | - url = APP.PATH + controllerRequestMappint + val + "/copy"; | |
| 63 | - ajaxPost(url,null,function(r){ | |
| 64 | - if(r.success){ | |
| 65 | - reloadGrid("dataTable"); | |
| 66 | - } | |
| 67 | - msg(r.message); | |
| 68 | - }); | |
| 69 | - }, function(){ | |
| 70 | - | |
| 71 | - }); | |
| 60 | + var name = getSingleSelectedValue("dataTable","name"); | |
| 61 | + layer.open({ | |
| 62 | + type: 1 //Page层类型 | |
| 63 | + ,area: ['530px', '300px'] | |
| 64 | + ,title: '复制高危版本' | |
| 65 | + ,shade: 0.6 //遮罩透明度 | |
| 66 | + ,maxmin: true //允许全屏最小化 | |
| 67 | + ,anim: 2 //0-6的动画形式,-1不开启 | |
| 68 | + ,content: "<div class='col-sm-11 col-sm-offset-1'>" + | |
| 69 | + "<form class='form-horizontal m-t navbar-form navbar-left' id='validForm'>" + | |
| 70 | + "<div class='form-group'><label class='col-sm-5 control-label'>将要复制的版本名称:</label><div class='col-sm-5'><input type='hidden' name='perId' value='"+val+"'/>" + | |
| 71 | + "<input type='text' class='form-control w-lg' value='"+name+"' disabled></div></div>" + | |
| 72 | + "<div class='form-group'><label class='col-sm-6 control-label'>版本名称:</label><div class='col-sm-5'>" + | |
| 73 | + "<input type='text' class='form-control w-lg' placeholder='版本名称' name='versionName' required></div></div>" + | |
| 74 | + "<div class='col-sm-offset-9'><a onclick='saveVersion()' class='btn btn-primary navbar-btn'>提交</a></div></form></div>" | |
| 75 | + }); | |
| 72 | 76 | }else{ |
| 73 | 77 | msg("请选择需要复制的数据"); |
| 74 | 78 | } |
| 79 | +} | |
| 80 | + | |
| 81 | +function saveVersion(){ | |
| 82 | + if($('#validForm').valid()){ | |
| 83 | + var data = $('#validForm').serialize(); | |
| 84 | + ajaxPost(APP.PATH +'/highriskVersion/copy',data); | |
| 85 | + } | |
| 75 | 86 | } |
| 76 | 87 | |
| 77 | 88 | function del(){ |
parent/center.manager/src/test/java/center/manager/test/user/WorkTest.java
View file @
ec6cdc6
| ... | ... | @@ -4,6 +4,7 @@ |
| 4 | 4 | import org.junit.Test; |
| 5 | 5 | import org.springframework.beans.factory.annotation.Autowired; |
| 6 | 6 | |
| 7 | +import com.lyms.spring.PropertiesUtil; | |
| 7 | 8 | import com.lyms.sync.ParamsAdpter; |
| 8 | 9 | import com.lyms.sync.SyncCallback; |
| 9 | 10 | import com.lyms.sync.SyncCenter; |
| ... | ... | @@ -21,6 +22,11 @@ |
| 21 | 22 | |
| 22 | 23 | @Autowired |
| 23 | 24 | public SyncCenter center; |
| 25 | + | |
| 26 | + @Test | |
| 27 | + public void get(){ | |
| 28 | + System.out.println(PropertiesUtil.getString("isCenterOperateSyncToNode")); | |
| 29 | + } | |
| 24 | 30 | |
| 25 | 31 | /** |
| 26 | 32 | * <li>@Description:测试往固定任务队列中添加任务 |
| ... | ... | @@ -30,7 +36,7 @@ |
| 30 | 36 | * <li>修改人: |
| 31 | 37 | * <li>修改时间: |
| 32 | 38 | */ |
| 33 | - @Test | |
| 39 | + //@Test | |
| 34 | 40 | public void pushFix() { |
| 35 | 41 | String id = StrUtils.uuid(); |
| 36 | 42 | String remote = "http://127.0.0.1:8080/hospital.web/remote/sync"; |
| ... | ... | @@ -47,7 +53,7 @@ |
| 47 | 53 | * <li>修改人: |
| 48 | 54 | * <li>修改时间: |
| 49 | 55 | */ |
| 50 | - @Test | |
| 56 | + //@Test | |
| 51 | 57 | public void pushTmp() { |
| 52 | 58 | String id = StrUtils.uuid(); |
| 53 | 59 | String remote = "http://127.0.0.1:9090/hospital.web/remote/sync"; |
| ... | ... | @@ -60,7 +66,7 @@ |
| 60 | 66 | center.pushFix(id, remote, remoteClazz, remoteMethod, null); |
| 61 | 67 | } |
| 62 | 68 | |
| 63 | - @Test | |
| 69 | + //@Test | |
| 64 | 70 | public void pull() { |
| 65 | 71 | center.pull(true, new SyncCallback() { |
| 66 | 72 | @Override |
parent/hospital.mac/src/main/java/com/lyms/hospital/entity/assist/DiagnoseAssit.java
View file @
ec6cdc6
| ... | ... | @@ -30,6 +30,12 @@ |
| 30 | 30 | * 诊断类型:1婚前检查,2产检,【3儿保检查】 |
| 31 | 31 | */ |
| 32 | 32 | public static final int DIAGNOSE_TYPE_CHILD = 3; |
| 33 | + | |
| 34 | + //常见数值: +,±,- | |
| 35 | + public static final int YIN = 1; | |
| 36 | + public static final int RUOYANG = 2; | |
| 37 | + public static final int YANG = 3; | |
| 38 | + | |
| 33 | 39 | |
| 34 | 40 | /** |
| 35 | 41 | * (辅助检查) |
parent/hospital.mac/src/main/java/com/lyms/hospital/entity/diagnose/DiagnoseInfo.java
View file @
ec6cdc6
| ... | ... | @@ -19,6 +19,10 @@ |
| 19 | 19 | public class DiagnoseInfo implements Serializable { |
| 20 | 20 | |
| 21 | 21 | private static final long serialVersionUID = 1L; |
| 22 | + | |
| 23 | + //诊断类型,0为初诊,1为复诊 | |
| 24 | + public static final int TYPE_FIRST = 1; | |
| 25 | + public static final int TYPE_SECOND = 2; | |
| 22 | 26 | |
| 23 | 27 | /** |
| 24 | 28 | * |
| ... | ... | @@ -249,6 +253,13 @@ |
| 249 | 253 | @TableField(value = "HAS_DIAGNOSE") |
| 250 | 254 | private Integer hasDiagnose; |
| 251 | 255 | |
| 256 | + | |
| 257 | + | |
| 258 | + //格式化字段====================== | |
| 259 | + @TableField(exist = false) | |
| 260 | + private String diagnoseTimeStr; | |
| 261 | + @TableField(exist = false) | |
| 262 | + private String nextinspectTimeStr; | |
| 252 | 263 | |
| 253 | 264 | public String getId() { |
| 254 | 265 | return id; |
| ... | ... | @@ -608,6 +619,22 @@ |
| 608 | 619 | |
| 609 | 620 | public void setHasDiagnose(Integer hasDiagnose) { |
| 610 | 621 | this.hasDiagnose = hasDiagnose; |
| 622 | + } | |
| 623 | + | |
| 624 | + public String getDiagnoseTimeStr() { | |
| 625 | + return diagnoseTimeStr; | |
| 626 | + } | |
| 627 | + | |
| 628 | + public void setDiagnoseTimeStr(String diagnoseTimeStr) { | |
| 629 | + this.diagnoseTimeStr = diagnoseTimeStr; | |
| 630 | + } | |
| 631 | + | |
| 632 | + public String getNextinspectTimeStr() { | |
| 633 | + return nextinspectTimeStr; | |
| 634 | + } | |
| 635 | + | |
| 636 | + public void setNextinspectTimeStr(String nextinspectTimeStr) { | |
| 637 | + this.nextinspectTimeStr = nextinspectTimeStr; | |
| 611 | 638 | } |
| 612 | 639 | |
| 613 | 640 |
parent/hospital.mac/src/main/java/com/lyms/hospital/entity/history/HistoryMaps.java
View file @
ec6cdc6
| ... | ... | @@ -21,6 +21,9 @@ |
| 21 | 21 | public static final int TARGET_TYPE_EXAM = 1; |
| 22 | 22 | public static final int TARGET_TYPE_WOMAN_RECORD = 2; |
| 23 | 23 | |
| 24 | + //丈夫健康情况(属于病史模块,应前端要求,特殊处理) | |
| 25 | + public static final String ZFJKQK = "900"; | |
| 26 | + | |
| 24 | 27 | public HistoryMaps(){} |
| 25 | 28 | |
| 26 | 29 | public HistoryMaps(String sourceId,String otherTxt){ |
parent/hospital.mac/src/main/java/com/lyms/hospital/entity/history/HistorySource.java
View file @
ec6cdc6
| ... | ... | @@ -61,6 +61,12 @@ |
| 61 | 61 | */ |
| 62 | 62 | @TableField(value = "HAS_TEXT") |
| 63 | 63 | private Integer hasText; |
| 64 | + | |
| 65 | + /** | |
| 66 | + * 一级节点是否需要换行(应前端要求,加的条件判断字段) | |
| 67 | + */ | |
| 68 | + @TableField(exist = false) | |
| 69 | + private boolean needNewLine; | |
| 64 | 70 | |
| 65 | 71 | /** |
| 66 | 72 | * 子级别元素 |
| ... | ... | @@ -139,6 +145,15 @@ |
| 139 | 145 | public void setChildren(List<HistorySource> children) { |
| 140 | 146 | this.children = children; |
| 141 | 147 | } |
| 148 | + | |
| 149 | + public boolean isNeedNewLine() { | |
| 150 | + return needNewLine; | |
| 151 | + } | |
| 152 | + | |
| 153 | + public void setNeedNewLine(boolean needNewLine) { | |
| 154 | + this.needNewLine = needNewLine; | |
| 155 | + } | |
| 156 | + | |
| 142 | 157 | |
| 143 | 158 | } |
parent/hospital.mac/src/main/java/com/lyms/hospital/enums/ServiceStatusEnums.java
View file @
ec6cdc6
| 1 | -package com.lyms.hospital.enums; | |
| 2 | - | |
| 3 | -import java.util.ArrayList; | |
| 4 | -import java.util.HashMap; | |
| 5 | -import java.util.List; | |
| 6 | -import java.util.Map; | |
| 7 | - | |
| 8 | -/** | |
| 9 | - * Created by Administrator on 2016/6/21. | |
| 10 | - */ | |
| 11 | -public enum ServiceStatusEnums { | |
| 12 | - | |
| 13 | - //标准服务 | |
| 14 | - STANDARD_ALL(101,"全部",0), | |
| 15 | - STANDARD_OPEN(0,"开通",0), | |
| 16 | - NO_OPEN(1,"不开通",0), | |
| 17 | - STANDARD_OVERDUE(2,"过期",0), | |
| 18 | - | |
| 19 | - //增值服务 | |
| 20 | - ADD_ALL(102,"全部",1), | |
| 21 | - ADD_OPEN(3,"开通",1), | |
| 22 | - UNSUBSCRIBE(4,"退订",1), | |
| 23 | - ADD_OVERDUE(5,"过期",1), | |
| 24 | - SUSPEND(6,"暂停",1), | |
| 25 | - | |
| 26 | - //全部 | |
| 27 | - ALL(103,"全部",100), | |
| 28 | - ALL_OPEN(7,"开通",100), | |
| 29 | - ALL_NO_OPEN(8,"不开通",100), | |
| 30 | - ALL_OVERDUE(9,"过期",100); | |
| 31 | - | |
| 32 | - private ServiceStatusEnums(int id, String name,int pid){ | |
| 33 | - this.name=name; | |
| 34 | - this.id =id; | |
| 35 | - this.pid =pid; | |
| 36 | - } | |
| 37 | - private String name; | |
| 38 | - private int id; | |
| 39 | - private int pid; | |
| 40 | - | |
| 41 | - | |
| 42 | - public static List<Map<String,String>> getServiceStatusList() | |
| 43 | - { | |
| 44 | - List<Map<String,String>> list = new ArrayList<>(); | |
| 45 | - for(ServiceStatusEnums s : ServiceStatusEnums.values()) { | |
| 46 | - if (s.getId() < 100) | |
| 47 | - { | |
| 48 | - Map<String,String> map = new HashMap<>(); | |
| 49 | - map.put("id", String.valueOf(s.getId())); | |
| 50 | - map.put("name", s.getName()); | |
| 51 | - map.put("pid", String.valueOf(s.getPid())); | |
| 52 | - list.add(map); | |
| 53 | - } | |
| 54 | - | |
| 55 | - } | |
| 56 | - return list; | |
| 57 | - } | |
| 58 | - | |
| 59 | - public static List<Map<String,String>> getServiceTypeList() | |
| 60 | - { | |
| 61 | - List<Map<String,String>> list = new ArrayList<>(); | |
| 62 | - Map<String, String> stMap1 = new HashMap<>(); | |
| 63 | - stMap1.put("id", "0"); | |
| 64 | - stMap1.put("name", "标准服务"); | |
| 65 | - Map<String, String> stMap2 = new HashMap<>(); | |
| 66 | - stMap2.put("id", "1"); | |
| 67 | - stMap2.put("name", "增值服务"); | |
| 68 | - list.add(stMap1); | |
| 69 | - list.add(stMap2); | |
| 70 | - return list; | |
| 71 | - } | |
| 72 | - | |
| 73 | - | |
| 74 | - public static List<Map<String,String>> getServiceStatusByPid(int pid) | |
| 75 | - { | |
| 76 | - List<Map<String,String>> list = new ArrayList<>(); | |
| 77 | - for(ServiceStatusEnums s : ServiceStatusEnums.values()) { | |
| 78 | - if (s.getPid() == pid) | |
| 79 | - { | |
| 80 | - Map<String,String> map = new HashMap<>(); | |
| 81 | - map.put("id", String.valueOf(s.getId())); | |
| 82 | - map.put("name", s.getName()); | |
| 83 | - map.put("pid", String.valueOf(s.getPid())); | |
| 84 | - list.add(map); | |
| 85 | - } | |
| 86 | - | |
| 87 | - } | |
| 88 | - return list; | |
| 89 | - } | |
| 90 | - | |
| 91 | - public static String getNameById(Integer id) | |
| 92 | - { | |
| 93 | - for(ServiceStatusEnums s : ServiceStatusEnums.values()) { | |
| 94 | - if (id != null && s.getId() == id) | |
| 95 | - { | |
| 96 | - return s.getName(); | |
| 97 | - } | |
| 98 | - | |
| 99 | - } | |
| 100 | - return ""; | |
| 101 | - } | |
| 102 | - | |
| 103 | - public String getName() { | |
| 104 | - return name; | |
| 105 | - } | |
| 106 | - | |
| 107 | - public void setName(String name) { | |
| 108 | - this.name = name; | |
| 109 | - } | |
| 110 | - | |
| 111 | - public int getId() { | |
| 112 | - return id; | |
| 113 | - } | |
| 114 | - | |
| 115 | - public void setId(int id) { | |
| 116 | - this.id = id; | |
| 117 | - } | |
| 118 | - | |
| 119 | - public int getPid() { | |
| 120 | - return pid; | |
| 121 | - } | |
| 122 | - | |
| 123 | - public void setPid(int pid) { | |
| 124 | - this.pid = pid; | |
| 125 | - } | |
| 126 | -} |
parent/hospital.mac/src/main/java/com/lyms/hospital/enums/business/FetalEnums.java
View file @
ec6cdc6
| 1 | +package com.lyms.hospital.enums.business; | |
| 2 | + | |
| 3 | +import java.util.ArrayList; | |
| 4 | +import java.util.LinkedHashMap; | |
| 5 | +import java.util.List; | |
| 6 | +import java.util.Map; | |
| 7 | + | |
| 8 | +import org.apache.commons.lang.StringUtils; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * 胎先露 | |
| 12 | + * | |
| 13 | + * Created by Administrator on 2016/6/21 0021. | |
| 14 | + */ | |
| 15 | +public enum FetalEnums { | |
| 16 | + A("头","1"), | |
| 17 | + B("臀","2"), | |
| 18 | + C("足","3"), | |
| 19 | + D("肩","4"); | |
| 20 | + | |
| 21 | + public static List<Map<String,String>> getList(){ | |
| 22 | + List<Map<String,String>> list = new ArrayList<>(); | |
| 23 | + for(FetalEnums e : values()){ | |
| 24 | + Map<String,String> map = new LinkedHashMap<>(); | |
| 25 | + map.put("id", e.getId()); | |
| 26 | + map.put("name", e.getName()); | |
| 27 | + list.add(map); | |
| 28 | + } | |
| 29 | + return list; | |
| 30 | + } | |
| 31 | + | |
| 32 | + public static String getTitle(String id){ | |
| 33 | + if (StringUtils.isNotEmpty(id)){ | |
| 34 | + for (FetalEnums fetalEnums:FetalEnums.values()){ | |
| 35 | + if (fetalEnums.getId().equals(id)){ | |
| 36 | + return fetalEnums.getName(); | |
| 37 | + } | |
| 38 | + } | |
| 39 | + } | |
| 40 | + return null; | |
| 41 | + } | |
| 42 | + | |
| 43 | + private FetalEnums(String name,String id){ | |
| 44 | + this.name=name; | |
| 45 | + this.id=id; | |
| 46 | + } | |
| 47 | + private String name; | |
| 48 | + private String id; | |
| 49 | + | |
| 50 | + public String getId() { | |
| 51 | + return id; | |
| 52 | + } | |
| 53 | + | |
| 54 | + public void setId(String id) { | |
| 55 | + this.id = id; | |
| 56 | + } | |
| 57 | + | |
| 58 | + public String getName() { | |
| 59 | + return name; | |
| 60 | + } | |
| 61 | + | |
| 62 | + public void setName(String name) { | |
| 63 | + this.name = name; | |
| 64 | + } | |
| 65 | +} |
parent/hospital.mac/src/main/java/com/lyms/hospital/enums/business/FetalPositionEnums.java
View file @
ec6cdc6
| 1 | +package com.lyms.hospital.enums.business; | |
| 2 | + | |
| 3 | +import java.util.ArrayList; | |
| 4 | +import java.util.LinkedHashMap; | |
| 5 | +import java.util.List; | |
| 6 | +import java.util.Map; | |
| 7 | + | |
| 8 | +import org.apache.commons.lang.StringUtils; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * | |
| 12 | + * 胎方位枚举 | |
| 13 | + * | |
| 14 | + * Created by Administrator on 2016/6/21 0021. | |
| 15 | + */ | |
| 16 | +public enum FetalPositionEnums { | |
| 17 | + ONE1("左枕前","1"), | |
| 18 | + ONE2("左枕横","2"), | |
| 19 | + ONE3("左枕后","3"), | |
| 20 | + ONE4("右枕前","4"), | |
| 21 | + ONE5("右枕横","5"), | |
| 22 | + ONE6("右枕后","6"), | |
| 23 | + ONE7("左颏前","7"), | |
| 24 | + ONE8("左颏横","8"), | |
| 25 | + ONE9("左颏后","9"), | |
| 26 | + ONE10("右颏前","10"), | |
| 27 | + ONE11("右颏横","11"), | |
| 28 | + ONE12("右颏后","12"), | |
| 29 | + ONE13("额后位","13"), | |
| 30 | + ONE24("额前位","24"), | |
| 31 | + ONE14("左骶前","14"), | |
| 32 | + ONE15("左骶横","15"), | |
| 33 | + ONE16("左骶后","16"), | |
| 34 | + ONE17("右骶前","17"), | |
| 35 | + ONE18("右骶横","18"), | |
| 36 | + ONE19("右骶后","19"), | |
| 37 | + ONE20("左肩前","20"), | |
| 38 | + ONE21("左肩后","21"), | |
| 39 | + ONE22("右肩前","22"), | |
| 40 | + ONE23("右肩后","23"); | |
| 41 | + | |
| 42 | + public static List<Map<String,String>> getList(){ | |
| 43 | + List<Map<String,String>> list = new ArrayList<>(); | |
| 44 | + for(FetalPositionEnums e : values()){ | |
| 45 | + Map<String,String> map = new LinkedHashMap<>(); | |
| 46 | + map.put("id", e.getId()); | |
| 47 | + map.put("name", e.getName()); | |
| 48 | + list.add(map); | |
| 49 | + } | |
| 50 | + return list; | |
| 51 | + } | |
| 52 | + | |
| 53 | + public static String getTitle(String id){ | |
| 54 | + if (StringUtils.isNotEmpty(id)){ | |
| 55 | + for (FetalPositionEnums fetalPositionEnums:FetalPositionEnums.values()){ | |
| 56 | + if (fetalPositionEnums.getId().equals(id)){ | |
| 57 | + return fetalPositionEnums.getName(); | |
| 58 | + } | |
| 59 | + } | |
| 60 | + } | |
| 61 | + return null; | |
| 62 | + } | |
| 63 | + | |
| 64 | + | |
| 65 | + private FetalPositionEnums(String name,String id){ | |
| 66 | + this.name=name; | |
| 67 | + this.id=id; | |
| 68 | + } | |
| 69 | + private String name; | |
| 70 | + private String id; | |
| 71 | + | |
| 72 | + public String getId() { | |
| 73 | + return id; | |
| 74 | + } | |
| 75 | + | |
| 76 | + public void setId(String id) { | |
| 77 | + this.id = id; | |
| 78 | + } | |
| 79 | + | |
| 80 | + public String getName() { | |
| 81 | + return name; | |
| 82 | + } | |
| 83 | + | |
| 84 | + public void setName(String name) { | |
| 85 | + this.name = name; | |
| 86 | + } | |
| 87 | +} |
parent/hospital.mac/src/main/java/com/lyms/hospital/enums/business/FuZhongEnums.java
View file @
ec6cdc6
| 1 | +package com.lyms.hospital.enums.business; | |
| 2 | + | |
| 3 | +import java.util.ArrayList; | |
| 4 | +import java.util.LinkedHashMap; | |
| 5 | +import java.util.List; | |
| 6 | +import java.util.Map; | |
| 7 | + | |
| 8 | +/** | |
| 9 | + * Created by Administrator on 2016/6/23 0023. | |
| 10 | + */ | |
| 11 | +public enum FuZhongEnums { | |
| 12 | + O("-","1"), | |
| 13 | + O1("+","2"), | |
| 14 | + O2("++","3"), | |
| 15 | + O3("+++","4"); | |
| 16 | + | |
| 17 | + public static List<Map<String,String>> getList(){ | |
| 18 | + List<Map<String,String>> list = new ArrayList<>(); | |
| 19 | + for(FuZhongEnums e : values()){ | |
| 20 | + Map<String,String> map = new LinkedHashMap<>(); | |
| 21 | + map.put("id", e.getId()); | |
| 22 | + map.put("name", e.getName()); | |
| 23 | + list.add(map); | |
| 24 | + } | |
| 25 | + return list; | |
| 26 | + } | |
| 27 | + | |
| 28 | + private FuZhongEnums(String name,String id){ | |
| 29 | + this.id=id; | |
| 30 | + this.name=name; | |
| 31 | + } | |
| 32 | + private String id; | |
| 33 | + private String name; | |
| 34 | + | |
| 35 | + public String getId() { | |
| 36 | + return id; | |
| 37 | + } | |
| 38 | + | |
| 39 | + public void setId(String id) { | |
| 40 | + this.id = id; | |
| 41 | + } | |
| 42 | + | |
| 43 | + public String getName() { | |
| 44 | + return name; | |
| 45 | + } | |
| 46 | + | |
| 47 | + public void setName(String name) { | |
| 48 | + this.name = name; | |
| 49 | + } | |
| 50 | +} |
parent/hospital.mac/src/main/java/com/lyms/hospital/enums/business/JoinEnums.java
View file @
ec6cdc6
| 1 | +package com.lyms.hospital.enums.business; | |
| 2 | + | |
| 3 | +import java.util.ArrayList; | |
| 4 | +import java.util.LinkedHashMap; | |
| 5 | +import java.util.List; | |
| 6 | +import java.util.Map; | |
| 7 | + | |
| 8 | +import org.apache.commons.lang.StringUtils; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * 衔接枚举 | |
| 12 | + * <p> | |
| 13 | + * Created by Administrator on 2016/6/21 0021. | |
| 14 | + */ | |
| 15 | +public enum JoinEnums { | |
| 16 | + O("已衔接", "1"), | |
| 17 | + O1("未衔接", "0"); | |
| 18 | + | |
| 19 | + public static List<Map<String,String>> getList(){ | |
| 20 | + List<Map<String,String>> list = new ArrayList<>(); | |
| 21 | + for(JoinEnums e : values()){ | |
| 22 | + Map<String,String> map = new LinkedHashMap<>(); | |
| 23 | + map.put("id", e.getId()); | |
| 24 | + map.put("name", e.getName()); | |
| 25 | + list.add(map); | |
| 26 | + } | |
| 27 | + return list; | |
| 28 | + } | |
| 29 | + | |
| 30 | + public static String getTitle(String id){ | |
| 31 | + if (StringUtils.isNotEmpty(id)){ | |
| 32 | + for (JoinEnums joinEnums:JoinEnums.values()){ | |
| 33 | + if (joinEnums.getId().equals(id)){ | |
| 34 | + return joinEnums.getName(); | |
| 35 | + } | |
| 36 | + } | |
| 37 | + } | |
| 38 | + return null; | |
| 39 | + } | |
| 40 | + | |
| 41 | + private JoinEnums(String name, String id) { | |
| 42 | + this.name = name; | |
| 43 | + this.id = id; | |
| 44 | + } | |
| 45 | + | |
| 46 | + private String name; | |
| 47 | + private String id; | |
| 48 | + | |
| 49 | + public String getId() { | |
| 50 | + return id; | |
| 51 | + } | |
| 52 | + | |
| 53 | + public void setId(String id) { | |
| 54 | + this.id = id; | |
| 55 | + } | |
| 56 | + | |
| 57 | + public String getName() { | |
| 58 | + return name; | |
| 59 | + } | |
| 60 | + | |
| 61 | + public void setName(String name) { | |
| 62 | + this.name = name; | |
| 63 | + } | |
| 64 | +} |
parent/hospital.mac/src/main/java/com/lyms/hospital/enums/business/ServiceStatusEnums.java
View file @
ec6cdc6
| 1 | +package com.lyms.hospital.enums.business; | |
| 2 | + | |
| 3 | +import java.util.ArrayList; | |
| 4 | +import java.util.HashMap; | |
| 5 | +import java.util.List; | |
| 6 | +import java.util.Map; | |
| 7 | + | |
| 8 | +/** | |
| 9 | + * Created by Administrator on 2016/6/21. | |
| 10 | + */ | |
| 11 | +public enum ServiceStatusEnums { | |
| 12 | + | |
| 13 | + //标准服务 | |
| 14 | + STANDARD_ALL(101,"全部",0), | |
| 15 | + STANDARD_OPEN(0,"开通",0), | |
| 16 | + NO_OPEN(1,"不开通",0), | |
| 17 | + STANDARD_OVERDUE(2,"过期",0), | |
| 18 | + | |
| 19 | + //增值服务 | |
| 20 | + ADD_ALL(102,"全部",1), | |
| 21 | + ADD_OPEN(3,"开通",1), | |
| 22 | + UNSUBSCRIBE(4,"退订",1), | |
| 23 | + ADD_OVERDUE(5,"过期",1), | |
| 24 | + SUSPEND(6,"暂停",1), | |
| 25 | + | |
| 26 | + //全部 | |
| 27 | + ALL(103,"全部",100), | |
| 28 | + ALL_OPEN(7,"开通",100), | |
| 29 | + ALL_NO_OPEN(8,"不开通",100), | |
| 30 | + ALL_OVERDUE(9,"过期",100); | |
| 31 | + | |
| 32 | + private ServiceStatusEnums(int id, String name,int pid){ | |
| 33 | + this.name=name; | |
| 34 | + this.id =id; | |
| 35 | + this.pid =pid; | |
| 36 | + } | |
| 37 | + private String name; | |
| 38 | + private int id; | |
| 39 | + private int pid; | |
| 40 | + | |
| 41 | + | |
| 42 | + public static List<Map<String,String>> getServiceStatusList() | |
| 43 | + { | |
| 44 | + List<Map<String,String>> list = new ArrayList<>(); | |
| 45 | + for(ServiceStatusEnums s : ServiceStatusEnums.values()) { | |
| 46 | + if (s.getId() < 100) | |
| 47 | + { | |
| 48 | + Map<String,String> map = new HashMap<>(); | |
| 49 | + map.put("id", String.valueOf(s.getId())); | |
| 50 | + map.put("name", s.getName()); | |
| 51 | + map.put("pid", String.valueOf(s.getPid())); | |
| 52 | + list.add(map); | |
| 53 | + } | |
| 54 | + | |
| 55 | + } | |
| 56 | + return list; | |
| 57 | + } | |
| 58 | + | |
| 59 | + public static List<Map<String,String>> getServiceTypeList() | |
| 60 | + { | |
| 61 | + List<Map<String,String>> list = new ArrayList<>(); | |
| 62 | + Map<String, String> stMap1 = new HashMap<>(); | |
| 63 | + stMap1.put("id", "0"); | |
| 64 | + stMap1.put("name", "标准服务"); | |
| 65 | + Map<String, String> stMap2 = new HashMap<>(); | |
| 66 | + stMap2.put("id", "1"); | |
| 67 | + stMap2.put("name", "增值服务"); | |
| 68 | + list.add(stMap1); | |
| 69 | + list.add(stMap2); | |
| 70 | + return list; | |
| 71 | + } | |
| 72 | + | |
| 73 | + | |
| 74 | + public static List<Map<String,String>> getServiceStatusByPid(int pid) | |
| 75 | + { | |
| 76 | + List<Map<String,String>> list = new ArrayList<>(); | |
| 77 | + for(ServiceStatusEnums s : ServiceStatusEnums.values()) { | |
| 78 | + if (s.getPid() == pid) | |
| 79 | + { | |
| 80 | + Map<String,String> map = new HashMap<>(); | |
| 81 | + map.put("id", String.valueOf(s.getId())); | |
| 82 | + map.put("name", s.getName()); | |
| 83 | + map.put("pid", String.valueOf(s.getPid())); | |
| 84 | + list.add(map); | |
| 85 | + } | |
| 86 | + | |
| 87 | + } | |
| 88 | + return list; | |
| 89 | + } | |
| 90 | + | |
| 91 | + public static String getNameById(Integer id) | |
| 92 | + { | |
| 93 | + for(ServiceStatusEnums s : ServiceStatusEnums.values()) { | |
| 94 | + if (id != null && s.getId() == id) | |
| 95 | + { | |
| 96 | + return s.getName(); | |
| 97 | + } | |
| 98 | + | |
| 99 | + } | |
| 100 | + return ""; | |
| 101 | + } | |
| 102 | + | |
| 103 | + public String getName() { | |
| 104 | + return name; | |
| 105 | + } | |
| 106 | + | |
| 107 | + public void setName(String name) { | |
| 108 | + this.name = name; | |
| 109 | + } | |
| 110 | + | |
| 111 | + public int getId() { | |
| 112 | + return id; | |
| 113 | + } | |
| 114 | + | |
| 115 | + public void setId(int id) { | |
| 116 | + this.id = id; | |
| 117 | + } | |
| 118 | + | |
| 119 | + public int getPid() { | |
| 120 | + return pid; | |
| 121 | + } | |
| 122 | + | |
| 123 | + public void setPid(int pid) { | |
| 124 | + this.pid = pid; | |
| 125 | + } | |
| 126 | +} |
parent/hospital.mac/src/main/java/com/lyms/hospital/enums/business/TaiShuEnums.java
View file @
ec6cdc6
| 1 | +package com.lyms.hospital.enums.business; | |
| 2 | + | |
| 3 | +import java.util.ArrayList; | |
| 4 | +import java.util.LinkedHashMap; | |
| 5 | +import java.util.List; | |
| 6 | +import java.util.Map; | |
| 7 | + | |
| 8 | +import org.apache.commons.lang.StringUtils; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * 胎盘相关枚举(从原项目拷贝) | |
| 12 | + * 用于-孕妇产检 | |
| 13 | + * Created by Administrator on 2016/6/21 0021. | |
| 14 | + * | |
| 15 | + */ | |
| 16 | +public enum TaiShuEnums { | |
| 17 | + O("单胎","1"), | |
| 18 | + O1("双胎","2"), | |
| 19 | + O2("三胎","3"), | |
| 20 | + O3("四胎","4"), | |
| 21 | + O4("五胎","5"), | |
| 22 | + O5("六胎","6"), | |
| 23 | + O6("七胎","7"); | |
| 24 | + | |
| 25 | + public static List<Map<String,String>> getList(){ | |
| 26 | + List<Map<String,String>> list = new ArrayList<>(); | |
| 27 | + for(TaiShuEnums e : values()){ | |
| 28 | + Map<String,String> map = new LinkedHashMap<>(); | |
| 29 | + map.put("id", e.getId()); | |
| 30 | + map.put("name", e.getName()); | |
| 31 | + list.add(map); | |
| 32 | + } | |
| 33 | + return list; | |
| 34 | + } | |
| 35 | + | |
| 36 | + public static String getTitle(String id){ | |
| 37 | + if (StringUtils.isNotEmpty(id)){ | |
| 38 | + for(TaiShuEnums enums:values()){ | |
| 39 | + if(enums.getId().equals(id)){ | |
| 40 | + return enums.getName(); | |
| 41 | + } | |
| 42 | + } | |
| 43 | + } | |
| 44 | + return null; | |
| 45 | + } | |
| 46 | + | |
| 47 | + public enum TaiPanEnums{ | |
| 48 | + O("1个","1"), | |
| 49 | + O1("2个","2"), | |
| 50 | + O2("3个","3"), | |
| 51 | + O3("4个","4"), | |
| 52 | + O4("5个","5"), | |
| 53 | + O5("6个","6"), | |
| 54 | + O6("7个","7"); | |
| 55 | + | |
| 56 | + public static List<Map<String,String>> getList(){ | |
| 57 | + List<Map<String,String>> list = new ArrayList<>(); | |
| 58 | + for(TaiPanEnums e : values()){ | |
| 59 | + Map<String,String> map = new LinkedHashMap<>(); | |
| 60 | + map.put("id", e.getId()); | |
| 61 | + map.put("name", e.getName()); | |
| 62 | + list.add(map); | |
| 63 | + } | |
| 64 | + return list; | |
| 65 | + } | |
| 66 | + | |
| 67 | + private TaiPanEnums(String name,String id){ | |
| 68 | + this.name=name; | |
| 69 | + this.id=id; | |
| 70 | + } | |
| 71 | + private String name; | |
| 72 | + private String id; | |
| 73 | + | |
| 74 | + public String getId() { | |
| 75 | + return id; | |
| 76 | + } | |
| 77 | + | |
| 78 | + public void setId(String id) { | |
| 79 | + this.id = id; | |
| 80 | + } | |
| 81 | + | |
| 82 | + public String getName() { | |
| 83 | + return name; | |
| 84 | + } | |
| 85 | + | |
| 86 | + public void setName(String name) { | |
| 87 | + this.name = name; | |
| 88 | + } | |
| 89 | + } | |
| 90 | + | |
| 91 | + public static String getTpNameById(String id) { | |
| 92 | + | |
| 93 | + if (StringUtils.isEmpty(id)){ | |
| 94 | + return null; | |
| 95 | + } | |
| 96 | + | |
| 97 | + for (TpEnums e : TpEnums.values()) { | |
| 98 | + if (e.getId().equals(id)) | |
| 99 | + { | |
| 100 | + return e.getName(); | |
| 101 | + } | |
| 102 | + } | |
| 103 | + return null; | |
| 104 | + } | |
| 105 | + | |
| 106 | + | |
| 107 | + public enum TpEnums { | |
| 108 | + O("完整","1"),O1("不完整","2"); | |
| 109 | + | |
| 110 | + public static List<Map<String,String>> getList(){ | |
| 111 | + List<Map<String,String>> list = new ArrayList<>(); | |
| 112 | + for(TpEnums e : values()){ | |
| 113 | + Map<String,String> map = new LinkedHashMap<>(); | |
| 114 | + map.put("id", e.getId()); | |
| 115 | + map.put("name", e.getName()); | |
| 116 | + list.add(map); | |
| 117 | + } | |
| 118 | + return list; | |
| 119 | + } | |
| 120 | + | |
| 121 | + private TpEnums(String name,String id){ | |
| 122 | + this.name=name; | |
| 123 | + this.id=id; | |
| 124 | + } | |
| 125 | + private String name; | |
| 126 | + private String id; | |
| 127 | + | |
| 128 | + public String getId() { | |
| 129 | + return id; | |
| 130 | + } | |
| 131 | + | |
| 132 | + public void setId(String id) { | |
| 133 | + this.id = id; | |
| 134 | + } | |
| 135 | + | |
| 136 | + public String getName() { | |
| 137 | + return name; | |
| 138 | + } | |
| 139 | + | |
| 140 | + public void setName(String name) { | |
| 141 | + this.name = name; | |
| 142 | + } | |
| 143 | + } | |
| 144 | + private TaiShuEnums(String name,String id){ | |
| 145 | + this.name=name; | |
| 146 | + this.id=id; | |
| 147 | + } | |
| 148 | + private String name; | |
| 149 | + private String id; | |
| 150 | + | |
| 151 | + public String getId() { | |
| 152 | + return id; | |
| 153 | + } | |
| 154 | + | |
| 155 | + public void setId(String id) { | |
| 156 | + this.id = id; | |
| 157 | + } | |
| 158 | + | |
| 159 | + public String getName() { | |
| 160 | + return name; | |
| 161 | + } | |
| 162 | + | |
| 163 | + public void setName(String name) { | |
| 164 | + this.name = name; | |
| 165 | + } | |
| 166 | +} |
parent/hospital.mac/src/main/java/com/lyms/hospital/service/diagnose/impl/DiagnoseInfoServiceImpl.java
View file @
ec6cdc6
| ... | ... | @@ -92,7 +92,7 @@ |
| 92 | 92 | */ |
| 93 | 93 | public DiagnoseInfo findByCond(int type, String cardNum) { |
| 94 | 94 | EntityWrapper<DiagnoseInfo> ew = new EntityWrapper<DiagnoseInfo>(); |
| 95 | - ew.where("type={0}", type).and("BASE_PAPERS_NUMBER={0}", cardNum).orderBy("DIAGNOSE_TIME", Boolean.FALSE); | |
| 95 | + ew.where("TYPE={0}", type).and("BASE_PAPERS_NUMBER={0}", cardNum).orderBy("DIAGNOSE_TIME", Boolean.FALSE); | |
| 96 | 96 | return (DiagnoseInfo) selectObj(ew); |
| 97 | 97 | } |
| 98 | 98 | |
| ... | ... | @@ -108,7 +108,7 @@ |
| 108 | 108 | */ |
| 109 | 109 | public List<DiagnoseInfo> findListByPid(String pid) { |
| 110 | 110 | EntityWrapper<DiagnoseInfo> ew = new EntityWrapper<DiagnoseInfo>(); |
| 111 | - ew.where("pid={0}", pid); | |
| 111 | + ew.where("PID={0}", pid); | |
| 112 | 112 | return selectList(ew); |
| 113 | 113 | } |
| 114 | 114 | |
| ... | ... | @@ -129,6 +129,7 @@ |
| 129 | 129 | */ |
| 130 | 130 | if (StringUtils.isEmpty(info.getId())) {// 新增 |
| 131 | 131 | info.setId(StrUtils.uuid()); |
| 132 | + info.setType(DiagnoseInfo.TYPE_FIRST);// 诊断类型,0为初诊,1为复诊 | |
| 132 | 133 | this.insert(info);// 新增产检基本信息 |
| 133 | 134 | if (StringUtils.isEmpty(assist.getId())) { |
| 134 | 135 | assist.setId(StrUtils.uuid()); |
parent/hospital.mac/src/main/java/com/lyms/hospital/service/diagnose/impl/DiagnoseTaiServiceImpl.java
View file @
ec6cdc6
| ... | ... | @@ -38,7 +38,7 @@ |
| 38 | 38 | } |
| 39 | 39 | //delete |
| 40 | 40 | EntityWrapper<DiagnoseTai> wrapper = new EntityWrapper<DiagnoseTai>(); |
| 41 | - wrapper.where("examId = {0}", examId); | |
| 41 | + wrapper.where("EXAM_ID = {0}", examId); | |
| 42 | 42 | delete(wrapper); |
| 43 | 43 | //insert |
| 44 | 44 | Date now = new Date(); |
| ... | ... | @@ -54,7 +54,7 @@ |
| 54 | 54 | @Override |
| 55 | 55 | public List<DiagnoseTai> getListByExamId(String examId) { |
| 56 | 56 | EntityWrapper<DiagnoseTai> wrapper = new EntityWrapper<DiagnoseTai>(); |
| 57 | - wrapper.where("examId = {0}", examId); | |
| 57 | + wrapper.where("EXAM_ID = {0}", examId); | |
| 58 | 58 | return this.selectList(wrapper); |
| 59 | 59 | } |
| 60 | 60 | } |
parent/hospital.mac/src/main/java/com/lyms/hospital/service/history/impl/HistoryMapsServiceImpl.java
View file @
ec6cdc6
| ... | ... | @@ -19,6 +19,7 @@ |
| 19 | 19 | import com.lyms.hospital.service.history.HistoryMapsService; |
| 20 | 20 | import com.lyms.hospital.service.woman.WomanFetationRecordService; |
| 21 | 21 | import com.lyms.hospital.service.woman.WomanRecordService; |
| 22 | +import com.lyms.util.StrUtils; | |
| 22 | 23 | |
| 23 | 24 | /** |
| 24 | 25 | * <p> |
| 25 | 26 | |
| ... | ... | @@ -71,10 +72,11 @@ |
| 71 | 72 | return; |
| 72 | 73 | } |
| 73 | 74 | //delete |
| 74 | - delete(new EntityWrapper<HistoryMaps>().where("targetId={0}", targetId).and("targetType={0}", targetType)); | |
| 75 | + delete(new EntityWrapper<HistoryMaps>().where("TARGET_ID={0}", targetId).and("TARGET_TYPE={0}", targetType)); | |
| 75 | 76 | //insert |
| 76 | 77 | for(int i=0;i<list.size();i++){ |
| 77 | 78 | HistoryMaps hm = list.get(i); |
| 79 | + hm.setId(StrUtils.uuid()); | |
| 78 | 80 | hm.setWomanPersonId(womanPersonId);//女性居民ID |
| 79 | 81 | hm.setTargetId(targetId); |
| 80 | 82 | hm.setTargetType(targetType); |
| ... | ... | @@ -85,7 +87,7 @@ |
| 85 | 87 | @Override |
| 86 | 88 | public List<HistoryMaps> getListByTarget(String targetId, Integer targetType) { |
| 87 | 89 | EntityWrapper<HistoryMaps> ew = new EntityWrapper<HistoryMaps>(); |
| 88 | - ew.where("targetId={0}", targetId).and("targetType={0}", targetType); | |
| 90 | + ew.where("TARGET_ID={0}", targetId).and("TARGET_TYPE={0}", targetType); | |
| 89 | 91 | return this.selectList(ew); |
| 90 | 92 | } |
| 91 | 93 | } |
parent/hospital.mac/src/main/java/com/lyms/hospital/service/history/impl/HistorySourceServiceImpl.java
View file @
ec6cdc6
| ... | ... | @@ -7,6 +7,8 @@ |
| 7 | 7 | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| 8 | 8 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| 9 | 9 | import org.springframework.stereotype.Service; |
| 10 | +import org.springframework.util.StringUtils; | |
| 11 | + | |
| 10 | 12 | import java.io.Serializable; |
| 11 | 13 | import java.util.List; |
| 12 | 14 | import java.util.Map; |
| ... | ... | @@ -47,6 +49,13 @@ |
| 47 | 49 | Map<String,HistorySource> level2Data = InstanceUtils.newHashMap(); |
| 48 | 50 | for(HistorySource historySource : dbdataList){ |
| 49 | 51 | if("1".equals(historySource.getLevel())){ |
| 52 | + //========处理needNewLine字段========== | |
| 53 | + if(!StringUtils.isEmpty(historySource.getName()) && historySource.getName().contains("<br/>")){ | |
| 54 | + historySource.setNeedNewLine(true); | |
| 55 | + }else{ | |
| 56 | + historySource.setNeedNewLine(false); | |
| 57 | + } | |
| 58 | + //========处理needNewLine字段========== | |
| 50 | 59 | firstdataList.add(historySource);//最终只返回一级列表,其他层级以子类形式返回 |
| 51 | 60 | firstLevelData.put(historySource.getId(), historySource);//一级对象 |
| 52 | 61 | } |
parent/hospital.web/src/main/java/com/lyms/hospital/controller/CommonApiController.java
View file @
ec6cdc6
| ... | ... | @@ -14,7 +14,7 @@ |
| 14 | 14 | import com.lyms.base.common.entity.region.Regions; |
| 15 | 15 | import com.lyms.base.common.service.region.RegionsService; |
| 16 | 16 | import com.lyms.hospital.entity.history.HistorySource; |
| 17 | -import com.lyms.hospital.enums.ServiceStatusEnums; | |
| 17 | +import com.lyms.hospital.enums.business.ServiceStatusEnums; | |
| 18 | 18 | import com.lyms.hospital.service.history.HistorySourceService; |
| 19 | 19 | import com.lyms.hospital.util.trans.OldDictionary; |
| 20 | 20 | import com.lyms.hospital.util.trans.XjhMapUtil; |
parent/hospital.web/src/main/java/com/lyms/hospital/controller/RouterController.java
View file @
ec6cdc6
| ... | ... | @@ -5,6 +5,8 @@ |
| 5 | 5 | import javax.servlet.http.HttpServletRequest; |
| 6 | 6 | |
| 7 | 7 | import org.apache.commons.lang3.builder.ToStringBuilder; |
| 8 | +import org.slf4j.Logger; | |
| 9 | +import org.slf4j.LoggerFactory; | |
| 8 | 10 | import org.springframework.http.MediaType; |
| 9 | 11 | import org.springframework.web.bind.annotation.RequestMapping; |
| 10 | 12 | import org.springframework.web.bind.annotation.RestController; |
| 11 | 13 | |
| ... | ... | @@ -25,11 +27,13 @@ |
| 25 | 27 | @RestController |
| 26 | 28 | @RequestMapping("/remote") |
| 27 | 29 | public class RouterController extends BaseController { |
| 30 | + | |
| 31 | + private static final Logger log = LoggerFactory.getLogger(RouterController.class); | |
| 28 | 32 | |
| 29 | 33 | @RequestMapping(value = "/pull", produces = { MediaType.APPLICATION_JSON_VALUE }) |
| 30 | 34 | public Object pull(HttpServletRequest request) throws ClassNotFoundException, IOException { |
| 31 | 35 | ChannelData data = SyncUtils.conver(request); |
| 32 | - System.out.println("接受到数据: " + ToStringBuilder.reflectionToString(data)); | |
| 36 | + log.debug("节点数据被中心拉取:" + ToStringBuilder.reflectionToString(data)); | |
| 33 | 37 | Object handResult = SyncHandler.handler(data); |
| 34 | 38 | if (data.getLoop()) { |
| 35 | 39 | data = (ChannelData) handResult; |
| ... | ... | @@ -43,7 +47,7 @@ |
| 43 | 47 | @RequestMapping(value = "/push", produces = { MediaType.APPLICATION_JSON_VALUE }) |
| 44 | 48 | public Object push(HttpServletRequest request) throws ClassNotFoundException, IOException { |
| 45 | 49 | ChannelData data = SyncUtils.conver(request); |
| 46 | - System.out.println("接受到数据: " + ToStringBuilder.reflectionToString(data)); | |
| 50 | + log.debug("中心推送数据到节点:" + ToStringBuilder.reflectionToString(data)); | |
| 47 | 51 | Object handResult = SyncHandler.handler(data); |
| 48 | 52 | if (data.getLoop()) { |
| 49 | 53 | data = (ChannelData) handResult; |
parent/hospital.web/src/main/java/com/lyms/hospital/controller/woman/WomanExamController.java
View file @
ec6cdc6
| ... | ... | @@ -19,15 +19,20 @@ |
| 19 | 19 | import com.lyms.hospital.entity.diagnose.DiagnoseTai; |
| 20 | 20 | import com.lyms.hospital.entity.history.HistoryMaps; |
| 21 | 21 | import com.lyms.hospital.entity.woman.WomanFetationRecord; |
| 22 | +import com.lyms.hospital.enums.business.FetalEnums; | |
| 23 | +import com.lyms.hospital.enums.business.FetalPositionEnums; | |
| 24 | +import com.lyms.hospital.enums.business.FuZhongEnums; | |
| 25 | +import com.lyms.hospital.enums.business.JoinEnums; | |
| 26 | +import com.lyms.hospital.enums.business.TaiShuEnums; | |
| 22 | 27 | import com.lyms.hospital.request.exam.ExamAddRequest; |
| 23 | 28 | import com.lyms.hospital.request.exam.ExamAddRequestWrapper; |
| 24 | 29 | import com.lyms.hospital.service.assist.DiagnoseAssitService; |
| 25 | 30 | import com.lyms.hospital.service.diagnose.DiagnoseInfoService; |
| 26 | 31 | import com.lyms.hospital.service.diagnose.DiagnoseTaiService; |
| 27 | 32 | import com.lyms.hospital.service.history.HistoryMapsService; |
| 33 | +import com.lyms.hospital.service.token.TokenService; | |
| 28 | 34 | import com.lyms.hospital.service.woman.WomanFetationRecordService; |
| 29 | 35 | import com.lyms.hospital.util.HospitalUtil; |
| 30 | -import com.lyms.hospital.util.trans.XjhMapUtil; | |
| 31 | 36 | import com.lyms.util.DateUtil; |
| 32 | 37 | import com.lyms.web.bean.AjaxResult; |
| 33 | 38 | import com.lyms.web.controller.BaseController; |
| ... | ... | @@ -35,9 +40,11 @@ |
| 35 | 40 | /** |
| 36 | 41 | * 孕妇产检 前端控制器<br> |
| 37 | 42 | * |
| 38 | - * [--]依据cardNo或vcCardNo查询孕妇产检记录 | |
| 39 | - * [--]保存初诊数据 | |
| 40 | - * 保存复诊数据 查询某条记录的详细信息,用于表单填写 | |
| 43 | + * [--]依据cardNo或vcCardNo查询孕妇产检记录 <br> | |
| 44 | + * [--]保存初诊数据 <br> | |
| 45 | + * 保存复诊数据 <br> | |
| 46 | + * 查询某条记录的详细信息,用于表单填写<br> | |
| 47 | + * [--]产检获取字典数据<br> | |
| 41 | 48 | * |
| 42 | 49 | * @author xujiahong |
| 43 | 50 | * |
| ... | ... | @@ -56,6 +63,145 @@ |
| 56 | 63 | private DiagnoseTaiService diagnoseTaiService; |
| 57 | 64 | @Autowired |
| 58 | 65 | private HistoryMapsService historyMapsService; |
| 66 | + @Autowired | |
| 67 | + private TokenService tokenService; | |
| 68 | + | |
| 69 | + /** | |
| 70 | + * <li>@Description:产检获取字典数据 | |
| 71 | + * <li>@return | |
| 72 | + * <li>创建人:xujiahong | |
| 73 | + * <li>创建时间:2017年5月3日 | |
| 74 | + * <li>修改人: | |
| 75 | + * <li>修改时间: | |
| 76 | + */ | |
| 77 | + @SuppressWarnings("serial") | |
| 78 | + @RequestMapping(value = "/antex/getenums", method = RequestMethod.GET) | |
| 79 | + @ResponseBody | |
| 80 | + public AjaxResult getDictionary() { | |
| 81 | + Map<String,Object> data = new HashMap<>(); | |
| 82 | + //枚举常量======================================= | |
| 83 | + //getFetal 胎先露 | |
| 84 | + data.put("getFetal", FetalEnums.getList()); | |
| 85 | + //getJoin 衔接 | |
| 86 | + data.put("getJoin", JoinEnums.getList()); | |
| 87 | + //fuzhong ? | |
| 88 | + data.put("fuzhong", FuZhongEnums.getList()); | |
| 89 | + //getTaiPan 胎盘个数 | |
| 90 | + data.put("getTaiPan", TaiShuEnums.TaiPanEnums.getList()); | |
| 91 | + //getTaiShu 胎数 | |
| 92 | + data.put("getTaiShu", TaiShuEnums.getList()); | |
| 93 | + //getFetPosition | |
| 94 | + data.put("getFetPosition", FetalPositionEnums.getList()); | |
| 95 | + //字典常量======================================= | |
| 96 | + //xx 血型-模拟数据 TODO | |
| 97 | + List<Map<String,Object>> xx = new ArrayList<>(); | |
| 98 | + Map<String,Object> xx_map1 = new HashMap<String,Object>(){{ | |
| 99 | + put("id", "xxa"); | |
| 100 | + put("parentId", "5769eef90cf22c315757741f"); | |
| 101 | + put("name", "A"); | |
| 102 | + }}; | |
| 103 | + xx.add(xx_map1); | |
| 104 | + Map<String,Object> xx_map2 = new HashMap<String,Object>(){{ | |
| 105 | + put("id", "xxb"); | |
| 106 | + put("parentId", "5769eef90cf22c315757741f"); | |
| 107 | + put("name", "B"); | |
| 108 | + }}; | |
| 109 | + xx.add(xx_map2); | |
| 110 | + data.put("xx", xx); | |
| 111 | + | |
| 112 | + //getHighRisk 高危标签-模拟数据 TODO | |
| 113 | + List<Map<String,Object>> getHighRisk = new ArrayList<>(); | |
| 114 | + Map<String,Object> getHighRisk_map1 = new HashMap<String,Object>(){{ | |
| 115 | + put("id", "meidu"); | |
| 116 | + put("parentId", "224b2329-cb82-4da3-a071-8527f8283aab"); | |
| 117 | + put("code", "10"); | |
| 118 | + put("name", "梅毒"); | |
| 119 | + put("typeId","fb43fd5a-b153-4cb9-9180-c46f5612ba43"); | |
| 120 | + put("color","risk_purple"); | |
| 121 | + put("yn","1"); | |
| 122 | + }}; | |
| 123 | + getHighRisk.add(getHighRisk_map1); | |
| 124 | + Map<String,Object> getHighRisk_map2 = new HashMap<String,Object>(){{ | |
| 125 | + put("id", "hiv"); | |
| 126 | + put("parentId", "224b2329-cb82-4da3-a071-8527f8283aab"); | |
| 127 | + put("code", "10"); | |
| 128 | + put("name", "HIV"); | |
| 129 | + put("typeId","fb43fd5a-b153-4cb9-9180-c46f5612ba43"); | |
| 130 | + put("color","risk_purple"); | |
| 131 | + put("yn","1"); | |
| 132 | + }}; | |
| 133 | + getHighRisk.add(getHighRisk_map2); | |
| 134 | + data.put("getHighRisk", getHighRisk); | |
| 135 | + | |
| 136 | + //gwfz 高危分值(高危等级-->评分)-模拟数据 TODO | |
| 137 | + List<Map<String,Object>> gwfz = new ArrayList<>(); | |
| 138 | + Map<String,Object> gwfz_map1 = new HashMap<String,Object>(){{ | |
| 139 | + put("id", "5769f0640cf2d37f034793a2"); | |
| 140 | + put("parentId", "5769eef90cf22c3157577422"); | |
| 141 | + put("name", "5"); | |
| 142 | + }}; | |
| 143 | + gwfz.add(gwfz_map1); | |
| 144 | + Map<String,Object> gwfz_map2 = new HashMap<String,Object>(){{ | |
| 145 | + put("id", "5769f0640cf2d37f034793a3"); | |
| 146 | + put("parentId", "5769eef90cf22c3157577422"); | |
| 147 | + put("name", "10"); | |
| 148 | + }}; | |
| 149 | + gwfz.add(gwfz_map2); | |
| 150 | + data.put("gwfz", gwfz); | |
| 151 | + | |
| 152 | + //ydqjd 阴道清洁度-模拟数据 TODO | |
| 153 | + List<Map<String,Object>> ydqjd = new ArrayList<>(); | |
| 154 | + Map<String,Object> ydqjd_map1 = new HashMap<String,Object>(){{ | |
| 155 | + put("id", "5769ef930cf2d37f03479387"); | |
| 156 | + put("parentId", "5769eef90cf22c3157577420"); | |
| 157 | + put("name", "Ⅰ度"); | |
| 158 | + }}; | |
| 159 | + ydqjd.add(ydqjd_map1); | |
| 160 | + Map<String,Object> ydqjd_map2 = new HashMap<String,Object>(){{ | |
| 161 | + put("id", "5769ef930cf2d37f03479390"); | |
| 162 | + put("parentId", "5769eef90cf22c3157577420"); | |
| 163 | + put("name", "Ⅱ度"); | |
| 164 | + }}; | |
| 165 | + ydqjd.add(ydqjd_map2); | |
| 166 | + data.put("ydqjd", ydqjd); | |
| 167 | + | |
| 168 | + //organizations 组织机构-模拟数据 TODO | |
| 169 | + List<Map<String,Object>> organizations = new ArrayList<>(); | |
| 170 | + Map<String,Object> organizations_map1 = new HashMap<String,Object>(){{ | |
| 171 | + put("id", "193"); | |
| 172 | + put("name", "青龙妇幼保健院"); | |
| 173 | + }}; | |
| 174 | + organizations.add(organizations_map1); | |
| 175 | + Map<String,Object> organizations_map2 = new HashMap<String,Object>(){{ | |
| 176 | + put("id", "195"); | |
| 177 | + put("name", "昌黎妇幼保健院"); | |
| 178 | + }}; | |
| 179 | + organizations.add(organizations_map2); | |
| 180 | + data.put("organizations", organizations); | |
| 181 | + | |
| 182 | + //fxys 风险颜色-模拟数据 TODO | |
| 183 | + List<Map<String,Object>> fxys = new ArrayList<>(); | |
| 184 | + Map<String,Object> fxys_map1 = new HashMap<String,Object>(){{ | |
| 185 | + put("id", "zsyj"); | |
| 186 | + put("parentId", "fb43fd5a-b153-4cb9-9180-c46f5612ba43"); | |
| 187 | + put("name", "紫色预警"); | |
| 188 | + }}; | |
| 189 | + fxys.add(fxys_map1); | |
| 190 | + Map<String,Object> fxys_map2 = new HashMap<String,Object>(){{ | |
| 191 | + put("id", "csyj"); | |
| 192 | + put("parentId", "fb43fd5a-b153-4cb9-9180-c46f5612ba43"); | |
| 193 | + put("name", "橙色预警"); | |
| 194 | + }}; | |
| 195 | + fxys.add(fxys_map2); | |
| 196 | + data.put("fxys", fxys); | |
| 197 | + | |
| 198 | + //cTime | |
| 199 | + data.put("cTime", DateUtil.getyyyy_MM_dd(new Date())); | |
| 200 | + //now | |
| 201 | + data.put("now", DateUtil.getyyyy_MM_dd(new Date())); | |
| 202 | + return AjaxResult.returnSuccess(data); | |
| 203 | + } | |
| 204 | + | |
| 59 | 205 | |
| 60 | 206 | /** |
| 61 | 207 | * <li>@Description:查询某条记录的详细信息,用于表单填写 |
| ... | ... | @@ -81,6 +227,7 @@ |
| 81 | 227 | List<HistoryMaps> historyList = historyMapsService.getListByTarget(info.getId(), HistoryMaps.TARGET_TYPE_EXAM);// 关联目标类型:1产检、2妇女建档 |
| 82 | 228 | List<DiagnoseTai> taiList = diagnoseTaiService.getListByExamId(info.getId()); |
| 83 | 229 | |
| 230 | + | |
| 84 | 231 | return AjaxResult.returnFail(); |
| 85 | 232 | } |
| 86 | 233 | |
| ... | ... | @@ -97,6 +244,10 @@ |
| 97 | 244 | @ResponseBody |
| 98 | 245 | public AjaxResult saveFirstExam(@RequestBody ExamAddRequest request) { |
| 99 | 246 | /* |
| 247 | + * 同一产程不能新增两次初诊:(如果条件是新增,根据孕妇档案ID WOMAN_ID 查询产检记录列表) TODO | |
| 248 | + */ | |
| 249 | + // | |
| 250 | + /* | |
| 100 | 251 | * (1)保存产检基本信息 (2)保存辅助检查信息 (3)批量保存病史信息(4)多个胎儿信息(5) 多个诊断信息 TODO |
| 101 | 252 | */ |
| 102 | 253 | // 对象转换 |
| 103 | 254 | |
| ... | ... | @@ -122,15 +273,16 @@ |
| 122 | 273 | */ |
| 123 | 274 | @RequestMapping(value = "/antexmanage", method = RequestMethod.GET) |
| 124 | 275 | @ResponseBody |
| 125 | - public AjaxResult selectExamHistory(String cardNo, String vcCardNo, String orgId) {// orgId或来自token | |
| 276 | + public AjaxResult selectExamHistory(String cardNo, String vcCardNo) { | |
| 126 | 277 | /* |
| 127 | 278 | * (1)孕妇档案信息(通过证件号或就诊卡号查询)-根据产检券查询 TODO (2)高危因素列表 TODO (3)产检记录列表 TODO |
| 128 | 279 | * |
| 129 | 280 | */ |
| 130 | 281 | // 基本验证 |
| 131 | - if (StringUtils.isEmpty(orgId)) { | |
| 132 | - return AjaxResult.returnFail("入参错误:医院ID为空"); | |
| 133 | - } | |
| 282 | + String orgId = "1";// orgId或来自token | |
| 283 | +// if (StringUtils.isEmpty(orgId)) { | |
| 284 | +// return AjaxResult.returnFail("入参错误:医院ID为空"); | |
| 285 | +// } | |
| 134 | 286 | if (StringUtils.isEmpty(cardNo) && StringUtils.isEmpty(vcCardNo)) { |
| 135 | 287 | return AjaxResult.returnFail("入参错误:查询条件为空"); |
| 136 | 288 | } |
| ... | ... | @@ -152,7 +304,7 @@ |
| 152 | 304 | } |
| 153 | 305 | // 未查询到孕妇建档信息 |
| 154 | 306 | if (dbFetationRecord == null) { |
| 155 | - return AjaxResult.returnFail("未查询到孕妇建档信息"); | |
| 307 | + return AjaxResult.returnSuccess(null);//将基本的对象返回空 | |
| 156 | 308 | } |
| 157 | 309 | // (2)高危因素列表 TODO |
| 158 | 310 | List<Map<String, Object>> riskFactor = new ArrayList<>(); |
parent/hospital.web/src/main/java/com/lyms/hospital/dao/sys/SyncDataBasicMapper.java
View file @
ec6cdc6
| 1 | -package com.lyms.hospital.dao.sys; | |
| 2 | - | |
| 3 | -import java.io.Serializable; | |
| 4 | -import java.util.List; | |
| 5 | - | |
| 6 | -import org.springframework.stereotype.Repository; | |
| 7 | - | |
| 8 | -import com.baomidou.mybatisplus.mapper.BaseMapper; | |
| 9 | -import com.lyms.hospital.entity.sys.SyncDataBasic; | |
| 10 | - | |
| 11 | -/** | |
| 12 | - * <p> | |
| 13 | - * Mapper接口 | |
| 14 | - * </p> | |
| 15 | - * | |
| 16 | - * @author maliang | |
| 17 | - * @since 2017-03-15 | |
| 18 | - */ | |
| 19 | -@Repository | |
| 20 | -public interface SyncDataBasicMapper extends BaseMapper<SyncDataBasic> { | |
| 21 | - | |
| 22 | - public Integer deleteLogicById(Serializable id); | |
| 23 | - | |
| 24 | - /** | |
| 25 | - * <li>@Description: 批量更新 | |
| 26 | - * <li>@param ids | |
| 27 | - * <li>@return | |
| 28 | - * <li>创建人:maliang | |
| 29 | - * <li>创建时间:2017年3月15日 | |
| 30 | - * <li>修改人: | |
| 31 | - * <li>修改时间: | |
| 32 | - */ | |
| 33 | - public Integer updateBatchByIds(List<Serializable> ids); | |
| 34 | - | |
| 35 | -} |
parent/hospital.web/src/main/java/com/lyms/hospital/dao/sys/SyncDataBasicMapper.xml
View file @
ec6cdc6
| 1 | -<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | -<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |
| 3 | -"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
| 4 | -<mapper namespace="com.lyms.hospital.dao.sys.SyncDataBasicMapper"> | |
| 5 | - | |
| 6 | - <!-- 通用查询映射结果 --> | |
| 7 | - <resultMap id="BaseResultMap" type="com.lyms.hospital.entity.sys.SyncDataBasic"> | |
| 8 | - <id column="ID" property="id" /> | |
| 9 | - <result column="DATA" property="data" /> | |
| 10 | - <result column="CREATE_TIME" property="createTime" /> | |
| 11 | - <result column="IFSUC" property="ifsuc" /> | |
| 12 | - </resultMap> | |
| 13 | - | |
| 14 | - <!-- 通用查询结果列 --> | |
| 15 | - <sql id="Base_Column_List"> | |
| 16 | - ID AS id, DATA AS data, CREATE_TIME AS createTime, IFSUC AS ifsuc | |
| 17 | - </sql> | |
| 18 | - | |
| 19 | - <sql id="Base_table"> | |
| 20 | - SYNC_DATA_BASIC | |
| 21 | - </sql> | |
| 22 | - | |
| 23 | - | |
| 24 | - <update id="updateBatchByIds" parameterType="list"> | |
| 25 | - update from <include refid="Base_table" /> as sb set sb.ifsuc=1 | |
| 26 | - where sb.id in | |
| 27 | - <foreach item="item" collection="ids" open="(" close=")" separator=","> | |
| 28 | - #{item} | |
| 29 | - </foreach> | |
| 30 | - </update> | |
| 31 | - | |
| 32 | -</mapper> |
parent/hospital.web/src/main/java/com/lyms/hospital/entity/sys/SyncDataBasic.java
View file @
ec6cdc6
| 1 | -package com.lyms.hospital.entity.sys; | |
| 2 | - | |
| 3 | -import java.io.Serializable; | |
| 4 | -import java.util.Date; | |
| 5 | - | |
| 6 | -import com.baomidou.mybatisplus.annotations.TableField; | |
| 7 | -import com.baomidou.mybatisplus.annotations.TableId; | |
| 8 | -import com.baomidou.mybatisplus.annotations.TableName; | |
| 9 | -import com.lyms.sync.channel.ChannelData; | |
| 10 | - | |
| 11 | -/** | |
| 12 | - * | |
| 13 | - * <p> | |
| 14 | - * 用户、角色、权限、医院、部门等基础数据同步 | |
| 15 | - * </p> | |
| 16 | - * | |
| 17 | - * @author maliang | |
| 18 | - * @since 2017-03-15 | |
| 19 | - */ | |
| 20 | -@TableName("SYNC_DATA_BASIC") | |
| 21 | -public class SyncDataBasic implements Serializable { | |
| 22 | - | |
| 23 | - private static final long serialVersionUID = 1L; | |
| 24 | - | |
| 25 | - /** | |
| 26 | - * 该ID 一定要与data 中的ID一致 | |
| 27 | - */ | |
| 28 | - @TableId(value = "ID") | |
| 29 | - private String id; | |
| 30 | - /** | |
| 31 | - * 数据对象 {@link ChannelData} json 数据格式 | |
| 32 | - */ | |
| 33 | - @TableField(value = "DATA") | |
| 34 | - private String data; | |
| 35 | - /** | |
| 36 | - * 创建时间 | |
| 37 | - */ | |
| 38 | - @TableField(value = "CREATE_TIME") | |
| 39 | - private Date createTime; | |
| 40 | - /** | |
| 41 | - * 数据上传是否成功 | |
| 42 | - */ | |
| 43 | - @TableField(value = "IFSUC") | |
| 44 | - private Integer ifsuc; | |
| 45 | - | |
| 46 | - public String getId() { | |
| 47 | - return id; | |
| 48 | - } | |
| 49 | - | |
| 50 | - public void setId(String id) { | |
| 51 | - this.id = id; | |
| 52 | - } | |
| 53 | - | |
| 54 | - public String getData() { | |
| 55 | - return data; | |
| 56 | - } | |
| 57 | - | |
| 58 | - public void setData(String data) { | |
| 59 | - this.data = data; | |
| 60 | - } | |
| 61 | - | |
| 62 | - public Date getCreateTime() { | |
| 63 | - return createTime; | |
| 64 | - } | |
| 65 | - | |
| 66 | - public void setCreateTime(Date createTime) { | |
| 67 | - this.createTime = createTime; | |
| 68 | - } | |
| 69 | - | |
| 70 | - public Integer getIfsuc() { | |
| 71 | - return ifsuc; | |
| 72 | - } | |
| 73 | - | |
| 74 | - public void setIfsuc(Integer ifsuc) { | |
| 75 | - this.ifsuc = ifsuc; | |
| 76 | - } | |
| 77 | - | |
| 78 | -} |
parent/hospital.web/src/main/java/com/lyms/hospital/request/exam/ExamAddRequest.java
View file @
ec6cdc6
| ... | ... | @@ -49,27 +49,30 @@ |
| 49 | 49 | // private Map ysfyHistory; |
| 50 | 50 | // // 本次妊娠情况 |
| 51 | 51 | // private Map cestationInfo; |
| 52 | -// // 丈夫健康情况 | |
| 53 | -// private Map hHealthInfo; | |
| 54 | - | |
| 55 | - // 既往史 | |
| 56 | - private Map<String,Object> JWS; | |
| 57 | - // 家族史 | |
| 58 | - private Map<String,Object> JZS; | |
| 59 | - // 个人史 | |
| 60 | - private Map<String,Object> GRS; | |
| 61 | - // 疫苗接种史 | |
| 62 | - private Map<String,Object> YMJZS; | |
| 63 | - // 药物过敏史 | |
| 64 | - private Map<String,Object> YWGMS; | |
| 65 | - // 妇科手术史 | |
| 66 | - private Map<String,Object> FKSSS; | |
| 67 | - // 叶酸服用 | |
| 68 | - private Map<String,Object> YSFY; | |
| 69 | - // 本次妊娠情况 | |
| 70 | - private Map<String,Object> BCRSQK; | |
| 71 | 52 | // 丈夫健康情况 |
| 72 | - private Map<String,Object> ZFJKQK; | |
| 53 | + private Map<String,String> hHealthInfo; | |
| 54 | + | |
| 55 | + //病史信息 | |
| 56 | + private Map<String,Object> historyInfo; | |
| 57 | + | |
| 58 | +// // 既往史 | |
| 59 | +// private Map<String,Object> JWS; | |
| 60 | +// // 家族史 | |
| 61 | +// private Map<String,Object> JZS; | |
| 62 | +// // 个人史 | |
| 63 | +// private Map<String,Object> GRS; | |
| 64 | +// // 疫苗接种史 | |
| 65 | +// private Map<String,Object> YMJZS; | |
| 66 | +// // 药物过敏史 | |
| 67 | +// private Map<String,Object> YWGMS; | |
| 68 | +// // 妇科手术史 | |
| 69 | +// private Map<String,Object> FKSSS; | |
| 70 | +// // 叶酸服用 | |
| 71 | +// private Map<String,Object> YSFY; | |
| 72 | +// // 本次妊娠情况 | |
| 73 | +// private Map<String,Object> BCRSQK; | |
| 74 | +// // 丈夫健康情况 | |
| 75 | +// private Map<String,Object> ZFJKQK; | |
| 73 | 76 | |
| 74 | 77 | // 孕次 |
| 75 | 78 | private Integer pregnancyTimes; |
| ... | ... | @@ -122,7 +125,7 @@ |
| 122 | 125 | |
| 123 | 126 | private String bg; |
| 124 | 127 | |
| 125 | - private List placentas; | |
| 128 | + private List<Map<String,Object>> placentas; | |
| 126 | 129 | // //心率 |
| 127 | 130 | // private double heartRate; |
| 128 | 131 | // //胎方位 |
| 129 | 132 | |
| ... | ... | @@ -789,11 +792,11 @@ |
| 789 | 792 | this.otherHighRisk = otherHighRisk; |
| 790 | 793 | } |
| 791 | 794 | |
| 792 | - public List getPlacentas() { | |
| 795 | + public List<Map<String,Object>> getPlacentas() { | |
| 793 | 796 | return placentas; |
| 794 | 797 | } |
| 795 | 798 | |
| 796 | - public void setPlacentas(List placentas) { | |
| 799 | + public void setPlacentas(List<Map<String,Object>> placentas) { | |
| 797 | 800 | this.placentas = placentas; |
| 798 | 801 | } |
| 799 | 802 | |
| 800 | 803 | |
| 801 | 804 | |
| 802 | 805 | |
| 803 | 806 | |
| ... | ... | @@ -845,77 +848,23 @@ |
| 845 | 848 | this.pid = pid; |
| 846 | 849 | } |
| 847 | 850 | |
| 848 | - public Map<String, Object> getJWS() { | |
| 849 | - return JWS; | |
| 851 | + public Map<String, Object> getHistoryInfo() { | |
| 852 | + return historyInfo; | |
| 850 | 853 | } |
| 851 | 854 | |
| 852 | - public void setJWS(Map<String, Object> jWS) { | |
| 853 | - JWS = jWS; | |
| 855 | + public void setHistoryInfo(Map<String, Object> historyInfo) { | |
| 856 | + this.historyInfo = historyInfo; | |
| 854 | 857 | } |
| 855 | 858 | |
| 856 | - public Map<String, Object> getJZS() { | |
| 857 | - return JZS; | |
| 859 | + public Map<String, String> gethHealthInfo() { | |
| 860 | + return hHealthInfo; | |
| 858 | 861 | } |
| 859 | 862 | |
| 860 | - public void setJZS(Map<String, Object> jZS) { | |
| 861 | - JZS = jZS; | |
| 863 | + public void sethHealthInfo(Map<String, String> hHealthInfo) { | |
| 864 | + this.hHealthInfo = hHealthInfo; | |
| 862 | 865 | } |
| 863 | - | |
| 864 | - public Map<String, Object> getGRS() { | |
| 865 | - return GRS; | |
| 866 | - } | |
| 867 | - | |
| 868 | - public void setGRS(Map<String, Object> gRS) { | |
| 869 | - GRS = gRS; | |
| 870 | - } | |
| 871 | - | |
| 872 | - public Map<String, Object> getYMJZS() { | |
| 873 | - return YMJZS; | |
| 874 | - } | |
| 875 | - | |
| 876 | - public void setYMJZS(Map<String, Object> yMJZS) { | |
| 877 | - YMJZS = yMJZS; | |
| 878 | - } | |
| 879 | - | |
| 880 | - public Map<String, Object> getYWGMS() { | |
| 881 | - return YWGMS; | |
| 882 | - } | |
| 883 | - | |
| 884 | - public void setYWGMS(Map<String, Object> yWGMS) { | |
| 885 | - YWGMS = yWGMS; | |
| 886 | - } | |
| 887 | - | |
| 888 | - public Map<String, Object> getFKSSS() { | |
| 889 | - return FKSSS; | |
| 890 | - } | |
| 891 | - | |
| 892 | - public void setFKSSS(Map<String, Object> fKSSS) { | |
| 893 | - FKSSS = fKSSS; | |
| 894 | - } | |
| 895 | - | |
| 896 | - public Map<String, Object> getYSFY() { | |
| 897 | - return YSFY; | |
| 898 | - } | |
| 899 | - | |
| 900 | - public void setYSFY(Map<String, Object> ySFY) { | |
| 901 | - YSFY = ySFY; | |
| 902 | - } | |
| 903 | - | |
| 904 | - public Map<String, Object> getBCRSQK() { | |
| 905 | - return BCRSQK; | |
| 906 | - } | |
| 907 | - | |
| 908 | - public void setBCRSQK(Map<String, Object> bCRSQK) { | |
| 909 | - BCRSQK = bCRSQK; | |
| 910 | - } | |
| 911 | - | |
| 912 | - public Map<String, Object> getZFJKQK() { | |
| 913 | - return ZFJKQK; | |
| 914 | - } | |
| 915 | - | |
| 916 | - public void setZFJKQK(Map<String, Object> zFJKQK) { | |
| 917 | - ZFJKQK = zFJKQK; | |
| 918 | - } | |
| 866 | + | |
| 867 | + | |
| 919 | 868 | |
| 920 | 869 | } |
parent/hospital.web/src/main/java/com/lyms/hospital/request/exam/ExamAddRequestWrapper.java
View file @
ec6cdc6
| 1 | 1 | package com.lyms.hospital.request.exam; |
| 2 | 2 | |
| 3 | +import java.util.ArrayList; | |
| 3 | 4 | import java.util.List; |
| 4 | 5 | import java.util.Map; |
| 5 | -import java.util.Set; | |
| 6 | 6 | |
| 7 | 7 | import com.lyms.hospital.entity.assist.DiagnoseAssit; |
| 8 | 8 | import com.lyms.hospital.entity.diagnose.DiagnoseInfo; |
| ... | ... | @@ -13,7 +13,7 @@ |
| 13 | 13 | import com.lyms.hospital.util.trans.XjhMapUtil; |
| 14 | 14 | |
| 15 | 15 | public class ExamAddRequestWrapper { |
| 16 | - | |
| 16 | + | |
| 17 | 17 | /** |
| 18 | 18 | * 产前检查初诊-前端业务对象 |
| 19 | 19 | */ |
| 20 | 20 | |
| 21 | 21 | |
| 22 | 22 | |
| 23 | 23 | |
| ... | ... | @@ -29,18 +29,36 @@ |
| 29 | 29 | /** |
| 30 | 30 | * 病史列表信息 |
| 31 | 31 | */ |
| 32 | - private List<HistoryMaps> historyMapsList; | |
| 32 | + private List<HistoryMaps> historyMapsList = new ArrayList<>(); | |
| 33 | 33 | /** |
| 34 | 34 | * 胎儿列表信息 |
| 35 | 35 | */ |
| 36 | - private List<DiagnoseTai> diagnoseTaiList; | |
| 36 | + private List<DiagnoseTai> diagnoseTaiList = new ArrayList<>(); | |
| 37 | + | |
| 38 | + public ExamAddRequestWrapper(DiagnoseInfo info,DiagnoseAssit assist, | |
| 39 | + List<HistoryMaps> historyMapsList,List<DiagnoseTai> diagnoseTaiList) { | |
| 40 | + this.diagnoseInfo = info; | |
| 41 | + this.diagnoseAssit = assist; | |
| 42 | + this.historyMapsList = historyMapsList; | |
| 43 | + this.diagnoseTaiList = diagnoseTaiList; | |
| 44 | + | |
| 45 | + Map<String, Object> infoMap = XjhMapUtil.transBean2FormatAliasMap(info, | |
| 46 | + XjhMapUtil.getKeyMap(WomanExamKeymap.original, WomanExamKeymap.alias)); | |
| 47 | + Map<String, Object> assistMap = XjhMapUtil.transBean2FormatAliasMap(assist, | |
| 48 | + XjhMapUtil.getKeyMap(WomanExamKeymap.original, WomanExamKeymap.alias)); | |
| 49 | + infoMap.putAll(assistMap); | |
| 50 | + this.examAddRequest = (ExamAddRequest) XjhMapUtil.transMap2AliasBean(infoMap, new ExamAddRequest(), | |
| 51 | + XjhMapUtil.getKeyMap(WomanExamKeymap.original, WomanExamKeymap.alias)); | |
| 52 | + } | |
| 37 | 53 | |
| 38 | - public ExamAddRequestWrapper(){} | |
| 39 | - | |
| 54 | + public ExamAddRequestWrapper(){ | |
| 55 | + | |
| 56 | + } | |
| 57 | + | |
| 40 | 58 | @SuppressWarnings("unchecked") |
| 41 | - public ExamAddRequestWrapper(ExamAddRequest request){ | |
| 59 | + public ExamAddRequestWrapper(ExamAddRequest request) { | |
| 42 | 60 | this.examAddRequest = request; |
| 43 | - if(request!=null){ | |
| 61 | + if (request != null) { | |
| 44 | 62 | /* |
| 45 | 63 | * 产检基本信息 |
| 46 | 64 | */ |
| 47 | 65 | |
| 48 | 66 | |
| 49 | 67 | |
| 50 | 68 | |
| 51 | 69 | |
| ... | ... | @@ -48,24 +66,48 @@ |
| 48 | 66 | XjhMapUtil.getKeyMap(WomanExamKeymap.original, WomanExamKeymap.alias)); |
| 49 | 67 | diagnoseInfo = (DiagnoseInfo) XjhMapUtil.transMap2FormatBean(infoMap, new DiagnoseInfo()); |
| 50 | 68 | diagnoseInfo.setWomanId(request.getParentId());// 孕妇档案ID |
| 51 | - diagnoseInfo.setPersonId(request.getPid());// 女性居民ID | |
| 69 | + diagnoseInfo.setPersonId(request.getPid());// 女性居民 | |
| 70 | + diagnoseInfo.setOrgId(null);// 医院ID TODO 来自于token 登录信息 | |
| 52 | 71 | // 血压 |
| 53 | - Map<String,Object> bp = request.getBp(); | |
| 72 | + Map<String, Object> bp = request.getBp(); | |
| 54 | 73 | if (bp != null) { |
| 55 | 74 | String[] original = { "ssy", "szy" }; |
| 56 | 75 | String[] alias = { "bloodShrink", "bloodDiastole", }; |
| 57 | - diagnoseInfo = (DiagnoseInfo) XjhMapUtil.transMap2AliasBean(bp, diagnoseInfo, XjhMapUtil.getKeyMap(original, alias)); | |
| 76 | + diagnoseInfo = (DiagnoseInfo) XjhMapUtil.transMap2AliasBean(bp, diagnoseInfo, | |
| 77 | + XjhMapUtil.getKeyMap(original, alias)); | |
| 58 | 78 | } |
| 59 | 79 | /* |
| 60 | 80 | * 产检辅助检查 |
| 61 | 81 | */ |
| 62 | 82 | Map<String, Object> assistMap = XjhMapUtil.transBean2FormatAliasMap(request, |
| 63 | 83 | XjhMapUtil.getKeyMap(DiagnoseAssistKeymap.original, DiagnoseAssistKeymap.alias)); |
| 84 | + // 处理辅助检查,将老版本的"yin","ruoyang","yang"字符串覆盖为数字保存 | |
| 85 | + if (assistMap != null && !assistMap.isEmpty()) { | |
| 86 | + for (String key : assistMap.keySet()) { | |
| 87 | + String str = this.obj2Str(assistMap.get(key)); | |
| 88 | + if ("yin".equals(str)) { | |
| 89 | + assistMap.put(key, DiagnoseAssit.YIN + ""); | |
| 90 | + } else if ("yang".equals(str)) { | |
| 91 | + assistMap.put(key, DiagnoseAssit.YANG + ""); | |
| 92 | + } else if ("ruoyang".equals(str)) { | |
| 93 | + assistMap.put(key, DiagnoseAssit.RUOYANG + ""); | |
| 94 | + } | |
| 95 | + } | |
| 96 | + } | |
| 64 | 97 | diagnoseAssit = (DiagnoseAssit) XjhMapUtil.transMap2FormatBean(assistMap, new DiagnoseAssit()); |
| 65 | 98 | // 其他老版本结构数据补录 |
| 66 | 99 | // 阴道分泌物 |
| 67 | - Map<String,Object> ydfmw = request.getYdfmw(); | |
| 100 | + Map<String, Object> ydfmw = request.getYdfmw(); | |
| 68 | 101 | if (ydfmw != null) { |
| 102 | + // 老版本布尔类型,转变为 int 值 | |
| 103 | + for (String key : ydfmw.keySet()) { | |
| 104 | + String str = this.obj2Str(ydfmw.get(key)); | |
| 105 | + if ("true".equals(str)) { | |
| 106 | + ydfmw.put(key, 1); | |
| 107 | + } else if ("false".equals(str)) { | |
| 108 | + ydfmw.put(key, 0); | |
| 109 | + } | |
| 110 | + } | |
| 69 | 111 | String[] original = { "ydqjd", "dc", "jsjmj", "qt", "qtText" }; |
| 70 | 112 | String[] alias = { "vaginaYdqjd", "vaginaDc", "vaginaJsjmj", "vaginaOther", "vaginaOtherTxt" }; |
| 71 | 113 | diagnoseAssit = (DiagnoseAssit) XjhMapUtil.transMap2AliasBean(ydfmw, diagnoseAssit, |
| 72 | 114 | |
| 73 | 115 | |
| 74 | 116 | |
| 75 | 117 | |
| 76 | 118 | |
| 77 | 119 | |
| 78 | 120 | |
| 79 | 121 | |
| 80 | 122 | |
| 81 | 123 | |
| 82 | 124 | |
| 83 | 125 | |
| 84 | 126 | |
| 85 | 127 | |
| 86 | 128 | |
| ... | ... | @@ -74,57 +116,117 @@ |
| 74 | 116 | /* |
| 75 | 117 | * 病史信息 |
| 76 | 118 | */ |
| 77 | - Map<String,Object> jws = request.getJWS(); | |
| 78 | - if(jws!=null){ | |
| 79 | - String jws_yesOrNo = jws.get("yesOrNo").toString(); | |
| 80 | - String jws_id = jws.get("id").toString(); | |
| 81 | - if("yes".equals(jws_yesOrNo)){ | |
| 82 | -// historyMapsList.add(arg0); | |
| 119 | + Map<String, Object> historyInfo = request.getHistoryInfo(); | |
| 120 | + if (historyInfo != null && !historyInfo.isEmpty()) { | |
| 121 | + for (String key1 : historyInfo.keySet()) {// 遍历1级 | |
| 122 | + Map<String, Object> map1 = (Map<String, Object>) historyInfo.get(key1);// 1级节点 | |
| 123 | + if (map1 != null) { | |
| 124 | + // 处理1级节点 | |
| 125 | + String node1_yesOrNo = this.obj2Str(map1.get("yesOrNo")); | |
| 126 | + String node1_id = this.obj2Str(map1.get("id")); | |
| 127 | + if ("yes".equals(node1_yesOrNo)) { | |
| 128 | + historyMapsList.add(new HistoryMaps(node1_id, null)); | |
| 129 | + } | |
| 130 | + // 处理2级节点 | |
| 131 | + for (String key2 : map1.keySet()) { | |
| 132 | + Map<String, Object> map2 = (Map<String, Object>) historyInfo.get(key2);// 2级节点 | |
| 133 | + if (map2 != null) { | |
| 134 | + String node2_checkBox = map2.get("checkBox").toString(); | |
| 135 | + if ("true".equals(node2_checkBox)) { | |
| 136 | + if ("JWS".equals(key1)) {// 既往史特殊处理(3级结构) | |
| 137 | + if (map2.containsKey("selected") && map2.get("selected") != null) { | |
| 138 | + List<String> node3_ids = (List<String>) map2.get("selected"); | |
| 139 | + if (node3_ids != null && !node3_ids.isEmpty()) { | |
| 140 | + for (String node3_id : node3_ids) { | |
| 141 | + historyMapsList.add(new HistoryMaps(node3_id, null));// 处理3级节点 | |
| 142 | + } | |
| 143 | + } | |
| 144 | + } | |
| 145 | + | |
| 146 | + } else {// 其他病史信息(2级结构) | |
| 147 | + String node2_text = null; | |
| 148 | + if (map2.containsKey("selected") && map2.get("selected") != null) { | |
| 149 | + node2_text = map2.get("selected").toString(); | |
| 150 | + } | |
| 151 | + historyMapsList.add(new HistoryMaps(key2, node2_text)); | |
| 152 | + } | |
| 153 | + } | |
| 154 | + } | |
| 155 | + } | |
| 156 | + } | |
| 83 | 157 | } |
| 84 | - Set<String> keySet = jws.keySet(); | |
| 158 | + } // 病史信息 end | |
| 159 | + // hHealthInfo 丈夫健康情况(特殊处理) | |
| 160 | + Map<String, String> hHealthInfo = request.gethHealthInfo(); | |
| 161 | + if (hHealthInfo != null) { | |
| 162 | + if ("yes".equals(this.obj2Str(hHealthInfo.get("yesOrNo")))) { | |
| 163 | + historyMapsList.add(new HistoryMaps(HistoryMaps.ZFJKQK, this.obj2Str(hHealthInfo.get("qt")))); | |
| 164 | + } | |
| 85 | 165 | } |
| 86 | - | |
| 87 | - | |
| 88 | - historyMapsList = request.getHistoryList();// 病史信息 | |
| 89 | 166 | /* |
| 90 | - * 胎儿信息、诊断信息 | |
| 167 | + * 胎儿信息 | |
| 91 | 168 | */ |
| 92 | - diagnoseTaiList = request.getTaiList(); // 胎儿信息 | |
| 93 | - // TODO 诊断信息 | |
| 169 | + List<Map<String, Object>> placentas = request.getPlacentas(); | |
| 170 | + if (placentas != null && !placentas.isEmpty()) { | |
| 171 | + for (Map<String, Object> map : placentas) { | |
| 172 | + DiagnoseTai tai = new DiagnoseTai(); | |
| 173 | + tai.setHeartRate(this.obj2Str(map.get("heartRate"))); | |
| 174 | + tai.setPosition(this.obj2Str(map.get("fetalPosition"))); | |
| 175 | + tai.setFirstExpose(this.obj2Str(map.get("fetalPresentation"))); | |
| 176 | + tai.setIsLink(map.get("join") == null ? null : Integer.parseInt(map.get("join").toString())); | |
| 177 | + diagnoseTaiList.add(tai); | |
| 178 | + } | |
| 179 | + } | |
| 180 | + /* | |
| 181 | + * 诊断信息 TODO | |
| 182 | + */ | |
| 94 | 183 | } |
| 95 | 184 | } |
| 96 | - | |
| 97 | - //getter and setter | |
| 185 | + | |
| 186 | + private String obj2Str(Object obj) { | |
| 187 | + return obj == null ? null : obj.toString(); | |
| 188 | + } | |
| 189 | + | |
| 190 | + // getter and setter | |
| 98 | 191 | public ExamAddRequest getExamAddRequest() { |
| 99 | 192 | return examAddRequest; |
| 100 | 193 | } |
| 194 | + | |
| 101 | 195 | public void setExamAddRequest(ExamAddRequest examAddRequest) { |
| 102 | 196 | this.examAddRequest = examAddRequest; |
| 103 | 197 | } |
| 198 | + | |
| 104 | 199 | public DiagnoseInfo getDiagnoseInfo() { |
| 105 | 200 | return diagnoseInfo; |
| 106 | 201 | } |
| 202 | + | |
| 107 | 203 | public void setDiagnoseInfo(DiagnoseInfo diagnoseInfo) { |
| 108 | 204 | this.diagnoseInfo = diagnoseInfo; |
| 109 | 205 | } |
| 206 | + | |
| 110 | 207 | public DiagnoseAssit getDiagnoseAssit() { |
| 111 | 208 | return diagnoseAssit; |
| 112 | 209 | } |
| 210 | + | |
| 113 | 211 | public void setDiagnoseAssit(DiagnoseAssit diagnoseAssit) { |
| 114 | 212 | this.diagnoseAssit = diagnoseAssit; |
| 115 | 213 | } |
| 214 | + | |
| 116 | 215 | public List<HistoryMaps> getHistoryMapsList() { |
| 117 | 216 | return historyMapsList; |
| 118 | 217 | } |
| 218 | + | |
| 119 | 219 | public void setHistoryMapsList(List<HistoryMaps> historyMapsList) { |
| 120 | 220 | this.historyMapsList = historyMapsList; |
| 121 | 221 | } |
| 222 | + | |
| 122 | 223 | public List<DiagnoseTai> getDiagnoseTaiList() { |
| 123 | 224 | return diagnoseTaiList; |
| 124 | 225 | } |
| 226 | + | |
| 125 | 227 | public void setDiagnoseTaiList(List<DiagnoseTai> diagnoseTaiList) { |
| 126 | 228 | this.diagnoseTaiList = diagnoseTaiList; |
| 127 | 229 | } |
| 128 | - | |
| 230 | + | |
| 129 | 231 | } |
parent/hospital.web/src/main/java/com/lyms/hospital/response/keymap/WomanExamKeymap.java
View file @
ec6cdc6
parent/hospital.web/src/main/java/com/lyms/hospital/service/sys/SyncDataBasicService.java
View file @
ec6cdc6
| 1 | -package com.lyms.hospital.service.sys; | |
| 2 | - | |
| 3 | -import java.io.Serializable; | |
| 4 | -import java.util.List; | |
| 5 | - | |
| 6 | -import com.lyms.base.common.enums.SyncParamEnum; | |
| 7 | -import com.lyms.hospital.entity.sys.SyncDataBasic; | |
| 8 | -import com.lyms.sync.channel.ChannelData; | |
| 9 | -import com.lyms.web.service.BaseService; | |
| 10 | - | |
| 11 | -/** | |
| 12 | - * <p> | |
| 13 | - * 数据同步模块 | |
| 14 | - * </p> | |
| 15 | - * | |
| 16 | - * @author maliang | |
| 17 | - * @since 2017-03-15 | |
| 18 | - */ | |
| 19 | -public interface SyncDataBasicService extends BaseService<SyncDataBasic> { | |
| 20 | - | |
| 21 | - /** | |
| 22 | - * <li>@Description:逻辑删除,ifDel = 1 为删除,否则为没有删除 | |
| 23 | - * <li>@param id 删除主键id | |
| 24 | - * <li>@return 大于0修改成功,否则为失败 | |
| 25 | - */ | |
| 26 | - public Integer deleteLogicById(Serializable id); | |
| 27 | - | |
| 28 | - /** | |
| 29 | - * <li>@Description:更新同步成功的数据 | |
| 30 | - * <li>@param ids | |
| 31 | - * <li>@return | |
| 32 | - * <li>创建人:maliang | |
| 33 | - * <li>创建时间:2017年3月15日 | |
| 34 | - * <li>修改人: | |
| 35 | - * <li>修改时间: | |
| 36 | - */ | |
| 37 | - public Boolean updateBasic(List<Serializable> ids); | |
| 38 | - | |
| 39 | - /** | |
| 40 | - * 获取一条数据 | |
| 41 | - * <li>@Description:TODO(方法描述) | |
| 42 | - * <li>@return | |
| 43 | - * <li>创建人:maliang | |
| 44 | - * <li>创建时间:2017年3月15日 | |
| 45 | - * <li>修改人: | |
| 46 | - * <li>修改时间: | |
| 47 | - */ | |
| 48 | - public ChannelData selectOne(); | |
| 49 | - | |
| 50 | - public Boolean updateBasic(Serializable id); | |
| 51 | - /** | |
| 52 | - * <li>@Description:向同步库插入一个需要提交给center的同步任务 | |
| 53 | - * <li>@param syncParamConf | |
| 54 | - * <li>@param dataObjects 对象方法参数列表 | |
| 55 | - * <li>@return | |
| 56 | - * <li>创建人:方承 | |
| 57 | - * <li>创建时间:2017年4月11日 | |
| 58 | - * <li>修改人: | |
| 59 | - * <li>修改时间: | |
| 60 | - */ | |
| 61 | - public boolean addSyncData(SyncParamEnum syncParamConf,Object ...dataObjects); | |
| 62 | - | |
| 63 | -} |
parent/hospital.web/src/main/java/com/lyms/hospital/service/sys/impl/SyncDataBasicServiceImpl.java
View file @
ec6cdc6
| 1 | -package com.lyms.hospital.service.sys.impl; | |
| 2 | - | |
| 3 | -import java.io.Serializable; | |
| 4 | -import java.util.Date; | |
| 5 | -import java.util.List; | |
| 6 | - | |
| 7 | -import org.springframework.beans.factory.annotation.Autowired; | |
| 8 | -import org.springframework.stereotype.Service; | |
| 9 | -import org.springframework.transaction.annotation.Transactional; | |
| 10 | - | |
| 11 | -import com.baomidou.mybatisplus.mapper.EntityWrapper; | |
| 12 | -import com.baomidou.mybatisplus.service.impl.ServiceImpl; | |
| 13 | -import com.lyms.base.common.enums.SyncParamEnum; | |
| 14 | -import com.lyms.hospital.dao.sys.SyncDataBasicMapper; | |
| 15 | -import com.lyms.hospital.entity.sys.SyncDataBasic; | |
| 16 | -import com.lyms.hospital.service.sys.SyncDataBasicService; | |
| 17 | -import com.lyms.sync.ParamsAdpter; | |
| 18 | -import com.lyms.sync.channel.ChannelData; | |
| 19 | -import com.lyms.util.JsonUtils; | |
| 20 | -import com.lyms.util.StrUtils; | |
| 21 | - | |
| 22 | -/** | |
| 23 | - * <p> | |
| 24 | - * 用户、角色、权限、医院、部门等基础数据同步 服务实现类 | |
| 25 | - * </p> | |
| 26 | - * | |
| 27 | - * @author maliang | |
| 28 | - * @since 2017-03-15 | |
| 29 | - */ | |
| 30 | -@Service | |
| 31 | -public class SyncDataBasicServiceImpl extends ServiceImpl<SyncDataBasicMapper, SyncDataBasic> | |
| 32 | - implements SyncDataBasicService { | |
| 33 | - | |
| 34 | - @Autowired | |
| 35 | - private SyncDataBasicMapper basicMapper; | |
| 36 | - | |
| 37 | - public Integer deleteLogicById(Serializable id) { | |
| 38 | - return baseMapper.deleteLogicById(id); | |
| 39 | - } | |
| 40 | - | |
| 41 | - @Override | |
| 42 | - @Transactional | |
| 43 | - public Boolean updateBasic(List<Serializable> ids) { | |
| 44 | - Integer tag = basicMapper.updateBatchByIds(ids); | |
| 45 | - return tag >= 1 ? Boolean.TRUE : Boolean.FALSE; | |
| 46 | - } | |
| 47 | - | |
| 48 | - @Override | |
| 49 | - public Boolean updateBasic(Serializable id) { | |
| 50 | - SyncDataBasic dataBasic = baseMapper.selectById(id); | |
| 51 | - dataBasic.setIfsuc(1); | |
| 52 | - Integer tag = baseMapper.updateById(dataBasic); | |
| 53 | - return tag >= 1; | |
| 54 | - } | |
| 55 | - | |
| 56 | - @Override | |
| 57 | - public ChannelData selectOne() { | |
| 58 | - EntityWrapper<SyncDataBasic> ew = new EntityWrapper<SyncDataBasic>(); | |
| 59 | - ew.where("ifsuc=0"); | |
| 60 | - List<SyncDataBasic> datas = baseMapper.selectList(ew); | |
| 61 | - | |
| 62 | - // 单条同步,避免过于复杂的消息回执 | |
| 63 | - SyncDataBasic basic = datas != null && datas.size() > 0 ? datas.get(0) : null; | |
| 64 | - if (basic != null) { | |
| 65 | - ChannelData data = JsonUtils.jsonToBean(basic.getData(), ChannelData.class); | |
| 66 | - return data; | |
| 67 | - } | |
| 68 | - return ChannelData.emtpy(); | |
| 69 | - } | |
| 70 | - | |
| 71 | - @Override | |
| 72 | - public boolean addSyncData(SyncParamEnum syncParamConf, Object... dataObjects) { | |
| 73 | - SyncDataBasic entity = new SyncDataBasic(); | |
| 74 | - String uid = StrUtils.uuid(); | |
| 75 | - entity.setId(uid); | |
| 76 | - Date now = new Date(); | |
| 77 | - entity.setCreateTime(now); | |
| 78 | - | |
| 79 | - ChannelData cdata = new ChannelData(); | |
| 80 | - cdata.setAck(true); | |
| 81 | - ParamsAdpter adpter = ParamsAdpter.builder(); | |
| 82 | - for(Object param : dataObjects){ | |
| 83 | - adpter.push(param); | |
| 84 | - } | |
| 85 | - cdata.setData(adpter.toJsonString()); | |
| 86 | - cdata.setId(uid); | |
| 87 | - cdata.setLoop(false); | |
| 88 | - cdata.setRemoteClazz(syncParamConf.getRemoteClazz()); | |
| 89 | - cdata.setRemoteMethod(syncParamConf.getRemoteMethod()); | |
| 90 | - cdata.setTs(now.getTime()); | |
| 91 | - | |
| 92 | - entity.setData(cdata.toJsonString()); | |
| 93 | - Integer tag = baseMapper.insert(entity); | |
| 94 | - return tag >= 1 ? true : false; | |
| 95 | - } | |
| 96 | - | |
| 97 | -} |
parent/hospital.web/src/main/java/com/lyms/hospital/util/trans/XjhMapUtil.java
View file @
ec6cdc6
| ... | ... | @@ -121,7 +121,7 @@ |
| 121 | 121 | */ |
| 122 | 122 | if (keyType.equals(String.class) && key.length() > 3 |
| 123 | 123 | && "Str".equals(key.substring(key.length() - 3))) {// key可能是格式化字段 |
| 124 | - String dateKey = key.substring(key.length() - 3); | |
| 124 | + String dateKey = key.substring(0,key.length() - 3); | |
| 125 | 125 | for (PropertyDescriptor dateProperty : propertyDescriptors) { |
| 126 | 126 | if (dateKey.equals(dateProperty.getName())) {// 找到了对应的日期字段,set之 |
| 127 | 127 | String dateValue = value.toString(); |
parent/hospital.web/src/main/resources/dev/conf.properties
View file @
ec6cdc6
parent/hospital.web/src/main/resources/xml/app-datasource.xml
View file @
ec6cdc6
| ... | ... | @@ -61,8 +61,16 @@ |
| 61 | 61 | </property> |
| 62 | 62 | </bean> |
| 63 | 63 | |
| 64 | - <bean id="sqlSessionFactory" | |
| 65 | - class="com.baomidou.mybatisplus.spring.MybatisSqlSessionFactoryBean"> | |
| 64 | + <!-- 自定义注入器 --> | |
| 65 | + <bean id="deleteLogicByIdSqlInjector" class="com.lyms.mybatis.DeleteLogicByIdSqlInjector" /> | |
| 66 | + <!-- 注入配置 --> | |
| 67 | + <bean id="globalConfig" class="com.baomidou.mybatisplus.entity.GlobalConfiguration"> | |
| 68 | + <property name="sqlInjector" ref="deleteLogicByIdSqlInjector" /> | |
| 69 | + </bean> | |
| 70 | + | |
| 71 | + <bean id="sqlSessionFactory" class="com.baomidou.mybatisplus.spring.MybatisSqlSessionFactoryBean"> | |
| 72 | + <!-- 自定义注入 deleteByIdForYn 方法 --> | |
| 73 | + <property name="globalConfig" ref="globalConfig" /> | |
| 66 | 74 | <property name="dataSource" ref="dynamicDataSource" /> |
| 67 | 75 | <property name="plugins"> |
| 68 | 76 | <array> |
| ... | ... | @@ -83,21 +91,6 @@ |
| 83 | 91 | </property> |
| 84 | 92 | <!-- <property name="typeAliasesPackage" value="com.lyms.base.common.entity" /> --> |
| 85 | 93 | <property name="typeAliasesPackage" value="com.lyms.base.common.entity" /> |
| 86 | - | |
| 87 | - <!-- MP 全局配置注入 --> | |
| 88 | - <property name="globalConfig" ref="globalConfig" /> | |
| 89 | - </bean> | |
| 90 | - | |
| 91 | - <bean id="globalConfig" class="com.baomidou.mybatisplus.entity.GlobalConfiguration"> | |
| 92 | - <!-- MP 主键策略配置 AUTO->`0`("数据库ID自增") INPUT->`1`(用户输入ID") ID_WORKER->`2`("全局唯一ID") | |
| 93 | - UUID->`3`("全局唯一ID") --> | |
| 94 | - <property name="idType" value="3" /> | |
| 95 | - <!-- MYSQL->`mysql` ORACLE->`oracle` DB2->`db2` H2->`h2` HSQL->`hsql` SQLITE->`sqlite` | |
| 96 | - POSTGRE->`postgresql` SQLSERVER2005->`sqlserver2005` SQLSERVER->`sqlserver` --> | |
| 97 | - <!-- Oracle需要添加该项 --> | |
| 98 | - <!-- <property name="dbType" value="oracle" /> --> | |
| 99 | - <!-- 全局表为下划线命名设置 true --> | |
| 100 | - <!-- <property name="dbColumnUnderline" value="true" /> --> | |
| 101 | 94 | </bean> |
| 102 | 95 | |
| 103 | 96 | <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> |
parent/hospital.web/src/test/java/test/hospital/sync/SyncTest.java
View file @
ec6cdc6
| ... | ... | @@ -5,7 +5,7 @@ |
| 5 | 5 | |
| 6 | 6 | import com.lyms.base.common.entity.user.Users; |
| 7 | 7 | import com.lyms.base.common.enums.SyncParamEnum; |
| 8 | -import com.lyms.hospital.service.sys.SyncDataBasicService; | |
| 8 | +import com.lyms.base.common.service.sys.SyncDataBasicService; | |
| 9 | 9 | import com.lyms.util.DateTimeUtils; |
| 10 | 10 | |
| 11 | 11 | import test.hospital.BaseServiceTest; |