Commit ec9ccaa0756fbfcfae83513d00a744184f596067

Authored by yangfei
1 parent 845d80e428

开通VIP增值服务

Showing 4 changed files with 26 additions and 13 deletions

platform-biz-service/src/main/resources/mainOrm/master/PatientMarkHospital.xml View file @ ec9ccaa
... ... @@ -231,6 +231,9 @@
231 231 <if test="hospitDate != null">
232 232 and hospit_date = #{hospitDate,jdbcType=TIMESTAMP}
233 233 </if>
  234 + <if test="hospitType != null">
  235 + and hospit_type = #{hospitType,jdbcType=INTEGER}
  236 + </if>
234 237 </where>
235 238 </sql>
236 239  
... ... @@ -238,7 +241,7 @@
238 241 <select id="queryPatientMarkHospital" resultMap="PatientMarkHospitalResultMap"
239 242 parameterType="com.lyms.platform.permission.model.PatientMarkHospitalQuery">
240 243 select
241   - id,patient_id,pid,back_status,back_result,back_doctor,back_date,back_make_date,back_remark,back_failure,in_hospit_status,in_hospit_result,in_hospit_doctor,in_hospit_date,in_hospit_make_date,in_hospit_remark,in_hospit_failure,make_in_hospit_date,make_date,make_doctor,make_remark,hospital_id,hospit_status,hospit_date
  244 + id,patient_id,pid,back_status,back_result,back_doctor,back_date,back_make_date,back_remark,back_failure,in_hospit_status,in_hospit_result,in_hospit_doctor,in_hospit_date,in_hospit_make_date,in_hospit_remark,in_hospit_failure,make_in_hospit_date,make_date,make_doctor,make_remark,hospital_id,hospit_status,hospit_date,hospit_type
242 245 from patient_mark_hospital
243 246 <include refid="PatientMarkHospitalCondition"/>
244 247 <include refid="orderAndLimit"/>
platform-operate-api/src/main/java/com/lyms/hospitalapi/llfy/LlfyHisService.java View file @ ec9ccaa
1 1 package com.lyms.hospitalapi.llfy;
2 2  
3   -import com.lyms.hospitalapi.pojo.PregPatientinfo;
  3 +import com.lyms.hospitalapi.pojo.LcfyPatient;
  4 +import com.lyms.platform.pojo.Patients;
4 5 import org.apache.commons.dbutils.QueryRunner;
5 6 import org.apache.commons.dbutils.handlers.BeanListHandler;
6   -import org.apache.commons.lang.StringUtils;
7 7 import org.springframework.stereotype.Service;
8 8  
9 9 import java.sql.Connection;
10 10  
11 11  
12 12  
... ... @@ -17,15 +17,14 @@
17 17 */
18 18 @Service("llfyHisService")
19 19 public class LlfyHisService {
20   - public Map<String,Object> getPatientInfo(String cardNo) {
21   - if (StringUtils.isNotBlank(cardNo)) {
22   - Connection conn = com.lyms.hospitalapi.fnfy.ConnTools.makeHisConnection();
  20 + public Map<String,Object> getPatientInfo(Patients ps,String startDate,String endDate) {
  21 + Connection conn = com.lyms.hospitalapi.llfy.ConnTools.makeHisConnection();
23 22 QueryRunner queryRunner = new QueryRunner();
24 23 try {
25   - List<PregPatientinfo> list = queryRunner.query(conn, "select top 1 brid as P_ID,jzkh as P_CARDNO,hzxm as P_NAME, hzxb as P_SEX, hzcsrq as P_BIRTHDAY, sfzhm as P_IDNUM, hz_lxdh as P_MOBILEPHONE from fvw_住院病人档案 where jzkh= '" + cardNo + "'", new BeanListHandler<PregPatientinfo>(PregPatientinfo.class));
  24 + List<LcfyPatient> list = queryRunner.query(conn, "select 入院日期 as inHospDate,入院诊断 as inHospDiagn from fvw_住院病人档案 where (姓名= '"+ps.getUsername()+"' and 证件号 ='"+ps.getCardNo()+"') or (姓名='"+ps.getUsername()+"' and 手机号 ='"+ps.getPhone()+"') or (姓名='"+ps.getUsername()+"' and 就诊卡='"+ps.getVcCardNo()+"') and 入院日期 is not null and 入院日期 between '"+startDate+"' and '"+endDate+"'", new BeanListHandler<LcfyPatient>(LcfyPatient.class));
26 25 } catch (Exception e) {
  26 +
27 27 }
28   - }
29 28 return null;
30 29 }
31 30 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientServiceController.java View file @ ec9ccaa
... ... @@ -67,11 +67,12 @@
67 67 @RequestMapping(value = "/patSer", method = RequestMethod.POST)
68 68 public BaseResponse addOrUpdatePatientService(PatientService ps, HttpServletRequest request) {
69 69 LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
70   - BaseResponse baseResponse = validatePatient(ps);
71   - if(baseResponse.getErrorcode()!=ErrorCodeConstants.SUCCESS){
72   - return baseResponse;
73   - }
  70 +
74 71 if (StringUtils.isEmpty(ps.getId())) {
  72 + BaseResponse baseResponse = validatePatient(ps);
  73 + if(baseResponse.getErrorcode()!=ErrorCodeConstants.SUCCESS){
  74 + return baseResponse;
  75 + }
75 76 return patientServiceFacade.addPatientService(ps, loginState.getId());
76 77 } else {
77 78 return patientServiceFacade.updatePatientService(ps, loginState.getId());
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientMarkHospServiceFacade.java View file @ ec9ccaa
1 1 package com.lyms.platform.operate.web.facade;
2 2  
  3 +import com.lyms.hospitalapi.llfy.LlfyHisService;
3 4 import com.lyms.platform.biz.service.PatientsService;
4 5 import com.lyms.platform.common.constants.ErrorCodeConstants;
5 6 import com.lyms.platform.common.enums.MakeHospitalEnums;
... ... @@ -22,6 +23,7 @@
22 23 import org.springframework.beans.factory.annotation.Autowired;
23 24 import org.springframework.stereotype.Component;
24 25  
  26 +import javax.annotation.Resource;
25 27 import java.util.*;
26 28  
27 29 /**
... ... @@ -42,6 +44,8 @@
42 44 private UsersService usersService;
43 45 @Autowired
44 46 private PatientsService patientsService;
  47 + @Resource(name = "llfyHisService")
  48 + private LlfyHisService llfyHisService;
45 49  
46 50 /**
47 51 * 初始化接口
... ... @@ -313,6 +317,9 @@
313 317  
314 318 List<PatientMarkHospital> patientMarkHospitals = patientMarkHospitalService.queryPatientMarkHospital(patientMarkHospQuery);
315 319 for (PatientMarkHospital ps : patientMarkHospitals) {
  320 + if(ps.getHospitType() == 1){//分娩住院跳过
  321 + continue;
  322 + }
316 323 synUpdateHisData(ps);
317 324 }
318 325 if(patientMarkHospQuery.getCount()>page*100){
... ... @@ -325,7 +332,10 @@
325 332 * @param ps
326 333 */
327 334 public void synUpdateHisData(PatientMarkHospital ps){
328   -
  335 + Patients patients = patientsService.findOnePatientById(ps.getPatientId());
  336 + if (null != patients) {
  337 + llfyHisService.getPatientInfo(patients,DateUtil.getyyyy_MM_dd(ps.getMakeDate()),DateUtil.getyyyy_MM_dd(new Date()));
  338 + }
329 339 }
330 340  
331 341 public static Map<String, Integer> initHospitType() {