java110 hace 5 años
padre
commit
c69a1ca1e3
Se han modificado 18 ficheros con 987 adiciones y 18 borrados
  1. 115 0
      java110-bean/src/main/java/com/java110/dto/questionAnswer/QuestionAnswerDto.java
  2. 74 0
      java110-bean/src/main/java/com/java110/po/questionAnswer/QuestionAnswerPo.java
  3. 1 0
      java110-core/src/main/java/com/java110/core/factory/GenerateCodeFactory.java
  4. 133 0
      java110-db/src/main/resources/mapper/user/QuestionAnswerServiceDaoImplMapper.xml
  5. 26 18
      java110-generator/src/main/resources/newBack/template_1.json
  6. 53 0
      java110-interface/src/main/java/com/java110/intf/user/IQuestionAnswerInnerServiceSMO.java
  7. 117 0
      service-user/src/main/java/com/java110/user/api/QuestionAnswerApi.java
  8. 19 0
      service-user/src/main/java/com/java110/user/bmo/questionAnswer/IDeleteQuestionAnswerBMO.java
  9. 19 0
      service-user/src/main/java/com/java110/user/bmo/questionAnswer/IGetQuestionAnswerBMO.java
  10. 19 0
      service-user/src/main/java/com/java110/user/bmo/questionAnswer/ISaveQuestionAnswerBMO.java
  11. 19 0
      service-user/src/main/java/com/java110/user/bmo/questionAnswer/IUpdateQuestionAnswerBMO.java
  12. 34 0
      service-user/src/main/java/com/java110/user/bmo/questionAnswer/impl/DeleteQuestionAnswerBMOImpl.java
  13. 44 0
      service-user/src/main/java/com/java110/user/bmo/questionAnswer/impl/GetQuestionAnswerBMOImpl.java
  14. 38 0
      service-user/src/main/java/com/java110/user/bmo/questionAnswer/impl/SaveQuestionAnswerBMOImpl.java
  15. 34 0
      service-user/src/main/java/com/java110/user/bmo/questionAnswer/impl/UpdateQuestionAnswerBMOImpl.java
  16. 61 0
      service-user/src/main/java/com/java110/user/dao/IQuestionAnswerServiceDao.java
  17. 98 0
      service-user/src/main/java/com/java110/user/dao/impl/QuestionAnswerServiceDaoImpl.java
  18. 83 0
      service-user/src/main/java/com/java110/user/smo/impl/QuestionAnswerInnerServiceSMOImpl.java

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

@@ -0,0 +1,115 @@
+package com.java110.dto.questionAnswer;
+
+import com.java110.dto.PageDto;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @ClassName FloorDto
+ * @Description 答卷数据层封装
+ * @Author wuxw
+ * @Date 2019/4/24 8:52
+ * @Version 1.0
+ * add by wuxw 2019/4/24
+ **/
+public class QuestionAnswerDto extends PageDto implements Serializable {
+
+    public static final String QA_TYPE_COMMUNITY = "3306";//小区
+
+    private String qaName;
+    private String qaType;
+    private String startTime;
+    private String endTime;
+    private String storeId;
+    private String objType;
+    private String objTd;
+    private String qaId;
+
+
+    private Date createTime;
+
+    private String statusCd = "0";
+
+
+    public String getQaName() {
+        return qaName;
+    }
+
+    public void setQaName(String qaName) {
+        this.qaName = qaName;
+    }
+
+    public String getQaType() {
+        return qaType;
+    }
+
+    public void setQaType(String qaType) {
+        this.qaType = qaType;
+    }
+
+    public String getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(String startTime) {
+        this.startTime = startTime;
+    }
+
+    public String getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(String endTime) {
+        this.endTime = endTime;
+    }
+
+    public String getStoreId() {
+        return storeId;
+    }
+
+    public void setStoreId(String storeId) {
+        this.storeId = storeId;
+    }
+
+    public String getObjType() {
+        return objType;
+    }
+
+    public void setObjType(String objType) {
+        this.objType = objType;
+    }
+
+    public String getObjTd() {
+        return objTd;
+    }
+
+    public void setObjTd(String objTd) {
+        this.objTd = objTd;
+    }
+
+    public String getQaId() {
+        return qaId;
+    }
+
+    public void setQaId(String qaId) {
+        this.qaId = qaId;
+    }
+
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getStatusCd() {
+        return statusCd;
+    }
+
+    public void setStatusCd(String statusCd) {
+        this.statusCd = statusCd;
+    }
+}

+ 74 - 0
java110-bean/src/main/java/com/java110/po/questionAnswer/QuestionAnswerPo.java

@@ -0,0 +1,74 @@
+package com.java110.po.questionAnswer;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class QuestionAnswerPo implements Serializable {
+
+    private String qaName;
+private String qaType;
+private String statusCd = "0";
+private String startTime;
+private String endTime;
+private String storeId;
+private String objType;
+private String objTd;
+private String qaId;
+public String getQaName() {
+        return qaName;
+    }
+public void setQaName(String qaName) {
+        this.qaName = qaName;
+    }
+public String getQaType() {
+        return qaType;
+    }
+public void setQaType(String qaType) {
+        this.qaType = qaType;
+    }
+public String getStatusCd() {
+        return statusCd;
+    }
+public void setStatusCd(String statusCd) {
+        this.statusCd = statusCd;
+    }
+public String getStartTime() {
+        return startTime;
+    }
+public void setStartTime(String startTime) {
+        this.startTime = startTime;
+    }
+public String getEndTime() {
+        return endTime;
+    }
+public void setEndTime(String endTime) {
+        this.endTime = endTime;
+    }
+public String getStoreId() {
+        return storeId;
+    }
+public void setStoreId(String storeId) {
+        this.storeId = storeId;
+    }
+public String getObjType() {
+        return objType;
+    }
+public void setObjType(String objType) {
+        this.objType = objType;
+    }
+public String getObjTd() {
+        return objTd;
+    }
+public void setObjTd(String objTd) {
+        this.objTd = objTd;
+    }
+public String getQaId() {
+        return qaId;
+    }
+public void setQaId(String qaId) {
+        this.qaId = qaId;
+    }
+
+
+
+}

+ 1 - 0
java110-core/src/main/java/com/java110/core/factory/GenerateCodeFactory.java

@@ -180,6 +180,7 @@ public class GenerateCodeFactory {
     public static final String CODE_PREFIX_applyType = "15";
     public static final String CODE_PREFIX_classesId = "16";
     public static final String CODE_PREFIX_rId = "17";
+    public static final String CODE_PREFIX_qaId = "18";
 
 
     /**

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

@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="questionAnswerServiceDaoImpl">
+
+
+
+
+
+    <!-- 保存答卷信息 add by wuxw 2018-07-03 -->
+    <insert id="saveQuestionAnswerInfo" parameterType="Map">
+        insert into question_answer(
+qa_name,qa_type,start_time,end_time,remark,obj_type,obj_id,qa_id
+) values (
+#{qaName},#{qaType},#{startTime},#{endTime},#{storeId},#{objType},#{objTd},#{qaId}
+)
+    </insert>
+
+
+
+    <!-- 查询答卷信息 add by wuxw 2018-07-03 -->
+    <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 statusCd,t.start_time,t.start_time startTime,t.end_time,t.end_time endTime,t.remark,t.remark storeId,t.obj_type,t.obj_type objType,t.obj_id,t.obj_id objTd,t.qa_id,t.qa_id qaId 
+from question_answer t 
+where 1 =1 
+<if test="qaName !=null and qaName != ''">
+   and t.qa_name= #{qaName}
+</if> 
+<if test="qaType !=null and qaType != ''">
+   and t.qa_type= #{qaType}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="startTime !=null and startTime != ''">
+   and t.start_time= #{startTime}
+</if> 
+<if test="endTime !=null and endTime != ''">
+   and t.end_time= #{endTime}
+</if> 
+<if test="storeId !=null and storeId != ''">
+   and t.remark= #{storeId}
+</if> 
+<if test="objType !=null and objType != ''">
+   and t.obj_type= #{objType}
+</if> 
+<if test="objTd !=null and objTd != ''">
+   and t.obj_id= #{objTd}
+</if> 
+<if test="qaId !=null and qaId != ''">
+   and t.qa_id= #{qaId}
+</if> 
+order by t.create_time desc
+<if test="page != -1 and page != null ">
+   limit #{page}, #{row}
+</if> 
+
+    </select>
+
+
+
+
+    <!-- 修改答卷信息 add by wuxw 2018-07-03 -->
+    <update id="updateQuestionAnswerInfo" parameterType="Map">
+        update  question_answer t set t.status_cd = #{statusCd}
+<if test="newBId != null and newBId != ''">
+,t.b_id = #{newBId}
+</if> 
+<if test="qaName !=null and qaName != ''">
+, t.qa_name= #{qaName}
+</if> 
+<if test="qaType !=null and qaType != ''">
+, t.qa_type= #{qaType}
+</if> 
+<if test="startTime !=null and startTime != ''">
+, t.start_time= #{startTime}
+</if> 
+<if test="endTime !=null and endTime != ''">
+, t.end_time= #{endTime}
+</if> 
+<if test="storeId !=null and storeId != ''">
+, t.remark= #{storeId}
+</if> 
+<if test="objType !=null and objType != ''">
+, t.obj_type= #{objType}
+</if> 
+<if test="objTd !=null and objTd != ''">
+, t.obj_id= #{objTd}
+</if> 
+ where 1=1 <if test="qaId !=null and qaId != ''">
+and t.qa_id= #{qaId}
+</if> 
+
+    </update>
+
+    <!-- 查询答卷数量 add by wuxw 2018-07-03 -->
+     <select id="queryQuestionAnswersCount" parameterType="Map" resultType="Map">
+        select  count(1) count 
+from question_answer t 
+where 1 =1 
+<if test="qaName !=null and qaName != ''">
+   and t.qa_name= #{qaName}
+</if> 
+<if test="qaType !=null and qaType != ''">
+   and t.qa_type= #{qaType}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="startTime !=null and startTime != ''">
+   and t.start_time= #{startTime}
+</if> 
+<if test="endTime !=null and endTime != ''">
+   and t.end_time= #{endTime}
+</if> 
+<if test="storeId !=null and storeId != ''">
+   and t.remark= #{storeId}
+</if> 
+<if test="objType !=null and objType != ''">
+   and t.obj_type= #{objType}
+</if> 
+<if test="objTd !=null and objTd != ''">
+   and t.obj_id= #{objTd}
+</if> 
+<if test="qaId !=null and qaId != ''">
+   and t.qa_id= #{qaId}
+</if> 
+
+
+     </select>
+
+</mapper>

+ 26 - 18
java110-generator/src/main/resources/newBack/template_1.json

@@ -1,30 +1,38 @@
 {
   "autoMove": true,
-  "id": "logId",
-  "name": "attendanceLog",
-  "desc": "考勤日志",
-  "shareParam": "storeId",
-  "shareColumn": "store_id",
-  "shareName": "common",
-  "tableName": "attendance_log",
+  "id": "titleId",
+  "name": "questionAnswerTitle",
+  "desc": "答卷",
+  "shareParam": "objId",
+  "shareColumn": "obj_id",
+  "shareName": "user",
+  "tableName": "question_answer_title",
   "param": {
-    "logId": "log_id",
-    "staffId": "staff_id",
-    "staffName": "staff_name",
+    "titleId": "title_id",
+    "qaId": "qa_id",
+    "qaTitle": "qa_title",
     "statusCd": "status_cd",
-    "departmentId": "department_id",
-    "departmentName": "department_name",
-    "clockTime": "clock_time",
-    "storeId": "store_id"
+    "objType": "obj_type",
+    "objId": "obj_id",
+    "titleType": "title_type",
+    "storeId": "seq"
   },
   "required": [
     {
-      "code": "staffId",
-      "msg": "员工不能为空"
+      "code": "qaId",
+      "msg": "问答ID不能为空"
     },
     {
-      "code": "storeId",
-      "msg": "商户不能为空"
+      "code": "qaTitle",
+      "msg": "题目不能为空"
+    },
+    {
+      "code": "titleType",
+      "msg": "题目类型不能为空"
+    },
+    {
+      "code": "objType",
+      "msg": "问卷对象不能为空"
     }
   ]
 }

+ 53 - 0
java110-interface/src/main/java/com/java110/intf/user/IQuestionAnswerInnerServiceSMO.java

@@ -0,0 +1,53 @@
+package com.java110.intf.user;
+
+import com.java110.config.feign.FeignConfiguration;
+import com.java110.dto.questionAnswer.QuestionAnswerDto;
+import com.java110.po.questionAnswer.QuestionAnswerPo;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import java.util.List;
+
+/**
+ * @ClassName IQuestionAnswerInnerServiceSMO
+ * @Description 答卷接口类
+ * @Author wuxw
+ * @Date 2019/4/24 9:04
+ * @Version 1.0
+ * add by wuxw 2019/4/24
+ **/
+@FeignClient(name = "user-service", configuration = {FeignConfiguration.class})
+@RequestMapping("/questionAnswerApi")
+public interface IQuestionAnswerInnerServiceSMO {
+
+
+    @RequestMapping(value = "/saveQuestionAnswer", method = RequestMethod.POST)
+    public int saveQuestionAnswer(@RequestBody QuestionAnswerPo questionAnswerPo);
+
+    @RequestMapping(value = "/updateQuestionAnswer", method = RequestMethod.POST)
+    public int updateQuestionAnswer(@RequestBody  QuestionAnswerPo questionAnswerPo);
+
+    @RequestMapping(value = "/deleteQuestionAnswer", method = RequestMethod.POST)
+    public int deleteQuestionAnswer(@RequestBody  QuestionAnswerPo questionAnswerPo);
+
+    /**
+     * <p>查询小区楼信息</p>
+     *
+     *
+     * @param questionAnswerDto 数据对象分享
+     * @return QuestionAnswerDto 对象数据
+     */
+    @RequestMapping(value = "/queryQuestionAnswers", method = RequestMethod.POST)
+    List<QuestionAnswerDto> queryQuestionAnswers(@RequestBody QuestionAnswerDto questionAnswerDto);
+
+    /**
+     * 查询<p>小区楼</p>总记录数
+     *
+     * @param questionAnswerDto 数据对象分享
+     * @return 小区下的小区楼记录数
+     */
+    @RequestMapping(value = "/queryQuestionAnswersCount", method = RequestMethod.POST)
+    int queryQuestionAnswersCount(@RequestBody QuestionAnswerDto questionAnswerDto);
+}

+ 117 - 0
service-user/src/main/java/com/java110/user/api/QuestionAnswerApi.java

@@ -0,0 +1,117 @@
+package com.java110.user.api;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.dto.questionAnswer.QuestionAnswerDto;
+import com.java110.po.questionAnswer.QuestionAnswerPo;
+import com.java110.user.bmo.questionAnswer.IDeleteQuestionAnswerBMO;
+import com.java110.user.bmo.questionAnswer.IGetQuestionAnswerBMO;
+import com.java110.user.bmo.questionAnswer.ISaveQuestionAnswerBMO;
+import com.java110.user.bmo.questionAnswer.IUpdateQuestionAnswerBMO;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+
+@RestController
+@RequestMapping(value = "/questionAnswer")
+public class QuestionAnswerApi {
+
+    @Autowired
+    private ISaveQuestionAnswerBMO saveQuestionAnswerBMOImpl;
+    @Autowired
+    private IUpdateQuestionAnswerBMO updateQuestionAnswerBMOImpl;
+    @Autowired
+    private IDeleteQuestionAnswerBMO deleteQuestionAnswerBMOImpl;
+
+    @Autowired
+    private IGetQuestionAnswerBMO getQuestionAnswerBMOImpl;
+
+    /**
+     * 微信保存消息模板
+     *
+     * @param reqJson
+     * @return
+     * @serviceCode /questionAnswer/saveQuestionAnswer
+     * @path /app/questionAnswer/saveQuestionAnswer
+     */
+    @RequestMapping(value = "/saveQuestionAnswer", method = RequestMethod.POST)
+    public ResponseEntity<String> saveQuestionAnswer(@RequestBody JSONObject reqJson) {
+
+        Assert.hasKeyAndValue(reqJson, "qaType", "请求报文中未包含qaType");
+        Assert.hasKeyAndValue(reqJson, "qaName", "请求报文中未包含qaName");
+        Assert.hasKeyAndValue(reqJson, "startTime", "请求报文中未包含startTime");
+        Assert.hasKeyAndValue(reqJson, "endTime", "请求报文中未包含endTime");
+        Assert.hasKeyAndValue(reqJson, "objType", "请求报文中未包含objType");
+
+
+        QuestionAnswerPo questionAnswerPo = BeanConvertUtil.covertBean(reqJson, QuestionAnswerPo.class);
+        return saveQuestionAnswerBMOImpl.save(questionAnswerPo);
+    }
+
+    /**
+     * 微信修改消息模板
+     *
+     * @param reqJson
+     * @return
+     * @serviceCode /questionAnswer/updateQuestionAnswer
+     * @path /app/questionAnswer/updateQuestionAnswer
+     */
+    @RequestMapping(value = "/updateQuestionAnswer", method = RequestMethod.POST)
+    public ResponseEntity<String> updateQuestionAnswer(@RequestBody JSONObject reqJson) {
+
+        Assert.hasKeyAndValue(reqJson, "qaType", "请求报文中未包含qaType");
+        Assert.hasKeyAndValue(reqJson, "qaName", "请求报文中未包含qaName");
+        Assert.hasKeyAndValue(reqJson, "startTime", "请求报文中未包含startTime");
+        Assert.hasKeyAndValue(reqJson, "endTime", "请求报文中未包含endTime");
+        Assert.hasKeyAndValue(reqJson, "objType", "请求报文中未包含objType");
+        Assert.hasKeyAndValue(reqJson, "qaId", "qaId不能为空");
+
+
+        QuestionAnswerPo questionAnswerPo = BeanConvertUtil.covertBean(reqJson, QuestionAnswerPo.class);
+        return updateQuestionAnswerBMOImpl.update(questionAnswerPo);
+    }
+
+    /**
+     * 微信删除消息模板
+     *
+     * @param reqJson
+     * @return
+     * @serviceCode /questionAnswer/deleteQuestionAnswer
+     * @path /app/questionAnswer/deleteQuestionAnswer
+     */
+    @RequestMapping(value = "/deleteQuestionAnswer", method = RequestMethod.POST)
+    public ResponseEntity<String> deleteQuestionAnswer(@RequestBody JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "communityId", "小区ID不能为空");
+
+        Assert.hasKeyAndValue(reqJson, "qaId", "qaId不能为空");
+
+
+        QuestionAnswerPo questionAnswerPo = BeanConvertUtil.covertBean(reqJson, QuestionAnswerPo.class);
+        return deleteQuestionAnswerBMOImpl.delete(questionAnswerPo);
+    }
+
+    /**
+     * 微信删除消息模板
+     *
+     * @param communityId 小区ID
+     * @return
+     * @serviceCode /questionAnswer/queryQuestionAnswer
+     * @path /app/questionAnswer/queryQuestionAnswer
+     */
+    @RequestMapping(value = "/queryQuestionAnswer", method = RequestMethod.GET)
+    public ResponseEntity<String> queryQuestionAnswer(
+            @RequestHeader(value = "store-id") String storeId,
+            @RequestParam(value = "communityId", required = false) String communityId,
+            @RequestParam(value = "objType") String objType,
+            @RequestParam(value = "page") int page,
+            @RequestParam(value = "row") int row) {
+        QuestionAnswerDto questionAnswerDto = new QuestionAnswerDto();
+        questionAnswerDto.setPage(page);
+        questionAnswerDto.setRow(row);
+        questionAnswerDto.setObjType(objType);
+        questionAnswerDto.setObjTd(QuestionAnswerDto.QA_TYPE_COMMUNITY.endsWith(objType) ? communityId : storeId);
+        return getQuestionAnswerBMOImpl.get(questionAnswerDto);
+    }
+}

+ 19 - 0
service-user/src/main/java/com/java110/user/bmo/questionAnswer/IDeleteQuestionAnswerBMO.java

@@ -0,0 +1,19 @@
+package com.java110.user.bmo.questionAnswer;
+
+import com.java110.po.questionAnswer.QuestionAnswerPo;
+import org.springframework.http.ResponseEntity;
+
+public interface IDeleteQuestionAnswerBMO {
+
+
+    /**
+     * 修改答卷
+     * add by wuxw
+     *
+     * @param questionAnswerPo
+     * @return
+     */
+    ResponseEntity<String> delete(QuestionAnswerPo questionAnswerPo);
+
+
+}

+ 19 - 0
service-user/src/main/java/com/java110/user/bmo/questionAnswer/IGetQuestionAnswerBMO.java

@@ -0,0 +1,19 @@
+package com.java110.user.bmo.questionAnswer;
+
+import com.java110.dto.questionAnswer.QuestionAnswerDto;
+import org.springframework.http.ResponseEntity;
+
+public interface IGetQuestionAnswerBMO {
+
+
+    /**
+     * 查询答卷
+     * add by wuxw
+     *
+     * @param questionAnswerDto
+     * @return
+     */
+    ResponseEntity<String> get(QuestionAnswerDto questionAnswerDto);
+
+
+}

+ 19 - 0
service-user/src/main/java/com/java110/user/bmo/questionAnswer/ISaveQuestionAnswerBMO.java

@@ -0,0 +1,19 @@
+package com.java110.user.bmo.questionAnswer;
+
+import com.java110.po.questionAnswer.QuestionAnswerPo;
+import org.springframework.http.ResponseEntity;
+
+public interface ISaveQuestionAnswerBMO {
+
+
+    /**
+     * 添加答卷
+     * add by wuxw
+     *
+     * @param questionAnswerPo
+     * @return
+     */
+    ResponseEntity<String> save(QuestionAnswerPo questionAnswerPo);
+
+
+}

+ 19 - 0
service-user/src/main/java/com/java110/user/bmo/questionAnswer/IUpdateQuestionAnswerBMO.java

@@ -0,0 +1,19 @@
+package com.java110.user.bmo.questionAnswer;
+
+import com.java110.po.questionAnswer.QuestionAnswerPo;
+import org.springframework.http.ResponseEntity;
+
+public interface IUpdateQuestionAnswerBMO {
+
+
+    /**
+     * 修改答卷
+     * add by wuxw
+     *
+     * @param questionAnswerPo
+     * @return
+     */
+    ResponseEntity<String> update(QuestionAnswerPo questionAnswerPo);
+
+
+}

+ 34 - 0
service-user/src/main/java/com/java110/user/bmo/questionAnswer/impl/DeleteQuestionAnswerBMOImpl.java

@@ -0,0 +1,34 @@
+package com.java110.user.bmo.questionAnswer.impl;
+
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.intf.user.IQuestionAnswerInnerServiceSMO;
+import com.java110.po.questionAnswer.QuestionAnswerPo;
+import com.java110.user.bmo.questionAnswer.IDeleteQuestionAnswerBMO;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+
+@Service("deleteQuestionAnswerBMOImpl")
+public class DeleteQuestionAnswerBMOImpl implements IDeleteQuestionAnswerBMO {
+
+    @Autowired
+    private IQuestionAnswerInnerServiceSMO questionAnswerInnerServiceSMOImpl;
+
+    /**
+     * @param questionAnswerPo 数据
+     * @return 订单服务能够接受的报文
+     */
+    @Java110Transactional
+    public ResponseEntity<String> delete(QuestionAnswerPo questionAnswerPo) {
+
+        int flag = questionAnswerInnerServiceSMOImpl.deleteQuestionAnswer(questionAnswerPo);
+
+        if (flag > 0) {
+            return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功");
+        }
+
+        return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败");
+    }
+
+}

+ 44 - 0
service-user/src/main/java/com/java110/user/bmo/questionAnswer/impl/GetQuestionAnswerBMOImpl.java

@@ -0,0 +1,44 @@
+package com.java110.user.bmo.questionAnswer.impl;
+
+import com.java110.dto.questionAnswer.QuestionAnswerDto;
+import com.java110.intf.user.IQuestionAnswerInnerServiceSMO;
+import com.java110.user.bmo.questionAnswer.IGetQuestionAnswerBMO;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Service("getQuestionAnswerBMOImpl")
+public class GetQuestionAnswerBMOImpl implements IGetQuestionAnswerBMO {
+
+    @Autowired
+    private IQuestionAnswerInnerServiceSMO questionAnswerInnerServiceSMOImpl;
+
+    /**
+     * @param questionAnswerDto
+     * @return 订单服务能够接受的报文
+     */
+    public ResponseEntity<String> get(QuestionAnswerDto questionAnswerDto) {
+
+
+        int count = questionAnswerInnerServiceSMOImpl.queryQuestionAnswersCount(questionAnswerDto);
+
+        List<QuestionAnswerDto> questionAnswerDtos = null;
+        if (count > 0) {
+            questionAnswerDtos = questionAnswerInnerServiceSMOImpl.queryQuestionAnswers(questionAnswerDto);
+        } else {
+            questionAnswerDtos = new ArrayList<>();
+        }
+
+        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) questionAnswerDto.getRow()), count, questionAnswerDtos);
+
+        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
+
+        return responseEntity;
+    }
+
+}

+ 38 - 0
service-user/src/main/java/com/java110/user/bmo/questionAnswer/impl/SaveQuestionAnswerBMOImpl.java

@@ -0,0 +1,38 @@
+package com.java110.user.bmo.questionAnswer.impl;
+
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.intf.user.IQuestionAnswerInnerServiceSMO;
+import com.java110.po.questionAnswer.QuestionAnswerPo;
+import com.java110.user.bmo.questionAnswer.ISaveQuestionAnswerBMO;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+
+@Service("saveQuestionAnswerBMOImpl")
+public class SaveQuestionAnswerBMOImpl implements ISaveQuestionAnswerBMO {
+
+    @Autowired
+    private IQuestionAnswerInnerServiceSMO questionAnswerInnerServiceSMOImpl;
+
+    /**
+     * 添加小区信息
+     *
+     * @param questionAnswerPo
+     * @return 订单服务能够接受的报文
+     */
+    @Java110Transactional
+    public ResponseEntity<String> save(QuestionAnswerPo questionAnswerPo) {
+
+        questionAnswerPo.setQaId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_qaId));
+        int flag = questionAnswerInnerServiceSMOImpl.saveQuestionAnswer(questionAnswerPo);
+
+        if (flag > 0) {
+            return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功");
+        }
+
+        return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败");
+    }
+
+}

+ 34 - 0
service-user/src/main/java/com/java110/user/bmo/questionAnswer/impl/UpdateQuestionAnswerBMOImpl.java

@@ -0,0 +1,34 @@
+package com.java110.user.bmo.questionAnswer.impl;
+
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.intf.user.IQuestionAnswerInnerServiceSMO;
+import com.java110.po.questionAnswer.QuestionAnswerPo;
+import com.java110.user.bmo.questionAnswer.IUpdateQuestionAnswerBMO;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+
+@Service("updateQuestionAnswerBMOImpl")
+public class UpdateQuestionAnswerBMOImpl implements IUpdateQuestionAnswerBMO {
+
+    @Autowired
+    private IQuestionAnswerInnerServiceSMO questionAnswerInnerServiceSMOImpl;
+
+    /**
+     * @param questionAnswerPo
+     * @return 订单服务能够接受的报文
+     */
+    @Java110Transactional
+    public ResponseEntity<String> update(QuestionAnswerPo questionAnswerPo) {
+
+        int flag = questionAnswerInnerServiceSMOImpl.updateQuestionAnswer(questionAnswerPo);
+
+        if (flag > 0) {
+            return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功");
+        }
+
+        return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败");
+    }
+
+}

+ 61 - 0
service-user/src/main/java/com/java110/user/dao/IQuestionAnswerServiceDao.java

@@ -0,0 +1,61 @@
+package com.java110.user.dao;
+
+
+import com.java110.utils.exception.DAOException;
+import com.java110.entity.merchant.BoMerchant;
+import com.java110.entity.merchant.BoMerchantAttr;
+import com.java110.entity.merchant.Merchant;
+import com.java110.entity.merchant.MerchantAttr;
+
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 答卷组件内部之间使用,没有给外围系统提供服务能力
+ * 答卷服务接口类,要求全部以字符串传输,方便微服务化
+ * 新建客户,修改客户,删除客户,查询客户等功能
+ *
+ * Created by wuxw on 2016/12/27.
+ */
+public interface IQuestionAnswerServiceDao {
+
+
+    /**
+     * 保存 答卷信息
+     * @param info
+     * @throws DAOException DAO异常
+     */
+    void saveQuestionAnswerInfo(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 查询答卷信息(instance过程)
+     * 根据bId 查询答卷信息
+     * @param info bId 信息
+     * @return 答卷信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getQuestionAnswerInfo(Map info) throws DAOException;
+
+
+
+    /**
+     * 修改答卷信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    void updateQuestionAnswerInfo(Map info) throws DAOException;
+
+
+    /**
+     * 查询答卷总数
+     *
+     * @param info 答卷信息
+     * @return 答卷数量
+     */
+    int queryQuestionAnswersCount(Map info);
+
+}

+ 98 - 0
service-user/src/main/java/com/java110/user/dao/impl/QuestionAnswerServiceDaoImpl.java

@@ -0,0 +1,98 @@
+package com.java110.user.dao.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.utils.constant.ResponseConstant;
+import com.java110.utils.exception.DAOException;
+import com.java110.utils.util.DateUtil;
+import com.java110.core.base.dao.BaseServiceDao;
+import com.java110.user.dao.IQuestionAnswerServiceDao;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 答卷服务 与数据库交互
+ * Created by wuxw on 2017/4/5.
+ */
+@Service("questionAnswerServiceDaoImpl")
+//@Transactional
+public class QuestionAnswerServiceDaoImpl extends BaseServiceDao implements IQuestionAnswerServiceDao {
+
+    private static Logger logger = LoggerFactory.getLogger(QuestionAnswerServiceDaoImpl.class);
+
+
+
+
+
+    /**
+     * 保存答卷信息 到 instance
+     * @param info   bId 信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public void saveQuestionAnswerInfo(Map info) throws DAOException {
+        logger.debug("保存答卷信息Instance 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.insert("questionAnswerServiceDaoImpl.saveQuestionAnswerInfo",info);
+
+        if(saveFlag < 1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存答卷信息Instance数据失败:"+ JSONObject.toJSONString(info));
+        }
+    }
+
+
+    /**
+     * 查询答卷信息(instance)
+     * @param info bId 信息
+     * @return List<Map>
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public List<Map> getQuestionAnswerInfo(Map info) throws DAOException {
+        logger.debug("查询答卷信息 入参 info : {}",info);
+
+        List<Map> businessQuestionAnswerInfos = sqlSessionTemplate.selectList("questionAnswerServiceDaoImpl.getQuestionAnswerInfo",info);
+
+        return businessQuestionAnswerInfos;
+    }
+
+
+    /**
+     * 修改答卷信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public void updateQuestionAnswerInfo(Map info) throws DAOException {
+        logger.debug("修改答卷信息Instance 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.update("questionAnswerServiceDaoImpl.updateQuestionAnswerInfo",info);
+
+        if(saveFlag < 1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改答卷信息Instance数据失败:"+ JSONObject.toJSONString(info));
+        }
+    }
+
+     /**
+     * 查询答卷数量
+     * @param info 答卷信息
+     * @return 答卷数量
+     */
+    @Override
+    public int queryQuestionAnswersCount(Map info) {
+        logger.debug("查询答卷数据 入参 info : {}",info);
+
+        List<Map> businessQuestionAnswerInfos = sqlSessionTemplate.selectList("questionAnswerServiceDaoImpl.queryQuestionAnswersCount", info);
+        if (businessQuestionAnswerInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessQuestionAnswerInfos.get(0).get("count").toString());
+    }
+
+
+}

+ 83 - 0
service-user/src/main/java/com/java110/user/smo/impl/QuestionAnswerInnerServiceSMOImpl.java

@@ -0,0 +1,83 @@
+package com.java110.user.smo.impl;
+
+
+import com.java110.core.base.smo.BaseServiceSMO;
+import com.java110.dto.PageDto;
+import com.java110.dto.questionAnswer.QuestionAnswerDto;
+import com.java110.intf.user.IQuestionAnswerInnerServiceSMO;
+import com.java110.po.questionAnswer.QuestionAnswerPo;
+import com.java110.user.dao.IQuestionAnswerServiceDao;
+import com.java110.utils.util.BeanConvertUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * @ClassName FloorInnerServiceSMOImpl
+ * @Description 答卷内部服务实现类
+ * @Author wuxw
+ * @Date 2019/4/24 9:20
+ * @Version 1.0
+ * add by wuxw 2019/4/24
+ **/
+@RestController
+public class QuestionAnswerInnerServiceSMOImpl extends BaseServiceSMO implements IQuestionAnswerInnerServiceSMO {
+
+    @Autowired
+    private IQuestionAnswerServiceDao questionAnswerServiceDaoImpl;
+
+
+    @Override
+    public int saveQuestionAnswer(@RequestBody QuestionAnswerPo questionAnswerPo) {
+        int saveFlag = 1;
+        questionAnswerServiceDaoImpl.saveQuestionAnswerInfo(BeanConvertUtil.beanCovertMap(questionAnswerPo));
+        return saveFlag;
+    }
+
+    @Override
+    public int updateQuestionAnswer(@RequestBody QuestionAnswerPo questionAnswerPo) {
+        int saveFlag = 1;
+        questionAnswerServiceDaoImpl.updateQuestionAnswerInfo(BeanConvertUtil.beanCovertMap(questionAnswerPo));
+        return saveFlag;
+    }
+
+    @Override
+    public int deleteQuestionAnswer(@RequestBody QuestionAnswerPo questionAnswerPo) {
+        int saveFlag = 1;
+        questionAnswerPo.setStatusCd("1");
+        questionAnswerServiceDaoImpl.updateQuestionAnswerInfo(BeanConvertUtil.beanCovertMap(questionAnswerPo));
+        return saveFlag;
+    }
+
+    @Override
+    public List<QuestionAnswerDto> queryQuestionAnswers(@RequestBody QuestionAnswerDto questionAnswerDto) {
+
+        //校验是否传了 分页信息
+
+        int page = questionAnswerDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            questionAnswerDto.setPage((page - 1) * questionAnswerDto.getRow());
+        }
+
+        List<QuestionAnswerDto> questionAnswers = BeanConvertUtil.covertBeanList(questionAnswerServiceDaoImpl.getQuestionAnswerInfo(BeanConvertUtil.beanCovertMap(questionAnswerDto)), QuestionAnswerDto.class);
+
+        return questionAnswers;
+    }
+
+
+    @Override
+    public int queryQuestionAnswersCount(@RequestBody QuestionAnswerDto questionAnswerDto) {
+        return questionAnswerServiceDaoImpl.queryQuestionAnswersCount(BeanConvertUtil.beanCovertMap(questionAnswerDto));
+    }
+
+    public IQuestionAnswerServiceDao getQuestionAnswerServiceDaoImpl() {
+        return questionAnswerServiceDaoImpl;
+    }
+
+    public void setQuestionAnswerServiceDaoImpl(IQuestionAnswerServiceDao questionAnswerServiceDaoImpl) {
+        this.questionAnswerServiceDaoImpl = questionAnswerServiceDaoImpl;
+    }
+}