lighter 2 vuotta sitten
vanhempi
commit
9e2be8fdc4

+ 8 - 1
src/main/java/thyyxxk/wxservice_server/dao/InpatientDao.java

@@ -15,7 +15,7 @@ import java.util.List;
 @Mapper
 public interface InpatientDao {
     @Select("select rtrim(a.inpatient_no) inpatientNo, " +
-            "rtrim(a.name) as name, " +
+            "rtrim(a.name) as name,rtrim(a.bed_no) as bedNo, " +
             "a.admiss_times, " +
             "convert(varchar(10), admiss_date, 21) admissDate, " +
             "rtrim(d.name) deptName, " +
@@ -37,6 +37,13 @@ public interface InpatientDao {
             "(select social_no from mz_patient_mi where patient_id=#{patientId})")
     String selectInpatientNoBySocialNo(@Param("patientId") String patientId);
 
+    @Select("select social_no from a_patient_mi where inpatient_no=#{inpatientNo}")
+    String selectSocialNoByInpatientNo(@Param("inpatientNo") String inpatientNo);
+
+    @Select("select top 1 rtrim(patient_id) from mz_patient_mi where " +
+            "social_no=#{socialNo} order by lv_date desc ")
+    String selectPatientIdBySocialNo(@Param("socialNo") String socialNo);
+
     @Select("select rtrim(inpatient_no) from a_patient_mi where mz_no=#{patientId}")
     String selectInpatientNoByPatientId(@Param("patientId") String patientId);
 

+ 3 - 0
src/main/java/thyyxxk/wxservice_server/entity/inpatient/InpatientInfo.java

@@ -8,9 +8,12 @@ import thyyxxk.wxservice_server.utils.StringUtil;
  */
 @Data
 public class InpatientInfo {
+    private String patientId;
+    private String socialNo;
     private String inpatientNo;
     private Integer admissTimes;
     private String admissDate;
+    private String bedNo;
     private String name;
     private String deptName;
     private String doctorName;

+ 4 - 4
src/main/java/thyyxxk/wxservice_server/service/AppointmentService.java

@@ -111,7 +111,7 @@ public class AppointmentService {
             for (Map<String, Object> child : tempMzDepartments.getData()) {
                 MzDept childDepartment = new MzDept(child.get("code").toString(), child.get("name").toString());
                 List<Map<String, Object>> grandChildrenMap = CastUtil.cast(child.get("children"));
-                if (null != grandChildrenMap && grandChildrenMap.size() > 0) {
+                if (null != grandChildrenMap && !grandChildrenMap.isEmpty()) {
                     List<MzDept> grandChildren = new ArrayList<>();
                     for (Map<String, Object> grandChild : grandChildrenMap) {
                         grandChildren.add(new MzDept(grandChild.get("code").toString(), grandChild.get("name").toString()));
@@ -188,7 +188,7 @@ public class AppointmentService {
         if (data.getResultCode() == -1) {
             return ResultVoUtil.fail(ExceptionEnum.SLIGHTLY_ERROR, data.getResultMessage());
         }
-        if (data.getData().size() == 0) {
+        if (data.getData().isEmpty()) {
             return ResultVoUtil.fail(ExceptionEnum.SLIGHTLY_ERROR);
         }
         if (param.getNightClinic()) {
@@ -238,7 +238,7 @@ public class AppointmentService {
             }
         }
 
-        if (data.getData().size() == 0) {
+        if (data.getData().isEmpty()) {
             return ResultVoUtil.fail(ExceptionEnum.SLIGHTLY_ERROR);
         }
         return ResultVoUtil.success(data.getData());
@@ -337,7 +337,7 @@ public class AppointmentService {
             return ResultVoUtil.fail(ExceptionEnum.INTERNAL_SERVER_ERROR, response.getString("message"));
         }
         JSONArray data = response.getJSONArray("data");
-        if (null == data || data.size() == 0) {
+        if (null == data || data.isEmpty()) {
             return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST);
         }
         List<MzyReqrec> list = new ArrayList<>();

+ 1 - 1
src/main/java/thyyxxk/wxservice_server/service/CovidVaccinateAppointmentService.java

@@ -36,7 +36,7 @@ public class CovidVaccinateAppointmentService {
 
     public ResultVo<List<ZdCovidVaccinate>> selectVaccinates() {
         List<ZdCovidVaccinate> list = dao.selectVaccinates();
-        if (null != list && list.size() > 0) {
+        if (null != list && !list.isEmpty()) {
             String[] nextSevenDate = DateUtil.getDatesInOneWeek();
             list.forEach(item -> {
                 for (String date : nextSevenDate) {

+ 1 - 1
src/main/java/thyyxxk/wxservice_server/service/ElectronicHealthCardService.java

@@ -262,7 +262,7 @@ public class ElectronicHealthCardService {
                 tempList.clear();
             }
         }
-        if (tempList.size() > 0) {
+        if (!tempList.isEmpty()) {
             executeRegisterBatchHealthCard(tempList);
             tempList.clear();
         }

+ 2 - 2
src/main/java/thyyxxk/wxservice_server/service/HomePageService.java

@@ -29,7 +29,7 @@ public class HomePageService {
     }
 
     public ResultVo<List<List<DoctorInfo>>> selectHomePageDoctors() {
-        if (HOME_PAGE_DOCTORS.size() > 0) {
+        if (!HOME_PAGE_DOCTORS.isEmpty()) {
             return ResultVoUtil.success(HOME_PAGE_DOCTORS);
         }
         List<DoctorInfo> originList = dao.selectHomePageDoctors();
@@ -41,7 +41,7 @@ public class HomePageService {
                 tempList = new ArrayList<>();
             }
         }
-        if (tempList.size() > 0) {
+        if (!tempList.isEmpty()) {
             HOME_PAGE_DOCTORS.add(tempList);
         }
         return ResultVoUtil.success(HOME_PAGE_DOCTORS);

+ 8 - 0
src/main/java/thyyxxk/wxservice_server/service/InpatientService.java

@@ -46,6 +46,14 @@ public class InpatientService {
         if (null == info) {
             return ResultVoUtil.fail(ExceptionEnum.NULL_POINTER, "没有找到此住院号的在院信息。");
         }
+        String socialNo = dao.selectSocialNoByInpatientNo(inpatientNo);
+        if (StringUtil.notBlank(socialNo)) {
+            info.setSocialNo(socialNo);
+            String patientId = dao.selectPatientIdBySocialNo(socialNo);
+            if (StringUtil.notBlank(patientId)) {
+                info.setPatientId(patientId);
+            }
+        }
         return ResultVoUtil.success(info);
     }
 

+ 3 - 3
src/main/java/thyyxxk/wxservice_server/service/InspectionsService.java

@@ -177,13 +177,13 @@ public class InspectionsService {
             ReportItem reportItem = new ReportItem();
             soapInvokeService.reflect(reportItem, reportItemElement);
             List<Element> bacteriaResultElements = reportItemElement.elements("BacteriaResult");
-            if (bacteriaResultElements.size() > 0) {
+            if (!bacteriaResultElements.isEmpty()) {
                 List<BacteriaResult> bacteriaResults = new ArrayList<>();
                 bacteriaResultElements.forEach(bacterialResultElement -> {
                     BacteriaResult bacteriaResult = new BacteriaResult();
                     soapInvokeService.reflect(bacteriaResult, bacterialResultElement);
                     List<Element> antibioticResultElements = bacterialResultElement.elements("AntibioticResult");
-                    if (antibioticResultElements.size() > 0) {
+                    if (!antibioticResultElements.isEmpty()) {
                         List<AntibioticResult> antibioticResults = new ArrayList<>();
                         antibioticResultElements.forEach(antibioticResultElement -> {
                             AntibioticResult antibioticResult = new AntibioticResult();
@@ -198,7 +198,7 @@ public class InspectionsService {
                 reportItem.setBacteriaResults(bacteriaResults);
             }
             if (StringUtil.notBlank(reportItem.getITM_VALUE()) || StringUtil.notBlank(reportItem.getITM_STR_VALUE())
-                    || reportItem.getBacteriaResults().size() > 0) {
+                    || !reportItem.getBacteriaResults().isEmpty()) {
                 reportItems.add(reportItem);
             }
         });

+ 4 - 1
src/main/java/thyyxxk/wxservice_server/service/SavePayResultService.java

@@ -243,6 +243,10 @@ public class SavePayResultService {
         getZyFeeParam.setStart(date);
         getZyFeeParam.setEnd(date);
         yjjDao.selectZyFees(getZyFeeParam);
+        dao.updateSuccessHisStatus(order.getTradeNo());
+        if (StringUtil.isBlank(order.getPatientId())) {
+            return ResultVoUtil.success("保存住院预交金信息成功。");
+        }
         healthCardService.reportHisData(order.getPatientId(), "0101056", null, CardCostTypes.SELF_PAY);
         log.info("缴纳住院预交金成功:{}", JSON.toJSONStringWithDateFormat(order, "yyyy-MM-dd HH:mm:ss"));
         String msgContent = "{\"touser\":\"\",\"data\":" +
@@ -257,7 +261,6 @@ public class SavePayResultService {
         pojo.setCardNo(yjjDao.selectCardNoByPatientId(order.getPatientId()));
         pojo.setMsgContext(JSONObject.parseObject(msgContent));
         pushWxMessageService.pushMessage2(pojo);
-        dao.updateSuccessHisStatus(order.getTradeNo());
         return ResultVoUtil.success("保存住院预交金信息成功。");
     }
 

+ 2 - 2
src/main/java/thyyxxk/wxservice_server/utils/ListUtil.java

@@ -4,10 +4,10 @@ import java.util.List;
 
 public class ListUtil {
     public static boolean isEmpty(List<?> list) {
-        return null == list || list.size() == 0;
+        return null == list || list.isEmpty();
     }
 
     public static boolean notEmpty(List<?> list) {
-        return null != list && list.size() > 0;
+        return null != list && !list.isEmpty();
     }
 }

+ 1 - 1
src/main/java/thyyxxk/wxservice_server/utils/PhysicalCheckPDFUtil.java

@@ -65,7 +65,7 @@ public class PhysicalCheckPDFUtil {
 
             JSONObject examResults = tjResult.getJSONObject("examResult");
             JSONArray checkItems = tjResult.getJSONArray("checkItems");
-            if (examResults.size() > 0 && checkItems.size() > 0) {
+            if (!examResults.isEmpty() && !checkItems.isEmpty()) {
                 addExamResult(baseFont, document, examResults, checkItems);
             }