Browse Source

加入 题目选项 功能

java110 5 years ago
parent
commit
8ddcdeedff
17 changed files with 877 additions and 15 deletions
  1. 83 0
      java110-bean/src/main/java/com/java110/dto/questionAnswerTitleValue/QuestionAnswerTitleValueDto.java
  2. 60 0
      java110-bean/src/main/java/com/java110/po/questionAnswerTitleValue/QuestionAnswerTitleValuePo.java
  3. 115 0
      java110-db/src/main/resources/mapper/user/QuestionAnswerTitleValueServiceDaoImplMapper.xml
  4. 10 15
      java110-generator/src/main/resources/newBack/template_1.json
  5. 53 0
      java110-interface/src/main/java/com/java110/intf/user/IQuestionAnswerTitleValueInnerServiceSMO.java
  6. 97 0
      service-user/src/main/java/com/java110/user/api/QuestionAnswerApi.java
  7. 17 0
      service-user/src/main/java/com/java110/user/bmo/questionAnswerTitleValue/IDeleteQuestionAnswerTitleValueBMO.java
  8. 16 0
      service-user/src/main/java/com/java110/user/bmo/questionAnswerTitleValue/IGetQuestionAnswerTitleValueBMO.java
  9. 17 0
      service-user/src/main/java/com/java110/user/bmo/questionAnswerTitleValue/ISaveQuestionAnswerTitleValueBMO.java
  10. 17 0
      service-user/src/main/java/com/java110/user/bmo/questionAnswerTitleValue/IUpdateQuestionAnswerTitleValueBMO.java
  11. 34 0
      service-user/src/main/java/com/java110/user/bmo/questionAnswerTitleValue/impl/DeleteQuestionAnswerTitleValueBMOImpl.java
  12. 44 0
      service-user/src/main/java/com/java110/user/bmo/questionAnswerTitleValue/impl/GetQuestionAnswerTitleValueBMOImpl.java
  13. 38 0
      service-user/src/main/java/com/java110/user/bmo/questionAnswerTitleValue/impl/SaveQuestionAnswerTitleValueBMOImpl.java
  14. 34 0
      service-user/src/main/java/com/java110/user/bmo/questionAnswerTitleValue/impl/UpdateQuestionAnswerTitleValueBMOImpl.java
  15. 61 0
      service-user/src/main/java/com/java110/user/dao/IQuestionAnswerTitleValueServiceDao.java
  16. 98 0
      service-user/src/main/java/com/java110/user/dao/impl/QuestionAnswerTitleValueServiceDaoImpl.java
  17. 83 0
      service-user/src/main/java/com/java110/user/smo/impl/QuestionAnswerTitleValueInnerServiceSMOImpl.java

+ 83 - 0
java110-bean/src/main/java/com/java110/dto/questionAnswerTitleValue/QuestionAnswerTitleValueDto.java

@@ -0,0 +1,83 @@
+package com.java110.dto.questionAnswerTitleValue;
+
+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 QuestionAnswerTitleValueDto extends PageDto implements Serializable {
+
+    private String valueId;
+private String titleId;
+private String objId;
+private String objType;
+private String qaValue;
+private String seq;
+
+
+    private Date createTime;
+
+    private String statusCd = "0";
+
+
+    public String getValueId() {
+        return valueId;
+    }
+public void setValueId(String valueId) {
+        this.valueId = valueId;
+    }
+public String getTitleId() {
+        return titleId;
+    }
+public void setTitleId(String titleId) {
+        this.titleId = titleId;
+    }
+public String getObjId() {
+        return objId;
+    }
+public void setObjId(String objId) {
+        this.objId = objId;
+    }
+public String getObjType() {
+        return objType;
+    }
+public void setObjType(String objType) {
+        this.objType = objType;
+    }
+public String getQaValue() {
+        return qaValue;
+    }
+public void setQaValue(String qaValue) {
+        this.qaValue = qaValue;
+    }
+public String getSeq() {
+        return seq;
+    }
+public void setSeq(String seq) {
+        this.seq = seq;
+    }
+
+
+    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;
+    }
+}

+ 60 - 0
java110-bean/src/main/java/com/java110/po/questionAnswerTitleValue/QuestionAnswerTitleValuePo.java

@@ -0,0 +1,60 @@
+package com.java110.po.questionAnswerTitleValue;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class QuestionAnswerTitleValuePo implements Serializable {
+
+    private String valueId;
+private String titleId;
+private String objId;
+private String statusCd = "0";
+private String objType;
+private String qaValue;
+private String seq;
+public String getValueId() {
+        return valueId;
+    }
+public void setValueId(String valueId) {
+        this.valueId = valueId;
+    }
+public String getTitleId() {
+        return titleId;
+    }
+public void setTitleId(String titleId) {
+        this.titleId = titleId;
+    }
+public String getObjId() {
+        return objId;
+    }
+public void setObjId(String objId) {
+        this.objId = objId;
+    }
+public String getStatusCd() {
+        return statusCd;
+    }
+public void setStatusCd(String statusCd) {
+        this.statusCd = statusCd;
+    }
+public String getObjType() {
+        return objType;
+    }
+public void setObjType(String objType) {
+        this.objType = objType;
+    }
+public String getQaValue() {
+        return qaValue;
+    }
+public void setQaValue(String qaValue) {
+        this.qaValue = qaValue;
+    }
+public String getSeq() {
+        return seq;
+    }
+public void setSeq(String seq) {
+        this.seq = seq;
+    }
+
+
+
+}

+ 115 - 0
java110-db/src/main/resources/mapper/user/QuestionAnswerTitleValueServiceDaoImplMapper.xml

@@ -0,0 +1,115 @@
+<?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="questionAnswerTitleValueServiceDaoImpl">
+
+
+
+
+
+    <!-- 保存答卷选项信息 add by wuxw 2018-07-03 -->
+    <insert id="saveQuestionAnswerTitleValueInfo" parameterType="Map">
+        insert into question_answer_title_value(
+value_id,title_id,obj_id,obj_type,qa_value,seq
+) values (
+#{valueId},#{titleId},#{objId},#{objType},#{qaValue},#{seq}
+)
+    </insert>
+
+
+
+    <!-- 查询答卷选项信息 add by wuxw 2018-07-03 -->
+    <select id="getQuestionAnswerTitleValueInfo" parameterType="Map" resultType="Map">
+        select  t.value_id,t.value_id valueId,t.title_id,t.title_id titleId,t.obj_id,t.obj_id objId,t.status_cd,t.status_cd statusCd,t.obj_type,t.obj_type objType,t.qa_value,t.qa_value qaValue,t.seq 
+from question_answer_title_value t 
+where 1 =1 
+<if test="valueId !=null and valueId != ''">
+   and t.value_id= #{valueId}
+</if> 
+<if test="titleId !=null and titleId != ''">
+   and t.title_id= #{titleId}
+</if> 
+<if test="objId !=null and objId != ''">
+   and t.obj_id= #{objId}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="objType !=null and objType != ''">
+   and t.obj_type= #{objType}
+</if> 
+<if test="qaValue !=null and qaValue != ''">
+   and t.qa_value= #{qaValue}
+</if> 
+<if test="seq !=null and seq != ''">
+   and t.seq= #{seq}
+</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="updateQuestionAnswerTitleValueInfo" parameterType="Map">
+        update  question_answer_title_value t set t.status_cd = #{statusCd}
+<if test="newBId != null and newBId != ''">
+,t.b_id = #{newBId}
+</if> 
+<if test="titleId !=null and titleId != ''">
+, t.title_id= #{titleId}
+</if> 
+<if test="objId !=null and objId != ''">
+, t.obj_id= #{objId}
+</if> 
+<if test="objType !=null and objType != ''">
+, t.obj_type= #{objType}
+</if> 
+<if test="qaValue !=null and qaValue != ''">
+, t.qa_value= #{qaValue}
+</if> 
+<if test="seq !=null and seq != ''">
+, t.seq= #{seq}
+</if> 
+ where 1=1 <if test="valueId !=null and valueId != ''">
+and t.value_id= #{valueId}
+</if> 
+
+    </update>
+
+    <!-- 查询答卷选项数量 add by wuxw 2018-07-03 -->
+     <select id="queryQuestionAnswerTitleValuesCount" parameterType="Map" resultType="Map">
+        select  count(1) count 
+from question_answer_title_value t 
+where 1 =1 
+<if test="valueId !=null and valueId != ''">
+   and t.value_id= #{valueId}
+</if> 
+<if test="titleId !=null and titleId != ''">
+   and t.title_id= #{titleId}
+</if> 
+<if test="objId !=null and objId != ''">
+   and t.obj_id= #{objId}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="objType !=null and objType != ''">
+   and t.obj_type= #{objType}
+</if> 
+<if test="qaValue !=null and qaValue != ''">
+   and t.qa_value= #{qaValue}
+</if> 
+<if test="seq !=null and seq != ''">
+   and t.seq= #{seq}
+</if> 
+
+
+     </select>
+
+</mapper>

+ 10 - 15
java110-generator/src/main/resources/newBack/template_1.json

@@ -1,34 +1,29 @@
 {
   "autoMove": true,
-  "id": "titleId",
-  "name": "questionAnswerTitle",
-  "desc": "答卷",
+  "id": "valueId",
+  "name": "questionAnswerTitleValue",
+  "desc": "答卷选项",
   "shareParam": "objId",
   "shareColumn": "obj_id",
   "shareName": "user",
-  "tableName": "question_answer_title",
+  "tableName": "question_answer_title_value",
   "param": {
+    "valueId": "value_id",
     "titleId": "title_id",
-    "qaId": "qa_id",
-    "qaTitle": "qa_title",
+    "qaValue": "qa_value",
     "statusCd": "status_cd",
     "objType": "obj_type",
     "objId": "obj_id",
-    "titleType": "title_type",
     "seq": "seq"
   },
   "required": [
     {
-      "code": "qaId",
-      "msg": "问答ID不能为空"
+      "code": "titleId",
+      "msg": "标题不能为空"
     },
     {
-      "code": "qaTitle",
-      "msg": "题目不能为空"
-    },
-    {
-      "code": "titleType",
-      "msg": "题目类型不能为空"
+      "code": "qaValue",
+      "msg": "选项值不能为空"
     },
     {
       "code": "objType",

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

@@ -0,0 +1,53 @@
+package com.java110.intf.user;
+
+import com.java110.config.feign.FeignConfiguration;
+import com.java110.dto.questionAnswerTitleValue.QuestionAnswerTitleValueDto;
+import com.java110.po.questionAnswerTitleValue.QuestionAnswerTitleValuePo;
+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 IQuestionAnswerTitleValueInnerServiceSMO
+ * @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("/questionAnswerTitleValueApi")
+public interface IQuestionAnswerTitleValueInnerServiceSMO {
+
+
+    @RequestMapping(value = "/saveQuestionAnswerTitleValue", method = RequestMethod.POST)
+    public int saveQuestionAnswerTitleValue(@RequestBody QuestionAnswerTitleValuePo questionAnswerTitleValuePo);
+
+    @RequestMapping(value = "/updateQuestionAnswerTitleValue", method = RequestMethod.POST)
+    public int updateQuestionAnswerTitleValue(@RequestBody  QuestionAnswerTitleValuePo questionAnswerTitleValuePo);
+
+    @RequestMapping(value = "/deleteQuestionAnswerTitleValue", method = RequestMethod.POST)
+    public int deleteQuestionAnswerTitleValue(@RequestBody  QuestionAnswerTitleValuePo questionAnswerTitleValuePo);
+
+    /**
+     * <p>查询小区楼信息</p>
+     *
+     *
+     * @param questionAnswerTitleValueDto 数据对象分享
+     * @return QuestionAnswerTitleValueDto 对象数据
+     */
+    @RequestMapping(value = "/queryQuestionAnswerTitleValues", method = RequestMethod.POST)
+    List<QuestionAnswerTitleValueDto> queryQuestionAnswerTitleValues(@RequestBody QuestionAnswerTitleValueDto questionAnswerTitleValueDto);
+
+    /**
+     * 查询<p>小区楼</p>总记录数
+     *
+     * @param questionAnswerTitleValueDto 数据对象分享
+     * @return 小区下的小区楼记录数
+     */
+    @RequestMapping(value = "/queryQuestionAnswerTitleValuesCount", method = RequestMethod.POST)
+    int queryQuestionAnswerTitleValuesCount(@RequestBody QuestionAnswerTitleValueDto questionAnswerTitleValueDto);
+}

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

@@ -3,8 +3,10 @@ package com.java110.user.api;
 import com.alibaba.fastjson.JSONObject;
 import com.java110.dto.questionAnswer.QuestionAnswerDto;
 import com.java110.dto.questionAnswerTitle.QuestionAnswerTitleDto;
+import com.java110.dto.questionAnswerTitleValue.QuestionAnswerTitleValueDto;
 import com.java110.po.questionAnswer.QuestionAnswerPo;
 import com.java110.po.questionAnswerTitle.QuestionAnswerTitlePo;
+import com.java110.po.questionAnswerTitleValue.QuestionAnswerTitleValuePo;
 import com.java110.user.bmo.questionAnswer.IDeleteQuestionAnswerBMO;
 import com.java110.user.bmo.questionAnswer.IGetQuestionAnswerBMO;
 import com.java110.user.bmo.questionAnswer.ISaveQuestionAnswerBMO;
@@ -13,6 +15,10 @@ import com.java110.user.bmo.questionAnswerTitle.IDeleteQuestionAnswerTitleBMO;
 import com.java110.user.bmo.questionAnswerTitle.IGetQuestionAnswerTitleBMO;
 import com.java110.user.bmo.questionAnswerTitle.ISaveQuestionAnswerTitleBMO;
 import com.java110.user.bmo.questionAnswerTitle.IUpdateQuestionAnswerTitleBMO;
+import com.java110.user.bmo.questionAnswerTitleValue.IDeleteQuestionAnswerTitleValueBMO;
+import com.java110.user.bmo.questionAnswerTitleValue.IGetQuestionAnswerTitleValueBMO;
+import com.java110.user.bmo.questionAnswerTitleValue.ISaveQuestionAnswerTitleValueBMO;
+import com.java110.user.bmo.questionAnswerTitleValue.IUpdateQuestionAnswerTitleValueBMO;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.BeanConvertUtil;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -44,6 +50,17 @@ public class QuestionAnswerApi {
     @Autowired
     private IGetQuestionAnswerTitleBMO getQuestionAnswerTitleBMOImpl;
 
+    @Autowired
+    private ISaveQuestionAnswerTitleValueBMO saveQuestionAnswerTitleValueBMOImpl;
+    @Autowired
+    private IUpdateQuestionAnswerTitleValueBMO updateQuestionAnswerTitleValueBMOImpl;
+    @Autowired
+    private IDeleteQuestionAnswerTitleValueBMO deleteQuestionAnswerTitleValueBMOImpl;
+
+    @Autowired
+    private IGetQuestionAnswerTitleValueBMO getQuestionAnswerTitleValueBMOImpl;
+
+
     /**
      * 微信保存消息模板
      *
@@ -216,4 +233,84 @@ public class QuestionAnswerApi {
         questionAnswerTitleDto.setObjId(QuestionAnswerDto.QA_TYPE_COMMUNITY.endsWith(objType) ? communityId : storeId);
         return getQuestionAnswerTitleBMOImpl.get(questionAnswerTitleDto);
     }
+
+    /**
+     * 微信保存消息模板
+     * @serviceCode /questionAnswer/saveQuestionAnswerTitleValue
+     * @path /app/questionAnswer/saveQuestionAnswerTitleValue
+     * @param reqJson
+     * @return
+     */
+    @RequestMapping(value = "/saveQuestionAnswerTitleValue", method = RequestMethod.POST)
+    public ResponseEntity<String> saveQuestionAnswerTitleValue(@RequestBody JSONObject reqJson) {
+
+        Assert.hasKeyAndValue(reqJson, "titleId", "请求报文中未包含titleId");
+        Assert.hasKeyAndValue(reqJson, "qaValue", "请求报文中未包含qaValue");
+        Assert.hasKeyAndValue(reqJson, "objType", "请求报文中未包含objType");
+        Assert.hasKeyAndValue(reqJson, "seq", "请求报文中未包含seq");
+
+
+        QuestionAnswerTitleValuePo questionAnswerTitleValuePo = BeanConvertUtil.covertBean(reqJson, QuestionAnswerTitleValuePo.class);
+        return saveQuestionAnswerTitleValueBMOImpl.save(questionAnswerTitleValuePo);
+    }
+
+    /**
+     * 微信修改消息模板
+     * @serviceCode /questionAnswer/updateQuestionAnswerTitleValue
+     * @path /app/questionAnswer/updateQuestionAnswerTitleValue
+     * @param reqJson
+     * @return
+     */
+    @RequestMapping(value = "/updateQuestionAnswerTitleValue", method = RequestMethod.POST)
+    public ResponseEntity<String> updateQuestionAnswerTitleValue(@RequestBody JSONObject reqJson) {
+
+        Assert.hasKeyAndValue(reqJson, "titleId", "请求报文中未包含titleId");
+        Assert.hasKeyAndValue(reqJson, "qaValue", "请求报文中未包含qaValue");
+        Assert.hasKeyAndValue(reqJson, "objType", "请求报文中未包含objType");
+        Assert.hasKeyAndValue(reqJson, "seq", "请求报文中未包含seq");
+        Assert.hasKeyAndValue(reqJson, "valueId", "valueId不能为空");
+
+
+        QuestionAnswerTitleValuePo questionAnswerTitleValuePo = BeanConvertUtil.covertBean(reqJson, QuestionAnswerTitleValuePo.class);
+        return updateQuestionAnswerTitleValueBMOImpl.update(questionAnswerTitleValuePo);
+    }
+
+    /**
+     * 微信删除消息模板
+     * @serviceCode /questionAnswer/deleteQuestionAnswerTitleValue
+     * @path /app/questionAnswer/deleteQuestionAnswerTitleValue
+     * @param reqJson
+     * @return
+     */
+    @RequestMapping(value = "/deleteQuestionAnswerTitleValue", method = RequestMethod.POST)
+    public ResponseEntity<String> deleteQuestionAnswerTitleValue(@RequestBody JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "communityId", "小区ID不能为空");
+
+        Assert.hasKeyAndValue(reqJson, "valueId", "valueId不能为空");
+
+
+        QuestionAnswerTitleValuePo questionAnswerTitleValuePo = BeanConvertUtil.covertBean(reqJson, QuestionAnswerTitleValuePo.class);
+        return deleteQuestionAnswerTitleValueBMOImpl.delete(questionAnswerTitleValuePo);
+    }
+
+    /**
+     * 微信删除消息模板
+     * @serviceCode /questionAnswer/queryQuestionAnswerTitleValue
+     * @path /app/questionAnswer/queryQuestionAnswerTitleValue
+     * @param communityId 小区ID
+     * @return
+     */
+    @RequestMapping(value = "/queryQuestionAnswerTitleValue", method = RequestMethod.GET)
+    public ResponseEntity<String> queryQuestionAnswerTitleValue(@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) {
+        QuestionAnswerTitleValueDto questionAnswerTitleValueDto = new QuestionAnswerTitleValueDto();
+        questionAnswerTitleValueDto.setPage(page);
+        questionAnswerTitleValueDto.setRow(row);
+        questionAnswerTitleValueDto.setObjType(objType);
+        questionAnswerTitleValueDto.setObjId(QuestionAnswerDto.QA_TYPE_COMMUNITY.endsWith(objType) ? communityId : storeId);
+        return getQuestionAnswerTitleValueBMOImpl.get(questionAnswerTitleValueDto);
+    }
 }

+ 17 - 0
service-user/src/main/java/com/java110/user/bmo/questionAnswerTitleValue/IDeleteQuestionAnswerTitleValueBMO.java

@@ -0,0 +1,17 @@
+package com.java110.user.bmo.questionAnswerTitleValue;
+import com.java110.po.questionAnswerTitleValue.QuestionAnswerTitleValuePo;
+import org.springframework.http.ResponseEntity;
+
+public interface IDeleteQuestionAnswerTitleValueBMO {
+
+
+    /**
+     * 修改答卷选项
+     * add by wuxw
+     * @param questionAnswerTitleValuePo
+     * @return
+     */
+    ResponseEntity<String> delete(QuestionAnswerTitleValuePo questionAnswerTitleValuePo);
+
+
+}

+ 16 - 0
service-user/src/main/java/com/java110/user/bmo/questionAnswerTitleValue/IGetQuestionAnswerTitleValueBMO.java

@@ -0,0 +1,16 @@
+package com.java110.user.bmo.questionAnswerTitleValue;
+import com.java110.dto.questionAnswerTitleValue.QuestionAnswerTitleValueDto;
+import org.springframework.http.ResponseEntity;
+public interface IGetQuestionAnswerTitleValueBMO {
+
+
+    /**
+     * 查询答卷选项
+     * add by wuxw
+     * @param  questionAnswerTitleValueDto
+     * @return
+     */
+    ResponseEntity<String> get(QuestionAnswerTitleValueDto questionAnswerTitleValueDto);
+
+
+}

+ 17 - 0
service-user/src/main/java/com/java110/user/bmo/questionAnswerTitleValue/ISaveQuestionAnswerTitleValueBMO.java

@@ -0,0 +1,17 @@
+package com.java110.user.bmo.questionAnswerTitleValue;
+
+import com.java110.po.questionAnswerTitleValue.QuestionAnswerTitleValuePo;
+import org.springframework.http.ResponseEntity;
+public interface ISaveQuestionAnswerTitleValueBMO {
+
+
+    /**
+     * 添加答卷选项
+     * add by wuxw
+     * @param questionAnswerTitleValuePo
+     * @return
+     */
+    ResponseEntity<String> save(QuestionAnswerTitleValuePo questionAnswerTitleValuePo);
+
+
+}

+ 17 - 0
service-user/src/main/java/com/java110/user/bmo/questionAnswerTitleValue/IUpdateQuestionAnswerTitleValueBMO.java

@@ -0,0 +1,17 @@
+package com.java110.user.bmo.questionAnswerTitleValue;
+import com.java110.po.questionAnswerTitleValue.QuestionAnswerTitleValuePo;
+import org.springframework.http.ResponseEntity;
+
+public interface IUpdateQuestionAnswerTitleValueBMO {
+
+
+    /**
+     * 修改答卷选项
+     * add by wuxw
+     * @param questionAnswerTitleValuePo
+     * @return
+     */
+    ResponseEntity<String> update(QuestionAnswerTitleValuePo questionAnswerTitleValuePo);
+
+
+}

+ 34 - 0
service-user/src/main/java/com/java110/user/bmo/questionAnswerTitleValue/impl/DeleteQuestionAnswerTitleValueBMOImpl.java

@@ -0,0 +1,34 @@
+package com.java110.user.bmo.questionAnswerTitleValue.impl;
+
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.intf.user.IQuestionAnswerTitleValueInnerServiceSMO;
+import com.java110.po.questionAnswerTitleValue.QuestionAnswerTitleValuePo;
+import com.java110.user.bmo.questionAnswerTitleValue.IDeleteQuestionAnswerTitleValueBMO;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+
+@Service("deleteQuestionAnswerTitleValueBMOImpl")
+public class DeleteQuestionAnswerTitleValueBMOImpl implements IDeleteQuestionAnswerTitleValueBMO {
+
+    @Autowired
+    private IQuestionAnswerTitleValueInnerServiceSMO questionAnswerTitleValueInnerServiceSMOImpl;
+
+    /**
+     * @param questionAnswerTitleValuePo 数据
+     * @return 订单服务能够接受的报文
+     */
+    @Java110Transactional
+    public ResponseEntity<String> delete(QuestionAnswerTitleValuePo questionAnswerTitleValuePo) {
+
+        int flag = questionAnswerTitleValueInnerServiceSMOImpl.deleteQuestionAnswerTitleValue(questionAnswerTitleValuePo);
+
+        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/questionAnswerTitleValue/impl/GetQuestionAnswerTitleValueBMOImpl.java

@@ -0,0 +1,44 @@
+package com.java110.user.bmo.questionAnswerTitleValue.impl;
+
+import com.java110.dto.questionAnswerTitleValue.QuestionAnswerTitleValueDto;
+import com.java110.intf.user.IQuestionAnswerTitleValueInnerServiceSMO;
+import com.java110.user.bmo.questionAnswerTitleValue.IGetQuestionAnswerTitleValueBMO;
+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("getQuestionAnswerTitleValueBMOImpl")
+public class GetQuestionAnswerTitleValueBMOImpl implements IGetQuestionAnswerTitleValueBMO {
+
+    @Autowired
+    private IQuestionAnswerTitleValueInnerServiceSMO questionAnswerTitleValueInnerServiceSMOImpl;
+
+    /**
+     * @param questionAnswerTitleValueDto
+     * @return 订单服务能够接受的报文
+     */
+    public ResponseEntity<String> get(QuestionAnswerTitleValueDto questionAnswerTitleValueDto) {
+
+
+        int count = questionAnswerTitleValueInnerServiceSMOImpl.queryQuestionAnswerTitleValuesCount(questionAnswerTitleValueDto);
+
+        List<QuestionAnswerTitleValueDto> questionAnswerTitleValueDtos = null;
+        if (count > 0) {
+            questionAnswerTitleValueDtos = questionAnswerTitleValueInnerServiceSMOImpl.queryQuestionAnswerTitleValues(questionAnswerTitleValueDto);
+        } else {
+            questionAnswerTitleValueDtos = new ArrayList<>();
+        }
+
+        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) questionAnswerTitleValueDto.getRow()), count, questionAnswerTitleValueDtos);
+
+        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
+
+        return responseEntity;
+    }
+
+}

+ 38 - 0
service-user/src/main/java/com/java110/user/bmo/questionAnswerTitleValue/impl/SaveQuestionAnswerTitleValueBMOImpl.java

@@ -0,0 +1,38 @@
+package com.java110.user.bmo.questionAnswerTitleValue.impl;
+
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.intf.user.IQuestionAnswerTitleValueInnerServiceSMO;
+import com.java110.po.questionAnswerTitleValue.QuestionAnswerTitleValuePo;
+import com.java110.user.bmo.questionAnswerTitleValue.ISaveQuestionAnswerTitleValueBMO;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+
+@Service("saveQuestionAnswerTitleValueBMOImpl")
+public class SaveQuestionAnswerTitleValueBMOImpl implements ISaveQuestionAnswerTitleValueBMO {
+
+    @Autowired
+    private IQuestionAnswerTitleValueInnerServiceSMO questionAnswerTitleValueInnerServiceSMOImpl;
+
+    /**
+     * 添加小区信息
+     *
+     * @param questionAnswerTitleValuePo
+     * @return 订单服务能够接受的报文
+     */
+    @Java110Transactional
+    public ResponseEntity<String> save(QuestionAnswerTitleValuePo questionAnswerTitleValuePo) {
+
+        questionAnswerTitleValuePo.setValueId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_valueId));
+        int flag = questionAnswerTitleValueInnerServiceSMOImpl.saveQuestionAnswerTitleValue(questionAnswerTitleValuePo);
+
+        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/questionAnswerTitleValue/impl/UpdateQuestionAnswerTitleValueBMOImpl.java

@@ -0,0 +1,34 @@
+package com.java110.user.bmo.questionAnswerTitleValue.impl;
+
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.intf.user.IQuestionAnswerTitleValueInnerServiceSMO;
+import com.java110.po.questionAnswerTitleValue.QuestionAnswerTitleValuePo;
+import com.java110.user.bmo.questionAnswerTitleValue.IUpdateQuestionAnswerTitleValueBMO;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+
+@Service("updateQuestionAnswerTitleValueBMOImpl")
+public class UpdateQuestionAnswerTitleValueBMOImpl implements IUpdateQuestionAnswerTitleValueBMO {
+
+    @Autowired
+    private IQuestionAnswerTitleValueInnerServiceSMO questionAnswerTitleValueInnerServiceSMOImpl;
+
+    /**
+     * @param questionAnswerTitleValuePo
+     * @return 订单服务能够接受的报文
+     */
+    @Java110Transactional
+    public ResponseEntity<String> update(QuestionAnswerTitleValuePo questionAnswerTitleValuePo) {
+
+        int flag = questionAnswerTitleValueInnerServiceSMOImpl.updateQuestionAnswerTitleValue(questionAnswerTitleValuePo);
+
+        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/IQuestionAnswerTitleValueServiceDao.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 IQuestionAnswerTitleValueServiceDao {
+
+
+    /**
+     * 保存 答卷选项信息
+     * @param info
+     * @throws DAOException DAO异常
+     */
+    void saveQuestionAnswerTitleValueInfo(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 查询答卷选项信息(instance过程)
+     * 根据bId 查询答卷选项信息
+     * @param info bId 信息
+     * @return 答卷选项信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getQuestionAnswerTitleValueInfo(Map info) throws DAOException;
+
+
+
+    /**
+     * 修改答卷选项信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    void updateQuestionAnswerTitleValueInfo(Map info) throws DAOException;
+
+
+    /**
+     * 查询答卷选项总数
+     *
+     * @param info 答卷选项信息
+     * @return 答卷选项数量
+     */
+    int queryQuestionAnswerTitleValuesCount(Map info);
+
+}

+ 98 - 0
service-user/src/main/java/com/java110/user/dao/impl/QuestionAnswerTitleValueServiceDaoImpl.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.IQuestionAnswerTitleValueServiceDao;
+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("questionAnswerTitleValueServiceDaoImpl")
+//@Transactional
+public class QuestionAnswerTitleValueServiceDaoImpl extends BaseServiceDao implements IQuestionAnswerTitleValueServiceDao {
+
+    private static Logger logger = LoggerFactory.getLogger(QuestionAnswerTitleValueServiceDaoImpl.class);
+
+
+
+
+
+    /**
+     * 保存答卷选项信息 到 instance
+     * @param info   bId 信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public void saveQuestionAnswerTitleValueInfo(Map info) throws DAOException {
+        logger.debug("保存答卷选项信息Instance 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.insert("questionAnswerTitleValueServiceDaoImpl.saveQuestionAnswerTitleValueInfo",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> getQuestionAnswerTitleValueInfo(Map info) throws DAOException {
+        logger.debug("查询答卷选项信息 入参 info : {}",info);
+
+        List<Map> businessQuestionAnswerTitleValueInfos = sqlSessionTemplate.selectList("questionAnswerTitleValueServiceDaoImpl.getQuestionAnswerTitleValueInfo",info);
+
+        return businessQuestionAnswerTitleValueInfos;
+    }
+
+
+    /**
+     * 修改答卷选项信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public void updateQuestionAnswerTitleValueInfo(Map info) throws DAOException {
+        logger.debug("修改答卷选项信息Instance 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.update("questionAnswerTitleValueServiceDaoImpl.updateQuestionAnswerTitleValueInfo",info);
+
+        if(saveFlag < 1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改答卷选项信息Instance数据失败:"+ JSONObject.toJSONString(info));
+        }
+    }
+
+     /**
+     * 查询答卷选项数量
+     * @param info 答卷选项信息
+     * @return 答卷选项数量
+     */
+    @Override
+    public int queryQuestionAnswerTitleValuesCount(Map info) {
+        logger.debug("查询答卷选项数据 入参 info : {}",info);
+
+        List<Map> businessQuestionAnswerTitleValueInfos = sqlSessionTemplate.selectList("questionAnswerTitleValueServiceDaoImpl.queryQuestionAnswerTitleValuesCount", info);
+        if (businessQuestionAnswerTitleValueInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessQuestionAnswerTitleValueInfos.get(0).get("count").toString());
+    }
+
+
+}

+ 83 - 0
service-user/src/main/java/com/java110/user/smo/impl/QuestionAnswerTitleValueInnerServiceSMOImpl.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.questionAnswerTitleValue.QuestionAnswerTitleValueDto;
+import com.java110.intf.user.IQuestionAnswerTitleValueInnerServiceSMO;
+import com.java110.po.questionAnswerTitleValue.QuestionAnswerTitleValuePo;
+import com.java110.user.dao.IQuestionAnswerTitleValueServiceDao;
+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 QuestionAnswerTitleValueInnerServiceSMOImpl extends BaseServiceSMO implements IQuestionAnswerTitleValueInnerServiceSMO {
+
+    @Autowired
+    private IQuestionAnswerTitleValueServiceDao questionAnswerTitleValueServiceDaoImpl;
+
+
+    @Override
+    public int saveQuestionAnswerTitleValue(@RequestBody QuestionAnswerTitleValuePo questionAnswerTitleValuePo) {
+        int saveFlag = 1;
+        questionAnswerTitleValueServiceDaoImpl.saveQuestionAnswerTitleValueInfo(BeanConvertUtil.beanCovertMap(questionAnswerTitleValuePo));
+        return saveFlag;
+    }
+
+    @Override
+    public int updateQuestionAnswerTitleValue(@RequestBody QuestionAnswerTitleValuePo questionAnswerTitleValuePo) {
+        int saveFlag = 1;
+        questionAnswerTitleValueServiceDaoImpl.updateQuestionAnswerTitleValueInfo(BeanConvertUtil.beanCovertMap(questionAnswerTitleValuePo));
+        return saveFlag;
+    }
+
+    @Override
+    public int deleteQuestionAnswerTitleValue(@RequestBody QuestionAnswerTitleValuePo questionAnswerTitleValuePo) {
+        int saveFlag = 1;
+        questionAnswerTitleValuePo.setStatusCd("1");
+        questionAnswerTitleValueServiceDaoImpl.updateQuestionAnswerTitleValueInfo(BeanConvertUtil.beanCovertMap(questionAnswerTitleValuePo));
+        return saveFlag;
+    }
+
+    @Override
+    public List<QuestionAnswerTitleValueDto> queryQuestionAnswerTitleValues(@RequestBody QuestionAnswerTitleValueDto questionAnswerTitleValueDto) {
+
+        //校验是否传了 分页信息
+
+        int page = questionAnswerTitleValueDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            questionAnswerTitleValueDto.setPage((page - 1) * questionAnswerTitleValueDto.getRow());
+        }
+
+        List<QuestionAnswerTitleValueDto> questionAnswerTitleValues = BeanConvertUtil.covertBeanList(questionAnswerTitleValueServiceDaoImpl.getQuestionAnswerTitleValueInfo(BeanConvertUtil.beanCovertMap(questionAnswerTitleValueDto)), QuestionAnswerTitleValueDto.class);
+
+        return questionAnswerTitleValues;
+    }
+
+
+    @Override
+    public int queryQuestionAnswerTitleValuesCount(@RequestBody QuestionAnswerTitleValueDto questionAnswerTitleValueDto) {
+        return questionAnswerTitleValueServiceDaoImpl.queryQuestionAnswerTitleValuesCount(BeanConvertUtil.beanCovertMap(questionAnswerTitleValueDto));
+    }
+
+    public IQuestionAnswerTitleValueServiceDao getQuestionAnswerTitleValueServiceDaoImpl() {
+        return questionAnswerTitleValueServiceDaoImpl;
+    }
+
+    public void setQuestionAnswerTitleValueServiceDaoImpl(IQuestionAnswerTitleValueServiceDao questionAnswerTitleValueServiceDaoImpl) {
+        this.questionAnswerTitleValueServiceDaoImpl = questionAnswerTitleValueServiceDaoImpl;
+    }
+}