Browse Source

添加住院满意度调查和投诉与建议

lighter 2 years ago
parent
commit
4d853d8baf

+ 1 - 1
pom.xml

@@ -10,7 +10,7 @@
     </parent>
     <groupId>thyyxxk</groupId>
     <artifactId>wxservice-server</artifactId>
-    <version>10.7</version>
+    <version>10.8</version>
     <name>wxservice-server</name>
     <description>server for wxservice-web</description>
 

+ 13 - 0
src/main/java/thyyxxk/wxservice_server/controller/AssessmentController.java

@@ -1,13 +1,16 @@
 package thyyxxk.wxservice_server.controller;
 
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 import thyyxxk.wxservice_server.entity.ResultVo;
 import thyyxxk.wxservice_server.entity.assessment.ClinicSatisfiedQuestionnaire;
+import thyyxxk.wxservice_server.entity.assessment.ComplaintsAndSuggestions;
 import thyyxxk.wxservice_server.entity.assessment.DepressionQuestionnaire;
+import thyyxxk.wxservice_server.entity.assessment.InpatientSatisfiedQuestionnaire;
 import thyyxxk.wxservice_server.service.AssessmentService;
 
 /**
@@ -32,4 +35,14 @@ public class AssessmentController {
     public ResultVo<String> submitClinicSatisfiedAssessment(@RequestBody ClinicSatisfiedQuestionnaire questionnaire) {
         return service.submitClinicSatisfiedAssessment(questionnaire);
     }
+
+    @PostMapping("/submitInpatientSatisfiedAssessment")
+    public ResultVo<String> submitInpatientSatisfiedAssessment(@RequestBody InpatientSatisfiedQuestionnaire questionnaire) {
+        return service.submitInpatientSatisfiedAssessment(questionnaire);
+    }
+
+    @PostMapping("/submitComplaintsAndSuggestions")
+    public ResultVo<String> submitComplaintsAndSuggestions(@RequestBody @Validated ComplaintsAndSuggestions suggestions) {
+        return service.submitComplaintsAndSuggestions(suggestions);
+    }
 }

+ 11 - 3
src/main/java/thyyxxk/wxservice_server/dao/AssessmentDao.java

@@ -1,9 +1,7 @@
 package thyyxxk.wxservice_server.dao;
 
 import org.apache.ibatis.annotations.*;
-import thyyxxk.wxservice_server.entity.assessment.ClinicSatisfiedQuestionnaire;
-import thyyxxk.wxservice_server.entity.assessment.DepressionQuestionnaire;
-import thyyxxk.wxservice_server.entity.assessment.PushQuestionnaireVisit;
+import thyyxxk.wxservice_server.entity.assessment.*;
 
 import java.util.List;
 
@@ -13,6 +11,10 @@ import java.util.List;
 @Mapper
 public interface AssessmentDao {
 
+    @Insert("insert into t_complaints_and_suggestions (open_id, department, object, content, contact, name) values " +
+            "(#{openId},#{department},#{object},#{content},#{contact},#{name})")
+    void insertComplaintsAndSuggestions(ComplaintsAndSuggestions suggestions);
+
     @Select("select top 1 datediff(day, date, getdate()) from " +
             "t_depression_assessment with(nolock) where idcard=#{idcard} order by id desc")
     Integer getDateDiff(@Param("idcard") String idcard);
@@ -29,6 +31,12 @@ public interface AssessmentDao {
             "values (#{patientId},#{item1},#{item2},#{item3},#{item4},#{item5},#{item6},#{item7},#{item8},#{item9},#{item10},#{item11},#{item12})")
     void insertClinicSatisfiedAssessment(ClinicSatisfiedQuestionnaire questionnaire);
 
+    @Insert("insert into t_inpatient_satisfied_assessment (patient_id,item1,item2,item3,item4,item5,item6,item7,item8,item9,item10,item11,item12, " +
+            "item13,item14,item15,item16,item17,item18,item19,item20) " +
+            "values (#{patientId},#{item1},#{item2},#{item3},#{item4},#{item5},#{item6},#{item7},#{item8},#{item9},#{item10},#{item11},#{item12}, " +
+            "#{item13},#{item14},#{item15},#{item16},#{item17},#{item18},#{item19},#{item20})")
+    void insertInpatientSatisfiedAssessment(InpatientSatisfiedQuestionnaire questionnaire);
+
     @Select("select frequency from t_questionnaire_frequency where code=#{code} ")
     int selectQuestionnaireFrequency(String code);
 

+ 19 - 0
src/main/java/thyyxxk/wxservice_server/entity/assessment/ComplaintsAndSuggestions.java

@@ -0,0 +1,19 @@
+package thyyxxk.wxservice_server.entity.assessment;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+
+@Data
+public class ComplaintsAndSuggestions {
+    private String openId;
+    @NotBlank(message = "请填写投诉科室")
+    private String department;
+    @NotBlank(message = "请填写投诉对象")
+    private String object;
+    @NotBlank(message = "请填写投诉与建议内容")
+    private String content;
+    @NotBlank(message = "请填写联系方式")
+    private String contact;
+    private String name;
+}

+ 153 - 0
src/main/java/thyyxxk/wxservice_server/entity/assessment/InpatientSatisfiedQuestionnaire.java

@@ -0,0 +1,153 @@
+package thyyxxk.wxservice_server.entity.assessment;
+
+import lombok.Data;
+import thyyxxk.wxservice_server.utils.ListUtil;
+
+import java.util.List;
+
+@Data
+public class InpatientSatisfiedQuestionnaire {
+    private Integer id;
+    private String patientId;
+    private String item1;
+    private String item2;
+    private String item3;
+    private String item4;
+    private String item5;
+    private String item6;
+    private String item7;
+    private String item8;
+    private String item9;
+    private String item10;
+    private String item11;
+    private String item12;
+    private String item13;
+    private String item14;
+    private String item15;
+    private String item16;
+    private String item17;
+    private String item18;
+    private String item19;
+    private String item20;
+
+    private List<String> item2Arr;
+    private List<String> item4Arr;
+    private List<String> item6Arr;
+    private List<String> item8Arr;
+    private List<String> item10Arr;
+    private List<String> item12Arr;
+    private List<String> item14Arr;
+    private List<String> item16Arr;
+    private List<String> item18Arr;
+    private List<String> item20Arr;
+
+    public String getItem2() {
+        if (ListUtil.isEmpty(item2Arr)) {
+            return item2;
+        }
+        StringBuilder builder = new StringBuilder();
+        for (String item : item2Arr) {
+            builder.append(item).append("^");
+        }
+        return builder.substring(0, builder.length() - 1);
+    }
+
+    public String getItem4() {
+        if (ListUtil.isEmpty(item4Arr)) {
+            return item4;
+        }
+        StringBuilder builder = new StringBuilder();
+        for (String item : item4Arr) {
+            builder.append(item).append("^");
+        }
+        return builder.substring(0, builder.length() - 1);
+    }
+
+    public String getItem6() {
+        if (ListUtil.isEmpty(item6Arr)) {
+            return item6;
+        }
+        StringBuilder builder = new StringBuilder();
+        for (String item : item6Arr) {
+            builder.append(item).append("^");
+        }
+        return builder.substring(0, builder.length() - 1);
+    }
+
+    public String getItem8() {
+        if (ListUtil.isEmpty(item8Arr)) {
+            return item8;
+        }
+        StringBuilder builder = new StringBuilder();
+        for (String item : item8Arr) {
+            builder.append(item).append("^");
+        }
+        return builder.substring(0, builder.length() - 1);
+    }
+
+    public String getItem10() {
+        if (ListUtil.isEmpty(item10Arr)) {
+            return item10;
+        }
+        StringBuilder builder = new StringBuilder();
+        for (String item : item10Arr) {
+            builder.append(item).append("^");
+        }
+        return builder.substring(0, builder.length() - 1);
+    }
+
+    public String getItem12() {
+        if (ListUtil.isEmpty(item12Arr)) {
+            return item12;
+        }
+        StringBuilder builder = new StringBuilder();
+        for (String item : item12Arr) {
+            builder.append(item).append("^");
+        }
+        return builder.substring(0, builder.length() - 1);
+    }
+
+    public String getItem14() {
+        if (ListUtil.isEmpty(item14Arr)) {
+            return item14;
+        }
+        StringBuilder builder = new StringBuilder();
+        for (String item : item14Arr) {
+            builder.append(item).append("^");
+        }
+        return builder.substring(0, builder.length() - 1);
+    }
+
+    public String getItem16() {
+        if (ListUtil.isEmpty(item16Arr)) {
+            return item16;
+        }
+        StringBuilder builder = new StringBuilder();
+        for (String item : item16Arr) {
+            builder.append(item).append("^");
+        }
+        return builder.substring(0, builder.length() - 1);
+    }
+
+    public String getItem18() {
+        if (ListUtil.isEmpty(item18Arr)) {
+            return item18;
+        }
+        StringBuilder builder = new StringBuilder();
+        for (String item : item18Arr) {
+            builder.append(item).append("^");
+        }
+        return builder.substring(0, builder.length() - 1);
+    }
+
+    public String getItem20() {
+        if (ListUtil.isEmpty(item20Arr)) {
+            return item20;
+        }
+        StringBuilder builder = new StringBuilder();
+        for (String item : item20Arr) {
+            builder.append(item).append("^");
+        }
+        return builder.substring(0, builder.length() - 1);
+    }
+}

+ 14 - 0
src/main/java/thyyxxk/wxservice_server/service/AssessmentService.java

@@ -7,7 +7,9 @@ import thyyxxk.wxservice_server.dao.AssessmentDao;
 import thyyxxk.wxservice_server.config.exception.ExceptionEnum;
 import thyyxxk.wxservice_server.entity.ResultVo;
 import thyyxxk.wxservice_server.entity.assessment.ClinicSatisfiedQuestionnaire;
+import thyyxxk.wxservice_server.entity.assessment.ComplaintsAndSuggestions;
 import thyyxxk.wxservice_server.entity.assessment.DepressionQuestionnaire;
+import thyyxxk.wxservice_server.entity.assessment.InpatientSatisfiedQuestionnaire;
 import thyyxxk.wxservice_server.utils.ResultVoUtil;
 
 /**
@@ -39,4 +41,16 @@ public class AssessmentService {
         dao.insertClinicSatisfiedAssessment(questionnaire);
         return ResultVoUtil.success();
     }
+
+    public ResultVo<String> submitInpatientSatisfiedAssessment(InpatientSatisfiedQuestionnaire questionnaire) {
+        log.info("住院服务满意度调查:{}", questionnaire);
+        dao.insertInpatientSatisfiedAssessment(questionnaire);
+        return ResultVoUtil.success();
+    }
+
+    public ResultVo<String> submitComplaintsAndSuggestions(ComplaintsAndSuggestions suggestions) {
+        log.info("投诉与建议:{}", suggestions);
+        dao.insertComplaintsAndSuggestions(suggestions);
+        return ResultVoUtil.success();
+    }
 }