java110 4 vuotta sitten
vanhempi
commit
78fffad1ff

+ 9 - 0
java110-bean/src/main/java/com/java110/dto/questionAnswer/QuestionAnswerDto.java

@@ -30,6 +30,7 @@ public class QuestionAnswerDto extends PageDto implements Serializable {
     private String objId;
     private String objId;
     private String[] objIds;
     private String[] objIds;
     private String qaId;
     private String qaId;
+    private String userId;
 
 
 
 
     private Date createTime;
     private Date createTime;
@@ -133,4 +134,12 @@ public class QuestionAnswerDto extends PageDto implements Serializable {
     public void setQaTypeName(String qaTypeName) {
     public void setQaTypeName(String qaTypeName) {
         this.qaTypeName = qaTypeName;
         this.qaTypeName = qaTypeName;
     }
     }
+
+    public String getUserId() {
+        return userId;
+    }
+
+    public void setUserId(String userId) {
+        this.userId = userId;
+    }
 }
 }

+ 9 - 0
java110-bean/src/main/java/com/java110/dto/questionAnswerTitle/QuestionAnswerTitleDto.java

@@ -30,6 +30,7 @@ public class QuestionAnswerTitleDto extends PageDto implements Serializable {
     private String seq;
     private String seq;
     private String qaId;
     private String qaId;
     private String qaTitle;
     private String qaTitle;
+    private String userId;
 
 
 
 
     private Date createTime;
     private Date createTime;
@@ -127,4 +128,12 @@ public class QuestionAnswerTitleDto extends PageDto implements Serializable {
     public void setQuestionAnswerTitleValues(List<QuestionAnswerTitleValueDto> questionAnswerTitleValues) {
     public void setQuestionAnswerTitleValues(List<QuestionAnswerTitleValueDto> questionAnswerTitleValues) {
         this.questionAnswerTitleValues = questionAnswerTitleValues;
         this.questionAnswerTitleValues = questionAnswerTitleValues;
     }
     }
+
+    public String getUserId() {
+        return userId;
+    }
+
+    public void setUserId(String userId) {
+        this.userId = userId;
+    }
 }
 }

+ 7 - 0
java110-db/src/main/resources/mapper/user/QuestionAnswerServiceDaoImplMapper.xml

@@ -17,11 +17,18 @@
 
 
     <!-- 查询答卷信息 add by wuxw 2018-07-03 -->
     <!-- 查询答卷信息 add by wuxw 2018-07-03 -->
     <select id="getQuestionAnswerInfo" parameterType="Map" resultType="Map">
     <select id="getQuestionAnswerInfo" parameterType="Map" resultType="Map">
+
         select t.qa_name,t.qa_name qaName,t.qa_type,t.qa_type qaType,t.status_cd,t.status_cd
         select t.qa_name,t.qa_name qaName,t.qa_type,t.qa_type qaType,t.status_cd,t.status_cd
         statusCd,t.start_time,t.start_time startTime,t.end_time,t.end_time endTime,t.remark,
         statusCd,t.start_time,t.start_time startTime,t.end_time,t.end_time endTime,t.remark,
         t.obj_type,t.obj_type objType,t.obj_id,t.obj_id objId,t.qa_id,t.qa_id qaId,td.`name` qaTypeName
         t.obj_type,t.obj_type objType,t.obj_id,t.obj_id objId,t.qa_id,t.qa_id qaId,td.`name` qaTypeName
+        <if test="userId !=null and userId != ''">
+        ,uqa.person_id userId
+        </if>
         from question_answer t
         from question_answer t
         LEFT JOIN t_dict td on td.status_cd = t.qa_type and td.table_name = 'question_answer' and td.table_columns = 'qa_type'
         LEFT JOIN t_dict td on td.status_cd = t.qa_type and td.table_name = 'question_answer' and td.table_columns = 'qa_type'
+        <if test="userId !=null and userId != ''">
+        LEFT JOIN user_question_answer uqa on t.qa_id = uqa.qa_id and uqa.status_cd = '0' and uqa.person_id = #{userId}
+        </if>
         where 1 =1
         where 1 =1
         <if test="qaName !=null and qaName != ''">
         <if test="qaName !=null and qaName != ''">
             and t.qa_name= #{qaName}
             and t.qa_name= #{qaName}

+ 6 - 2
service-user/src/main/java/com/java110/user/api/QuestionAnswerApi.java

@@ -147,6 +147,7 @@ public class QuestionAnswerApi {
     @RequestMapping(value = "/queryQuestionAnswer", method = RequestMethod.GET)
     @RequestMapping(value = "/queryQuestionAnswer", method = RequestMethod.GET)
     public ResponseEntity<String> queryQuestionAnswer(
     public ResponseEntity<String> queryQuestionAnswer(
             @RequestHeader(value = "store-id", required = false) String storeId,
             @RequestHeader(value = "store-id", required = false) String storeId,
+            @RequestHeader(value = "user-id", required = false) String userId,
             @RequestParam(value = "communityId", required = false) String communityId,
             @RequestParam(value = "communityId", required = false) String communityId,
             @RequestParam(value = "objType", required = false) String objType,
             @RequestParam(value = "objType", required = false) String objType,
             @RequestParam(value = "page") int page,
             @RequestParam(value = "page") int page,
@@ -154,6 +155,7 @@ public class QuestionAnswerApi {
         QuestionAnswerDto questionAnswerDto = new QuestionAnswerDto();
         QuestionAnswerDto questionAnswerDto = new QuestionAnswerDto();
         questionAnswerDto.setPage(page);
         questionAnswerDto.setPage(page);
         questionAnswerDto.setRow(row);
         questionAnswerDto.setRow(row);
+        questionAnswerDto.setUserId(userId);
         if (!StringUtil.isEmpty(objType)) {
         if (!StringUtil.isEmpty(objType)) {
             questionAnswerDto.setObjType(objType);
             questionAnswerDto.setObjType(objType);
             questionAnswerDto.setObjId(QuestionAnswerDto.QA_TYPE_COMMUNITY.equals(objType) ? communityId : storeId);
             questionAnswerDto.setObjId(QuestionAnswerDto.QA_TYPE_COMMUNITY.equals(objType) ? communityId : storeId);
@@ -192,7 +194,7 @@ public class QuestionAnswerApi {
 
 
 
 
         QuestionAnswerTitlePo questionAnswerTitlePo = BeanConvertUtil.covertBean(reqJson, QuestionAnswerTitlePo.class);
         QuestionAnswerTitlePo questionAnswerTitlePo = BeanConvertUtil.covertBean(reqJson, QuestionAnswerTitlePo.class);
-        return saveQuestionAnswerTitleBMOImpl.save(questionAnswerTitlePo,titleValues);
+        return saveQuestionAnswerTitleBMOImpl.save(questionAnswerTitlePo, titleValues);
     }
     }
 
 
     /**
     /**
@@ -222,7 +224,7 @@ public class QuestionAnswerApi {
         }
         }
 
 
         QuestionAnswerTitlePo questionAnswerTitlePo = BeanConvertUtil.covertBean(reqJson, QuestionAnswerTitlePo.class);
         QuestionAnswerTitlePo questionAnswerTitlePo = BeanConvertUtil.covertBean(reqJson, QuestionAnswerTitlePo.class);
-        return updateQuestionAnswerTitleBMOImpl.update(questionAnswerTitlePo,titleValues);
+        return updateQuestionAnswerTitleBMOImpl.update(questionAnswerTitlePo, titleValues);
     }
     }
 
 
     /**
     /**
@@ -254,6 +256,7 @@ public class QuestionAnswerApi {
      */
      */
     @RequestMapping(value = "/queryQuestionAnswerTitle", method = RequestMethod.GET)
     @RequestMapping(value = "/queryQuestionAnswerTitle", method = RequestMethod.GET)
     public ResponseEntity<String> queryQuestionAnswerTitle(@RequestHeader(value = "store-id", required = false) String storeId,
     public ResponseEntity<String> queryQuestionAnswerTitle(@RequestHeader(value = "store-id", required = false) String storeId,
+                                                          // @RequestHeader(value = "user-id", required = false) String userId,
                                                            @RequestParam(value = "communityId", required = false) String communityId,
                                                            @RequestParam(value = "communityId", required = false) String communityId,
                                                            @RequestParam(value = "objType") String objType,
                                                            @RequestParam(value = "objType") String objType,
                                                            @RequestParam(value = "qaId") String qaId,
                                                            @RequestParam(value = "qaId") String qaId,
@@ -263,6 +266,7 @@ public class QuestionAnswerApi {
         questionAnswerTitleDto.setPage(page);
         questionAnswerTitleDto.setPage(page);
         questionAnswerTitleDto.setRow(row);
         questionAnswerTitleDto.setRow(row);
         questionAnswerTitleDto.setQaId(qaId);
         questionAnswerTitleDto.setQaId(qaId);
+        //questionAnswerTitleDto.setUserId(userId);
         if (!StringUtil.isEmpty(objType)) {
         if (!StringUtil.isEmpty(objType)) {
             questionAnswerTitleDto.setObjType(objType);
             questionAnswerTitleDto.setObjType(objType);
             questionAnswerTitleDto.setObjId(QuestionAnswerDto.QA_TYPE_COMMUNITY.equals(objType) ? communityId : storeId);
             questionAnswerTitleDto.setObjId(QuestionAnswerDto.QA_TYPE_COMMUNITY.equals(objType) ? communityId : storeId);