Commit f77a964958e1e591aad327b14f3c9617f1d7f8e1

Authored by hujiaqi

Merge remote-tracking branch 'origin/master'

Showing 7 changed files

platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PatientsService.java View file @ f77a964
... ... @@ -250,7 +250,7 @@
250 250 /**
251 251 * 修改非建档医院基本信息
252 252 */
253   - private void updateBaseData(Patients patients){
  253 + public void updateBaseData(Patients patients){
254 254 PatientsQuery patientsQuery2=new PatientsQuery();
255 255 patientsQuery2.setPid(patients.getPid());
256 256 patientsQuery2.setEnable("0");
platform-biz-service/src/main/resources/mainOrm/master/MasterOrganization.xml View file @ f77a964
... ... @@ -21,19 +21,21 @@
21 21 <result column="created" property="created" jdbcType="TIMESTAMP"/>
22 22 <result column="shortCode" property="shortCode" jdbcType="VARCHAR"/>
23 23 <result column="foreign_id" property="foreignId" jdbcType="VARCHAR"/>
  24 + <result column="bStatus" property="bStatus" jdbcType="INTEGER"/>
  25 +
24 26 </resultMap>
25 27  
26 28  
27 29 <insert id="addOrganization" parameterType="com.lyms.platform.permission.model.Organization">
28 30 <selectKey order="AFTER" keyProperty="id" resultType="java.lang.Integer">SELECT LAST_INSERT_ID()</selectKey>
29 31 insert into organization
30   - (foreign_id,name,type,level,area_manage,province_id,city_id,area_id,address,description,publish_id,publish_name,yn,modified,created,shortCode,street_id
  32 + (foreign_id,name,type,level,area_manage,province_id,city_id,area_id,address,description,publish_id,publish_name,yn,modified,created,shortCode,street_id,bStatus
31 33 <if test="id != null and id >= 0">
32 34 ,id
33 35 </if>
34 36 )
35 37 values
36   - (#{foreignId},#{name},#{type},#{level},#{areaManage},#{provinceId},#{cityId},#{areaId},#{address},#{description},#{publishId},#{publishName},#{yn},#{modified},#{created},#{shortCode},#{streetId}
  38 + (#{foreignId},#{name},#{type},#{level},#{areaManage},#{provinceId},#{cityId},#{areaId},#{address},#{description},#{publishId},#{publishName},#{yn},#{modified},#{created},#{shortCode},#{streetId},#{bStatus}
37 39 <if test="id != null and id >= 0">
38 40 ,#{id}
39 41 </if>
... ... @@ -62,6 +64,9 @@
62 64 <if test="provinceId != null">
63 65 province_id = #{provinceId,jdbcType=INTEGER},
64 66 </if>
  67 + <if test="bStatus !=null">
  68 + bStatus=#{bStatus,jdbcType=INTEGER},
  69 + </if>
65 70 <if test="cityId != null">
66 71 city_id = #{cityId,jdbcType=INTEGER},
67 72 </if>
... ... @@ -109,7 +114,7 @@
109 114  
110 115  
111 116 <select id="getOrganization" resultMap="OrganizationResultMap" parameterType="java.lang.Integer">
112   -select id,name,type,level,area_manage,province_id,city_id,area_id,address,description,publish_id,publish_name,yn,modified,created,shortCode,foreign_id,street_id,status
  117 +select id,name,type,level,area_manage,province_id,city_id,area_id,address,description,publish_id,publish_name,yn,modified,created,shortCode,foreign_id,street_id,status,bStatus
113 118 from organization where id = #{id,jdbcType=INTEGER}
114 119 </select>
115 120  
... ... @@ -213,7 +218,7 @@
213 218 <select id="queryOrganization" resultMap="OrganizationResultMap"
214 219 parameterType="com.lyms.platform.permission.model.OrganizationQuery">
215 220 select
216   - id,name,type,level,area_manage,province_id,city_id,area_id,address,description,publish_id,publish_name,yn,modified,created,shortCode,foreign_id,street_id,status
  221 + id,name,type,level,area_manage,province_id,city_id,area_id,address,description,publish_id,publish_name,yn,modified,created,shortCode,foreign_id,street_id,status,bStatus
217 222 from organization
218 223 <include refid="OrganizationCondition"/>
219 224 <include refid="orderAndLimit"/>
platform-biz-service/src/main/resources/mainOrm/slave/Organization.xml View file @ f77a964
... ... @@ -21,19 +21,20 @@
21 21 <result column="created" property="created" jdbcType="TIMESTAMP"/>
22 22 <result column="shortCode" property="shortCode" jdbcType="VARCHAR"/>
23 23 <result column="foreign_id" property="foreignId" jdbcType="VARCHAR"/>
  24 + <result column="bStatus" property="bStatus" jdbcType="INTEGER"/>
24 25 </resultMap>
25 26  
26 27  
27 28 <insert id="addOrganization" parameterType="com.lyms.platform.permission.model.Organization">
28 29 <selectKey order="AFTER" keyProperty="id" resultType="java.lang.Integer">SELECT LAST_INSERT_ID()</selectKey>
29 30 insert into organization
30   - (foreign_id,name,type,level,area_manage,province_id,city_id,area_id,address,description,publish_id,publish_name,yn,modified,created,shortCode,street_id
  31 + (foreign_id,name,type,level,area_manage,province_id,city_id,area_id,address,description,publish_id,publish_name,yn,modified,created,shortCode,street_id,bStatus
31 32 <if test="id != null and id >= 0">
32 33 ,id
33 34 </if>
34 35 )
35 36 values
36   - (#{foreignId},#{name},#{type},#{level},#{areaManage},#{provinceId},#{cityId},#{areaId},#{address},#{description},#{publishId},#{publishName},#{yn},#{modified},#{created},#{shortCode},#{streetId}
  37 + (#{foreignId},#{name},#{type},#{level},#{areaManage},#{provinceId},#{cityId},#{areaId},#{address},#{description},#{publishId},#{publishName},#{yn},#{modified},#{created},#{shortCode},#{streetId},#{bStatus}
37 38 <if test="id != null and id >= 0">
38 39 ,#{id}
39 40 </if>
... ... @@ -47,6 +48,9 @@
47 48 <if test="foreignId != null and foreignId != ''">
48 49 foreign_id = #{foreignId,jdbcType=VARCHAR},
49 50 </if>
  51 + <if test="bStatus !=null">
  52 + bStatus=#{bStatus,jdbcType=INTEGER},
  53 + </if>
50 54 <if test="name != null and name != ''">
51 55 name = #{name,jdbcType=VARCHAR},
52 56 </if>
... ... @@ -109,7 +113,7 @@
109 113  
110 114  
111 115 <select id="getOrganization" resultMap="OrganizationResultMap" parameterType="java.lang.Integer">
112   -select id,name,type,level,area_manage,province_id,city_id,area_id,address,description,publish_id,publish_name,yn,modified,created,shortCode,foreign_id,street_id,status
  116 +select id,name,type,level,area_manage,province_id,city_id,area_id,address,description,publish_id,publish_name,yn,modified,created,shortCode,foreign_id,street_id,status,bStatus
113 117 from organization where id = #{id,jdbcType=INTEGER}
114 118 </select>
115 119  
... ... @@ -213,7 +217,7 @@
213 217 <select id="queryOrganization" resultMap="OrganizationResultMap"
214 218 parameterType="com.lyms.platform.permission.model.OrganizationQuery">
215 219 select
216   - id,name,type,level,area_manage,province_id,city_id,area_id,address,description,publish_id,publish_name,yn,modified,created,shortCode,foreign_id,street_id,status
  220 + id,name,type,level,area_manage,province_id,city_id,area_id,address,description,publish_id,publish_name,yn,modified,created,shortCode,foreign_id,street_id,status,bStatus
217 221 from organization
218 222 <include refid="OrganizationCondition"/>
219 223 <include refid="orderAndLimit"/>
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java View file @ f77a964
... ... @@ -102,9 +102,7 @@
102 102 /**
103 103 * 修改最后一次产检时间
104 104 *
105   - * @param hospitalId
106 105 * @param id
107   - * @param type 1 初诊 2 复诊
108 106 */
109 107 private void setLashCTimes(String id) {
110 108  
111 109  
... ... @@ -132,7 +130,28 @@
132 130 patientsService.updatePatient(patients1);
133 131 }
134 132 }
  133 + //当非建档医院修改初诊信息时,需要同步给建档医院
  134 + private void syncMaster(String parentId){
135 135  
  136 + //当前非建档医院最新的状态
  137 + Patients patients = patientsService.findOnePatientById(parentId);
  138 +
  139 + if(StringUtils.isNotEmpty(patients.getSource())){
  140 + Patients masterPatients =patientsService.findOnePatientById(patients.getSource());
  141 +
  142 + masterPatients.setoRiskFactor(patients.getoRiskFactor());
  143 + masterPatients.setLastCTime(patients.getLastCTime());
  144 + masterPatients.setPostViewTimes(patients.getPostViewTimes());
  145 + masterPatients.setLastRhTime(patients.getLastRhTime());
  146 + masterPatients.setRiskFactorId(patients.getRiskFactorId());
  147 + masterPatients.setRiskLevelId(patients.getRiskLevelId());
  148 + masterPatients.setRiskScore(patients.getRiskScore());
  149 +
  150 + patientsService.updatePatient(masterPatients);
  151 + }
  152 + }
  153 +
  154 +
136 155 /**
137 156 * 增加一条产前检查
138 157 *
... ... @@ -161,6 +180,8 @@
161 180 updateLastRhTime(patients.getId(), hospitalId);
162 181 //修改最后一次检查时间
163 182 setLashCTimes(antExAddRequest.getParentId());
  183 + //修改数据
  184 + syncMaster(antExAddRequest.getParentId());
164 185  
165 186 //复诊,修改产检管理
166 187 antenatalExaminationService.updateAntExRecord(antExAddRequest.getId(), 2);
... ... @@ -200,6 +221,9 @@
200 221  
201 222 //修改本院最后一次定义高危
202 223 updateLastRhTime(patients.getId(), hospitalId);
  224 +
  225 + //修改数据
  226 + syncMaster(antExAddRequest.getParentId());
203 227 //复诊,修改产检管理
204 228 antenatalExaminationService.updateAntExRecord(model.getId(),2);
205 229 if (null != patients.getBuildType() && patients.getBuildType() == 3) {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java View file @ f77a964
... ... @@ -31,11 +31,9 @@
31 31 import javax.servlet.http.HttpServletResponse;
32 32 import java.io.IOException;
33 33 import java.io.OutputStream;
  34 +import java.text.DecimalFormat;
34 35 import java.util.*;
35   -import java.util.concurrent.Callable;
36   -import java.util.concurrent.ExecutorService;
37   -import java.util.concurrent.Executors;
38   -import java.util.concurrent.Future;
  36 +import java.util.concurrent.*;
39 37  
40 38 /**
41 39 *
... ... @@ -109,7 +107,7 @@
109 107 private AutoMatchFacade autoMatchFacade;
110 108  
111 109  
112   - private static ExecutorService pool = Executors.newFixedThreadPool(4);
  110 + private static ExecutorService pool = Executors.newFixedThreadPool(10);
113 111  
114 112  
115 113 public BaseResponse getBabyBase(String babyId) {
... ... @@ -530,7 +528,7 @@
530 528 return;
531 529 }
532 530  
533   - ExceptionUtils.catchException("儿童建档1---------->"+babyModel.getMphone()+";name="+babyModel.getName());
  531 + ExceptionUtils.catchException("儿童建档1---------->" + babyModel.getMphone() + ";name=" + babyModel.getName());
534 532  
535 533 SmsTemplateQuery query = new SmsTemplateQuery();
536 534 query.setYn(YnEnums.YES.getId());
537 535  
538 536  
539 537  
540 538  
541 539  
542 540  
... ... @@ -1956,41 +1954,108 @@
1956 1954 List<Map<String, Object>> datas = new ArrayList<>();
1957 1955 BabyModelQuery babyQuery = new BabyModelQuery();
1958 1956 babyQuery.setHospitalId(String.valueOf(hospitalId));
1959   - List<BabyModel> models = getBabayListByCondition(request, false, babyQuery);
1960   - if (CollectionUtils.isNotEmpty(models)) {
1961   - for (BabyModel model : models) {
1962   - Map<String, Object> data = new HashMap<>();
1963   - if (model.getLastHighRisk() == null || model.getLastHighRisk() == 0) {
1964   - data.put("highRisk", "健康");
1965   - } else {
1966   - data.put("highRisk", "高危");
  1957 + List<BabyModel> ms = getBabayListByCondition(request, false, babyQuery);
  1958 +
  1959 + if (CollectionUtils.isNotEmpty(ms)) {
  1960 +
  1961 + int batchSize = 100;
  1962 + int end = 0;
  1963 + List<Future> futures = new ArrayList<>();
  1964 + for (int i = 0; i < ms.size(); i += batchSize) {
  1965 + end = (end + batchSize);
  1966 + if (end > ms.size()) {
  1967 + end = ms.size();
1967 1968 }
1968   - data.put("sex", StringUtils.emptyDeal(SexEnum.getTextById(model.getSex())));
1969   - data.put("babyName", StringUtils.emptyDeal(model.getName()));
1970   - data.put("birthday", StringUtils.emptyDeal(DateUtil.getyyyy_MM_dd(model.getBirth())));
1971   - data.put("mommyName", StringUtils.emptyDeal(model.getMname()));
1972   - data.put("mommnyPhone", StringUtils.emptyDeal(model.getMphone()));
1973   - data.put("serviceType", StringUtils.emptyDeal(model.getServiceType() == null ? "" : ServiceTypeEnums.getTitleById(model.getServiceType())));
1974   - data.put("serviceStatus", StringUtils.emptyDeal(model.getServiceStatus() == null ? "" : ServiceStatusEnums.getNameById(model.getServiceStatus())));
1975   - data.put("nextDate", StringUtils.emptyDeal(DateUtil.getyyyy_MM_dd(model.getNextDate())));
1976   - data.put("monthAge", StringUtils.emptyDeal(DateUtil.getBabyMonthAge(model.getBirth(), new Date())));
1977 1969  
1978   - String diagnose = "";
1979   - if (StringUtils.isNotEmpty(model.getPid())) {
1980   - List diagList = babyCheckFacade.getBabyLastDiagnose(model.getPid());
1981   - if (CollectionUtils.isNotEmpty(diagList)) {
1982   - for (Object obj : diagList) {
1983   - BasicConfig basicConfig = basicConfigService.getOneBasicConfigById((String) obj);
1984   - if (basicConfig != null) {
1985   - diagnose += basicConfig.getName() + " ";
  1970 + final List<BabyModel> models = ms.subList(i, end);
  1971 + Callable c = new Callable()
  1972 + {
  1973 + @Override
  1974 + public List<Map<String, Object>> call() throws Exception {
  1975 + List<Map<String, Object>> results = new ArrayList<>();
  1976 + if (CollectionUtils.isNotEmpty(models)) {
  1977 + for (BabyModel model : models) {
  1978 + Map<String, Object> data = new HashMap<>();
  1979 + if (model.getLastHighRisk() == null || model.getLastHighRisk() == 0) {
  1980 + data.put("highRisk", "健康");
  1981 + } else {
  1982 + data.put("highRisk", "高危");
  1983 + }
  1984 + data.put("sex", StringUtils.emptyDeal(SexEnum.getTextById(model.getSex())));
  1985 + data.put("babyName", StringUtils.emptyDeal(model.getName()));
  1986 + data.put("birthday", StringUtils.emptyDeal(DateUtil.getyyyy_MM_dd(model.getBirth())));
  1987 + data.put("mommyName", StringUtils.emptyDeal(model.getMname()));
  1988 + data.put("mommnyPhone", StringUtils.emptyDeal(model.getMphone()));
  1989 + data.put("serviceType", StringUtils.emptyDeal(model.getServiceType() == null ? "" : ServiceTypeEnums.getTitleById(model.getServiceType())));
  1990 + data.put("serviceStatus", StringUtils.emptyDeal(model.getServiceStatus() == null ? "" : ServiceStatusEnums.getNameById(model.getServiceStatus())));
  1991 + data.put("nextDate", StringUtils.emptyDeal(DateUtil.getyyyy_MM_dd(model.getNextDate())));
  1992 + data.put("monthAge", StringUtils.emptyDeal(DateUtil.getBabyMonthAge(model.getBirth(), new Date())));
  1993 +
  1994 + String diagnose = "";
  1995 + if (StringUtils.isNotEmpty(model.getPid())) {
  1996 + List diagList = babyCheckFacade.getBabyLastDiagnose(model.getPid());
  1997 + if (CollectionUtils.isNotEmpty(diagList)) {
  1998 + for (Object obj : diagList) {
  1999 + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById((String) obj);
  2000 + if (basicConfig != null) {
  2001 + diagnose += basicConfig.getName() + " ";
  2002 + }
  2003 + }
  2004 + }
  2005 + }
  2006 + data.put("diagnose", diagnose);
  2007 + results.add(data);
1986 2008 }
1987 2009 }
  2010 + return results;
1988 2011 }
  2012 + };
  2013 +
  2014 + Future f = pool.submit(c);
  2015 + futures.add(f);
  2016 + }
  2017 + for (Future f : futures) {
  2018 + try {
  2019 + datas.addAll((List) f.get(30, TimeUnit.SECONDS));
  2020 + } catch (Exception e) {
  2021 + ExceptionUtils.catchException(e, "baby list export.");
1989 2022 }
1990   - data.put("diagnose", diagnose);
1991   - datas.add(data);
1992 2023 }
1993 2024 }
  2025 +// if (CollectionUtils.isNotEmpty(models)) {
  2026 +// for (BabyModel model : models) {
  2027 +// Map<String, Object> data = new HashMap<>();
  2028 +// if (model.getLastHighRisk() == null || model.getLastHighRisk() == 0) {
  2029 +// data.put("highRisk", "健康");
  2030 +// } else {
  2031 +// data.put("highRisk", "高危");
  2032 +// }
  2033 +// data.put("sex", StringUtils.emptyDeal(SexEnum.getTextById(model.getSex())));
  2034 +// data.put("babyName", StringUtils.emptyDeal(model.getName()));
  2035 +// data.put("birthday", StringUtils.emptyDeal(DateUtil.getyyyy_MM_dd(model.getBirth())));
  2036 +// data.put("mommyName", StringUtils.emptyDeal(model.getMname()));
  2037 +// data.put("mommnyPhone", StringUtils.emptyDeal(model.getMphone()));
  2038 +// data.put("serviceType", StringUtils.emptyDeal(model.getServiceType() == null ? "" : ServiceTypeEnums.getTitleById(model.getServiceType())));
  2039 +// data.put("serviceStatus", StringUtils.emptyDeal(model.getServiceStatus() == null ? "" : ServiceStatusEnums.getNameById(model.getServiceStatus())));
  2040 +// data.put("nextDate", StringUtils.emptyDeal(DateUtil.getyyyy_MM_dd(model.getNextDate())));
  2041 +// data.put("monthAge", StringUtils.emptyDeal(DateUtil.getBabyMonthAge(model.getBirth(), new Date())));
  2042 +//
  2043 +// String diagnose = "";
  2044 +// if (StringUtils.isNotEmpty(model.getPid())) {
  2045 +// List diagList = babyCheckFacade.getBabyLastDiagnose(model.getPid());
  2046 +// if (CollectionUtils.isNotEmpty(diagList)) {
  2047 +// for (Object obj : diagList) {
  2048 +// BasicConfig basicConfig = basicConfigService.getOneBasicConfigById((String) obj);
  2049 +// if (basicConfig != null) {
  2050 +// diagnose += basicConfig.getName() + " ";
  2051 +// }
  2052 +// }
  2053 +// }
  2054 +// }
  2055 +// data.put("diagnose", diagnose);
  2056 +// datas.add(data);
  2057 +// }
  2058 +// }
1994 2059 OutputStream out = httpServletResponse.getOutputStream();
1995 2060 Map<String, String> cnames = new LinkedHashMap<>();
1996 2061 cnames.put("sex", "性别");
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java View file @ f77a964
... ... @@ -495,6 +495,10 @@
495 495 patient.setId(id);
496 496 //加入产筛
497 497 patientsService.validata(patient);
  498 + //如果当前是建档医院,那么需要修改其他非建档医院的数据
  499 + if(autoMatchFacade.checkBStatus(userId)){
  500 + patientsService.updateBaseData(patient);
  501 + }
498 502  
499 503  
500 504 PatientsQuery pQuery = new PatientsQuery();
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java View file @ f77a964
... ... @@ -129,6 +129,7 @@
129 129 if (ErrorCodeConstants.RUN_MODE.equals(runType)) {
130 130 String parentId =antenatalExaminationFacade.handHideBuild(deliverAddRequest.getPid(), deliverAddRequest.getParentId(), userId);
131 131 if (StringUtils.isEmpty(parentId)) {
  132 + logger.warn("get handHideBuild parentId is null.");
132 133 }
133 134 maternalDeliverModel.setParentId(parentId);
134 135 }