Procházet zdrojové kódy

Merge branch 'master' of http://wcollector.idatabank.com:5230/dbs289/LifeCenter.git

huiwon.seo před 4 roky
rodič
revize
12e487d872

+ 11 - 1
src/main/java/com/lemon/lifecenter/controller/CenterController.java

@@ -48,9 +48,14 @@ public class CenterController extends LifeCenterController {
     
     @RequestMapping("/new")
     public ModelAndView centerNew() {
+        List<LocationDTO> jurisdiction = centerService.selectLocation();
         List<LocationDTO> list = centerService.selectLocation();
+        List<LocationDTO> cooperativeList = centerService.selectCooperativeHospialList();
         
         ModelAndView mv = setMV("center/new");
+        mv.addObject("jurisdiction", jurisdiction);
+        mv.addObject("cooperativeList", cooperativeList);
+        list.remove(list.size()-1); 
         mv.addObject("locationList", list);
         return mv;
     }
@@ -135,7 +140,6 @@ public class CenterController extends LifeCenterController {
                     memberDTO.setId( staffId );
                     memberDTO.setName( staffName );
                     memberDTO.setPhoneNumber(staffPhoneNumber);
-                    memberDTO.setPassword( "" );
                     
                     memberService.updateMember( memberDTO );
                 }
@@ -152,11 +156,14 @@ public class CenterController extends LifeCenterController {
     public ModelAndView centerEdit(
             @RequestParam(value="centerCode", required=true) int centerCode) {
         
+        List<LocationDTO> jurisdiction = centerService.selectLocation();
         List<LocationDTO> list = centerService.selectLocation();
+        List<LocationDTO> cooperativeList = centerService.selectCooperativeHospialList();
         
         CenterInfoDTO dto = new CenterInfoDTO();
         dto.setCenterCode(centerCode);
         dto = centerService.selectCenterInfo(dto);
+        logger.error("jurisdiction -- > " + dto.getJurisdiction());
         
         String address = dto.getCenterAddress();
         String mainAddr = "";
@@ -170,7 +177,10 @@ public class CenterController extends LifeCenterController {
         }
         
         ModelAndView mv = setMV("center/edit");
+        list.remove(list.size()-1);
         mv.addObject("locationList", list);
+        mv.addObject("jurisdiction", jurisdiction);
+        mv.addObject("cooperativeList", cooperativeList);
         mv.addObject("centerInfo", dto);
         mv.addObject("mainAddr", mainAddr);
         mv.addObject("detailAddr", detailAddr);

+ 4 - 1
src/main/java/com/lemon/lifecenter/controller/PatientController.java

@@ -12,6 +12,8 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.ModelAttribute;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
@@ -129,6 +131,7 @@ public class PatientController extends LifeCenterController {
     }
     
     @RequestMapping("/new/insert")
+    @Transactional(propagation=Propagation.REQUIRED)
     public String patientNewInsert(
             @ModelAttribute("dto") final PatientDTO dto,
             HttpServletRequest request,HttpServletResponse response ) throws Exception {
@@ -243,6 +246,7 @@ public class PatientController extends LifeCenterController {
     }
     
     @RequestMapping("/edit/update")
+    @Transactional(propagation=Propagation.REQUIRED)
     public String patientEditUpdate(
             @ModelAttribute("dto") final PatientDTO dto,
             HttpServletRequest request,HttpServletResponse response ) throws Exception {
@@ -316,7 +320,6 @@ public class PatientController extends LifeCenterController {
         String message = "";
         String token = "";
         for(String key : object.keySet()) {
-            logger.error("key -- > " + key);
             if (key.equals("errorCode")) {
                 message = object.getString("message");
             } else if (key.equals("token")){

+ 29 - 1
src/main/java/com/lemon/lifecenter/dto/CenterInfoDTO.java

@@ -5,6 +5,10 @@ public class CenterInfoDTO {
     private int centerCode = 0;
     private String centerName = "";
     private String locationCode = "";
+    private String cooperativeCode = "";
+    private String cooperativeName = "";
+    private String jurisdictionName = "";
+    private String jurisdiction = "";
     private String centerNumber = "";
     private int totalPatient = 0;
     private int totalCapacity = 0;
@@ -48,6 +52,30 @@ public class CenterInfoDTO {
     public void setLocationCode(String locationCode) {
         this.locationCode = locationCode;
     }
+    public String getCooperativeCode() {
+        return cooperativeCode;
+    }
+    public void setCooperativeCode(String cooperativeCode) {
+        this.cooperativeCode = cooperativeCode;
+    }
+    public String getCooperativeName() {
+        return cooperativeName;
+    }
+    public void setCooperativeName(String cooperativeName) {
+        this.cooperativeName = cooperativeName;
+    }
+    public String getJurisdictionName() {
+        return jurisdictionName;
+    }
+    public void setJurisdictionName(String jurisdictionName) {
+        this.jurisdictionName = jurisdictionName;
+    }
+    public String getJurisdiction() {
+        return jurisdiction;
+    }
+    public void setJurisdiction(String jurisdiction) {
+        this.jurisdiction = jurisdiction;
+    }
     public String getCenterNumber() {
         return centerNumber;
     }
@@ -138,5 +166,5 @@ public class CenterInfoDTO {
     public void setLimitMax(int limitMax) {
         this.limitMax = limitMax;
     }
-
+    
 }

+ 10 - 4
src/main/java/com/lemon/lifecenter/dto/PatientPHRHistoryDTO.java

@@ -72,16 +72,22 @@ public class PatientPHRHistoryDTO {
 	public boolean getIsWarning() {
 		try {
 			if (this.phrType.equals("temperature")) {
-				return this.phrValue > 37.5;
+				return this.phrValue >= 37.5;
 			}
 			else if (this.phrType.equals("bloodPressure")) {
-				boolean highBP = this.phrValue > 140 || this.phrValue2 > 90;
-				boolean lowBP = this.phrValue < 80 || this.phrValue2 < 60;
+				boolean highBP = this.phrValue >= 149 || this.phrValue2 >= 99;
+				boolean lowBP = this.phrValue <= 90 || this.phrValue2 <= 60;
 			
 				return highBP || lowBP;
 			}
 			else if (this.phrType.equals("oxygenSaturation")) {
-				return this.phrValue < 95;
+				return this.phrValue <= 94;
+			}
+			else if (this.phrType.equals("pulseRate")) {
+				return this.phrValue <= 55 || this.phrValue >= 110;
+			}
+			else if (this.phrType.equals("bloodSugar")) {
+				return this.phrValue <= 70;
 			}
 		}
 		catch(Exception e) {

+ 4 - 4
src/main/java/com/lemon/lifecenter/dto/PatientPHRLatestDTO.java

@@ -188,20 +188,20 @@ public class PatientPHRLatestDTO {
 	public boolean getIsTemperatureWarning() {
 		if (this.temperature == null) return false;
 		
-		return this.temperature > 37.5;
+		return this.temperature >= 37.5;
 	}
 	public boolean getIsBloodPressureWarning() {
 		if (this.systolicBloodPressure == null || this.diastolicBloodPressure == null) return false;
 		
-		boolean highBP = this.systolicBloodPressure > 140 || this.diastolicBloodPressure > 90;
-		boolean lowBP = this.systolicBloodPressure < 80 || this.diastolicBloodPressure < 60;
+		boolean highBP = this.systolicBloodPressure >= 149 || this.diastolicBloodPressure >= 99;
+		boolean lowBP = this.systolicBloodPressure <= 90 || this.diastolicBloodPressure <= 60;
 		
 		return highBP || lowBP;
 	}
 	public boolean getIsOxygenSaturationeWarning() {
 		if (this.oxygenSaturation == null) return false;
 		
-		return this.oxygenSaturation < 95;
+		return this.oxygenSaturation <= 94;
 	}
 	public boolean getHasTodaySymptom() {
 		boolean ret = false;

+ 1 - 0
src/main/java/com/lemon/lifecenter/mapper/CenterMapper.java

@@ -19,4 +19,5 @@ public interface CenterMapper {
     public List<CenterInfoDTO> selectCenterList(CenterInfoDTO dto);
     public Integer updateCenterInfo(CenterInfoDTO dto);
     public CenterInfoDTO selectCenterInfoOne( CenterInfoDTO dto );
+    public List<LocationDTO> selectCooperativeHospialList();
 }

+ 4 - 0
src/main/java/com/lemon/lifecenter/service/CenterService.java

@@ -43,4 +43,8 @@ public class CenterService {
     public CenterInfoDTO selectCenterInfoOne( CenterInfoDTO dto ) {
         return mapper.selectCenterInfoOne(dto);
     }
+    
+    public List<LocationDTO> selectCooperativeHospialList() {
+        return mapper.selectCooperativeHospialList();
+    }
 }

+ 43 - 21
src/main/resources/mybatis/mapper/center/center.xml

@@ -20,8 +20,10 @@
         </selectKey>
         <![CDATA[
             INSERT INTO CENTER_INFO
-                        (CENTER_NAME,   LOCATION_CODE,   CENTER_ADDRESS, CENTER_NUMBER,   TOTAL_CAPACITY,   TOTAL_STAFF,   CREATE_DATE)
-                 VALUES (#{centerName}, #{locationCode}, #{centerAddress},     #{centerNumber}, #{totalCapacity}, #{totalStaff}, NOW())
+                        (CENTER_NAME,     LOCATION_CODE,    COOPERATIVE_CODE,     JURISDICTION,    CENTER_ADDRESS,
+                         CENTER_NUMBER,   TOTAL_CAPACITY,   TOTAL_STAFF,          CREATE_DATE)
+                 VALUES (#{centerName},   #{locationCode},  #{cooperativeCode},  #{jurisdiction}, #{centerAddress},
+                         #{centerNumber}, #{totalCapacity}, #{totalStaff}, NOW())
         ]]>
     </insert>
     
@@ -37,21 +39,29 @@
     
     <select id="selectCenterInfo" parameterType="CenterInfoDTO" resultType="CenterInfoDTO">
         <![CDATA[
-            SELECT CI.CENTER_CODE                                AS centerCode,
-                   CI.CENTER_NAME                                AS centerName,
-                   CI.LOCATION_CODE                              AS locationCode,
+            SELECT CI.CENTER_CODE                                     AS centerCode,
+                   CI.CENTER_NAME                                     AS centerName,
+                   CI.LOCATION_CODE                                   AS locationCode,
                    (SELECT LOCATION_NAME
                       FROM LOCATION_INFO LI
-                     WHERE LI.LOCATION_CODE = CI.LOCATION_CODE)  AS locationName,
-                   CI.CENTER_ADDRESS                             AS centerAddress,
-                   CI.CENTER_NUMBER                              AS centerNumber,
-                   CI.TOTAL_CAPACITY                             AS totalCapacity,
-                   CI.TOTAL_STAFF                                AS totalStaff,
-                   DATE_FORMAT(CI.CREATE_DATE, '%Y-%m-%d %H:%i') AS createDate,
-                   DATE_FORMAT(CI.UPDATE_DATE, '%Y-%m-%d %H:%i') AS updateDate,
-                   M.ID                                          AS staffId,
-                   M.NAME                                        AS staffName,
-                   M.PHONE_NUMBER                                AS staffPhoneNumber
+                     WHERE LI.LOCATION_CODE = CI.LOCATION_CODE)       AS locationName,
+                   (SELECT COOPERATIVE_NAME
+                      FROM COOPERATIVE_HOSPITAL CH
+                     WHERE CH.COOPERATIVE_CODE = CI.COOPERATIVE_CODE) AS cooperativeName,
+                   (SELECT LOCATION_NAME
+                      FROM LOCATION_INFO LI
+                     WHERE LI.LOCATION_CODE = CI.JURISDICTION)        AS jurisdictionName,
+                   CI.COOPERATIVE_CODE                                AS cooperativeCode,
+                   CI.JURISDICTION                                    AS jurisdiction,
+                   CI.CENTER_ADDRESS                                  AS centerAddress,
+                   CI.CENTER_NUMBER                                   AS centerNumber,
+                   CI.TOTAL_CAPACITY                                  AS totalCapacity,
+                   CI.TOTAL_STAFF                                     AS totalStaff,
+                   DATE_FORMAT(CI.CREATE_DATE, '%Y-%m-%d %H:%i')      AS createDate,
+                   DATE_FORMAT(CI.UPDATE_DATE, '%Y-%m-%d %H:%i')      AS updateDate,
+                   M.ID                                               AS staffId,
+                   M.NAME                                             AS staffName,
+                   M.PHONE_NUMBER                                     AS staffPhoneNumber
               FROM CENTER_INFO CI
               LEFT OUTER JOIN MEMBER M
                 ON CI.CENTER_CODE = M.CENTER_CODE
@@ -132,12 +142,14 @@
     <update id="updateCenterInfo" parameterType="CenterInfoDTO">
         <![CDATA[
             UPDATE CENTER_INFO
-               SET LOCATION_CODE = #{locationCode},
-                   CENTER_ADDRESS = #{centerAddress},
-                   CENTER_NUMBER = #{centerNumber},
-                   TOTAL_CAPACITY = #{totalCapacity},
-                   TOTAL_STAFF = #{totalStaff}
-             WHERE CENTER_CODE = ${centerCode}
+               SET LOCATION_CODE    = #{locationCode},
+                   CENTER_ADDRESS   = #{centerAddress},
+                   CENTER_NUMBER    = #{centerNumber},
+                   TOTAL_CAPACITY   = #{totalCapacity},
+                   TOTAL_STAFF      = #{totalStaff},
+                   COOPERATIVE_CODE = #{cooperativeCode},
+                   JURISDICTION     = #{jurisdiction}
+             WHERE CENTER_CODE      = ${centerCode}
         ]]>
     </update>
     
@@ -154,4 +166,14 @@
                AND M.ID           = #{staffId}
         ]]>
     </select>
+    
+    <select id="selectCooperativeHospialList" parameterType="LocationDTO" resultType="LocationDTO">
+        <![CDATA[
+            SELECT COOPERATIVE_CODE AS locationCode,
+                   COOPERATIVE_NAME AS locationName
+              FROM COOPERATIVE_HOSPITAL
+             WHERE 1 = 1
+        ]]>
+    </select>
+    
 </mapper>

+ 18 - 0
src/main/webapp/WEB-INF/jsp/center/edit.jsp

@@ -106,6 +106,24 @@ $( function(){
                                                     </div>
                                                 </td>
                                             </tr>
+                                            <tr>
+                                                <th><span class="fix">*</span>소관</th>
+                                                <td>
+                                                    <select class="custom-select" name="jurisdiction">
+                                                        <c:forEach var="k" items="${jurisdiction}">
+                                                            <option value="${k.locationCode}" <c:if test="${k.locationCode eq centerInfo.jurisdiction}"> selected="selected"</c:if>><c:out value="${k.locationName}"/></option>
+                                                        </c:forEach>
+                                                    </select>
+                                                </td>
+                                                <th><span class="fix">*</span>협력병원 </br>(요양기관번호)</th>
+                                                <td>
+                                                    <select class="custom-select" name="cooperativeCode">
+                                                        <c:forEach var="j" items="${cooperativeList}">
+                                                            <option value="${j.locationCode}" <c:if test="${j.locationCode eq center.cooperativeCode}"> selected="selected" </c:if>><c:out value="${j.locationName}"/></option>
+                                                        </c:forEach>
+                                                    </select>
+                                                </td>
+                                            </tr>
                                             <tr>
                                                 <th><span class="fix">*</span>전화번호</th>
                                                 <td colspan="3">

+ 10 - 0
src/main/webapp/WEB-INF/jsp/center/info.jsp

@@ -80,6 +80,16 @@ function reset() {
                                                 <c:out value="${centerInfo.locationName}" />
                                             </td>
                                         </tr>
+                                        <tr>
+                                            <th>소관</th>
+                                            <td>
+                                                <c:out value="${centerInfo.jurisdictionName}"></c:out>
+                                            </td>
+                                            <th>협력병원 </br>(요양기관번호)</th>
+                                            <td>
+                                                <c:out value="${centerInfo.cooperativeName}"></c:out>
+                                            </td>
+                                        </tr>
                                         <tr>
                                             <th>주소</th>
                                             <td>

+ 18 - 0
src/main/webapp/WEB-INF/jsp/center/new.jsp

@@ -144,6 +144,24 @@ $( function(){
                                                     </div>
                                                 </td>
                                             </tr>
+                                            <tr>
+                                                <th><span class="fix">*</span>소관</th>
+                                                <td>
+                                                    <select class="custom-select" name="jurisdiction">
+                                                        <c:forEach var="k" items="${jurisdiction}">
+                                                            <option value="${k.locationCode}"><c:out value="${k.locationName}"/></option>
+                                                        </c:forEach>
+                                                    </select>
+                                                </td>
+                                                <th><span class="fix">*</span>협력병원 </br>(요양기관번호)</th>
+                                                <td>
+                                                    <select class="custom-select" name="cooperativeCode">
+                                                        <c:forEach var="j" items="${cooperativeList}">
+                                                            <option value="${j.locationCode}"><c:out value="${j.locationName}"/></option>
+                                                        </c:forEach>
+                                                    </select>
+                                                </td>
+                                            </tr>
                                             <tr>
                                                 <th><span class="fix">*</span>전화번호</th>
                                                 <td colspan="3">