java110 пре 4 година
родитељ
комит
e76458b956

+ 107 - 31
java110-bean/src/main/java/com/java110/dto/userQuestionAnswerValue/UserQuestionAnswerValueDto.java

@@ -1,6 +1,7 @@
 package com.java110.dto.userQuestionAnswerValue;
 
 import com.java110.dto.PageDto;
+
 import java.io.Serializable;
 import java.util.Date;
 
@@ -15,16 +16,22 @@ import java.util.Date;
 public class UserQuestionAnswerValueDto extends PageDto implements Serializable {
 
     private String score;
-private String valueId;
-private String titleId;
-private String answerType;
-private String objId;
-private String userQaId;
-private String valueContent;
-private String personId;
-private String objType;
-private String userTitleId;
-private String qaId;
+    private String valueId;
+    private String titleId;
+    private String answerType;
+    private String objId;
+    private String userQaId;
+    private String valueContent;
+    private String personId;
+    private String objType;
+    private String userTitleId;
+    private String qaId;
+    private String qaTypeName;
+    private String userName;
+    private String qaName;
+    private String qaTitle;
+    private String qaValue;
+    private String qaType;
 
 
     private Date createTime;
@@ -35,67 +42,88 @@ private String qaId;
     public String getScore() {
         return score;
     }
-public void setScore(String score) {
+
+    public void setScore(String score) {
         this.score = score;
     }
-public String getValueId() {
+
+    public String getValueId() {
         return valueId;
     }
-public void setValueId(String valueId) {
+
+    public void setValueId(String valueId) {
         this.valueId = valueId;
     }
-public String getTitleId() {
+
+    public String getTitleId() {
         return titleId;
     }
-public void setTitleId(String titleId) {
+
+    public void setTitleId(String titleId) {
         this.titleId = titleId;
     }
-public String getAnswerType() {
+
+    public String getAnswerType() {
         return answerType;
     }
-public void setAnswerType(String answerType) {
+
+    public void setAnswerType(String answerType) {
         this.answerType = answerType;
     }
-public String getObjId() {
+
+    public String getObjId() {
         return objId;
     }
-public void setObjId(String objId) {
+
+    public void setObjId(String objId) {
         this.objId = objId;
     }
-public String getUserQaId() {
+
+    public String getUserQaId() {
         return userQaId;
     }
-public void setUserQaId(String userQaId) {
+
+    public void setUserQaId(String userQaId) {
         this.userQaId = userQaId;
     }
-public String getValueContent() {
+
+    public String getValueContent() {
         return valueContent;
     }
-public void setValueContent(String valueContent) {
+
+    public void setValueContent(String valueContent) {
         this.valueContent = valueContent;
     }
-public String getPersonId() {
+
+    public String getPersonId() {
         return personId;
     }
-public void setPersonId(String personId) {
+
+    public void setPersonId(String personId) {
         this.personId = personId;
     }
-public String getObjType() {
+
+    public String getObjType() {
         return objType;
     }
-public void setObjType(String objType) {
+
+    public void setObjType(String objType) {
         this.objType = objType;
     }
-public String getUserTitleId() {
+
+    public String getUserTitleId() {
         return userTitleId;
     }
-public void setUserTitleId(String userTitleId) {
+
+    public void setUserTitleId(String userTitleId) {
         this.userTitleId = userTitleId;
     }
-public String getQaId() {
+
+    public String getQaId() {
         return qaId;
     }
-public void setQaId(String qaId) {
+
+    public void setQaId(String qaId) {
         this.qaId = qaId;
     }
 
@@ -115,4 +143,52 @@ public void setQaId(String qaId) {
     public void setStatusCd(String statusCd) {
         this.statusCd = statusCd;
     }
+
+    public String getQaTypeName() {
+        return qaTypeName;
+    }
+
+    public void setQaTypeName(String qaTypeName) {
+        this.qaTypeName = qaTypeName;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getQaName() {
+        return qaName;
+    }
+
+    public void setQaName(String qaName) {
+        this.qaName = qaName;
+    }
+
+    public String getQaTitle() {
+        return qaTitle;
+    }
+
+    public void setQaTitle(String qaTitle) {
+        this.qaTitle = qaTitle;
+    }
+
+    public String getQaValue() {
+        return qaValue;
+    }
+
+    public void setQaValue(String qaValue) {
+        this.qaValue = qaValue;
+    }
+
+    public String getQaType() {
+        return qaType;
+    }
+
+    public void setQaType(String qaType) {
+        this.qaType = qaType;
+    }
 }

+ 110 - 0
java110-db/src/main/resources/mapper/report/ReportUserQuestionAnswerValueServiceDaoImplMapper.xml

@@ -0,0 +1,110 @@
+<?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="reportUserQuestionAnswerValueServiceDaoImpl">
+
+    <!-- 查询欠费统计信息 add by wuxw 2018-07-03 -->
+    <select id="getUserQuestionAnswerValueInfo" parameterType="Map" resultType="Map">
+        select uu.`name` userName,qa.qa_name qaName,uat.qa_title qaTitle,qatv.qa_value qaValue,t.value_content valueContent,
+        t.create_time createTime,qa.qa_type qaType,td.`name` qaTypeName
+        from user_question_answer_value t
+        left join question_answer_title uat on t.title_id = uat.title_id and uat.status_cd = '0'
+        left join question_answer qa on uat.qa_id = qa.qa_id and qa.status_cd = '0'
+        left join u_user uu on t.person_id = uu.user_id and uu.status_cd = '0'
+        left join question_answer_title_value qatv on t.value_id = qatv.value_id and qatv.status_cd = '0'
+        left join t_dict td on qa.qa_type = td.status_cd and td.table_name = 'question_answer' and td.table_columns = 'qa_type'
+        where 1=1
+        <if test="score !=null and score != ''">
+            and t.score= #{score}
+        </if>
+        <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="answerType !=null and answerType != ''">
+            and t.answer_type= #{answerType}
+        </if>
+        <if test="objId !=null and objId != ''">
+            and t.obj_id= #{objId}
+        </if>
+        <if test="userQaId !=null and userQaId != ''">
+            and t.user_qa_id= #{userQaId}
+        </if>
+        <if test="valueContent !=null and valueContent != ''">
+            and t.value_content= #{valueContent}
+        </if>
+        <if test="personId !=null and personId != ''">
+            and t.person_id= #{personId}
+        </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="userTitleId !=null and userTitleId != ''">
+            and t.user_title_id= #{userTitleId}
+        </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 -->
+    <select id="queryUserQuestionAnswerValuesCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from user_question_answer_value t
+        left join question_answer_title uat on t.title_id = uat.title_id and uat.status_cd = '0'
+        left join question_answer qa on uat.qa_id = qa.qa_id and qa.status_cd = '0'
+        left join u_user uu on t.person_id = uu.user_id and uu.status_cd = '0'
+        left join question_answer_title_value qatv on t.value_id = qatv.value_id and qatv.status_cd = '0'
+        left join t_dict td on qa.qa_type = td.status_cd and td.table_name = 'question_answer' and td.table_columns = 'qa_type'
+        where 1=1
+        <if test="score !=null and score != ''">
+            and t.score= #{score}
+        </if>
+        <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="answerType !=null and answerType != ''">
+            and t.answer_type= #{answerType}
+        </if>
+        <if test="objId !=null and objId != ''">
+            and t.obj_id= #{objId}
+        </if>
+        <if test="userQaId !=null and userQaId != ''">
+            and t.user_qa_id= #{userQaId}
+        </if>
+        <if test="valueContent !=null and valueContent != ''">
+            and t.value_content= #{valueContent}
+        </if>
+        <if test="personId !=null and personId != ''">
+            and t.person_id= #{personId}
+        </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="userTitleId !=null and userTitleId != ''">
+            and t.user_title_id= #{userTitleId}
+        </if>
+        <if test="qaId !=null and qaId != ''">
+            and t.qa_id= #{qaId}
+        </if>
+    </select>
+
+</mapper>

+ 43 - 0
java110-interface/src/main/java/com/java110/intf/report/IReportUserQuestionAnswerValueInnerServiceSMO.java

@@ -0,0 +1,43 @@
+package com.java110.intf.report;
+
+import com.java110.config.feign.FeignConfiguration;
+import com.java110.dto.userQuestionAnswerValue.UserQuestionAnswerValueDto;
+import com.java110.po.userQuestionAnswerValue.UserQuestionAnswerValuePo;
+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 IUserQuestionAnswerValueInnerServiceSMO
+ * @Description 答卷答案接口类
+ * @Author wuxw
+ * @Date 2019/4/24 9:04
+ * @Version 1.0
+ * add by wuxw 2019/4/24
+ **/
+@FeignClient(name = "report-service", configuration = {FeignConfiguration.class})
+@RequestMapping("/reportUserQuestionAnswerValueApi")
+public interface IReportUserQuestionAnswerValueInnerServiceSMO {
+
+    /**
+     * <p>查询小区楼信息</p>
+     *
+     *
+     * @param userQuestionAnswerValueDto 数据对象分享
+     * @return UserQuestionAnswerValueDto 对象数据
+     */
+    @RequestMapping(value = "/queryUserQuestionAnswerValues", method = RequestMethod.POST)
+    List<UserQuestionAnswerValueDto> queryUserQuestionAnswerValues(@RequestBody UserQuestionAnswerValueDto userQuestionAnswerValueDto);
+
+    /**
+     * 查询<p>小区楼</p>总记录数
+     *
+     * @param userQuestionAnswerValueDto 数据对象分享
+     * @return 小区下的小区楼记录数
+     */
+    @RequestMapping(value = "/queryUserQuestionAnswerValuesCount", method = RequestMethod.POST)
+    int queryUserQuestionAnswerValuesCount(@RequestBody UserQuestionAnswerValueDto userQuestionAnswerValueDto);
+}

+ 50 - 0
service-report/src/main/java/com/java110/report/api/ReportQuestionAnswerApi.java

@@ -0,0 +1,50 @@
+package com.java110.report.api;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.dto.reportOweFee.ReportOweFeeDto;
+import com.java110.dto.userQuestionAnswerValue.UserQuestionAnswerValueDto;
+import com.java110.po.reportOweFee.ReportOweFeePo;
+import com.java110.report.bmo.reportOweFee.IDeleteReportOweFeeBMO;
+import com.java110.report.bmo.reportOweFee.IGetReportOweFeeBMO;
+import com.java110.report.bmo.reportOweFee.ISaveReportOweFeeBMO;
+import com.java110.report.bmo.reportOweFee.IUpdateReportOweFeeBMO;
+import com.java110.report.bmo.reportQuestionAnswer.IGetReportQuestionAnswerBMO;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.utils.util.StringUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 问卷投票 接口类
+ */
+@RestController
+@RequestMapping(value = "/reportQuestionAnswer")
+public class ReportQuestionAnswerApi {
+
+
+    @Autowired
+    private IGetReportQuestionAnswerBMO getReportQuestionAnswerBMOImpl;
+
+
+
+    /**
+     * 微信删除消息模板
+     *
+     * @param communityId 小区ID
+     * @return
+     * @serviceCode /reportQuestionAnswer/queryUserQuestionAnswerValue
+     * @path /app/reportQuestionAnswer/queryUserQuestionAnswerValue
+     */
+    @RequestMapping(value = "/queryUserQuestionAnswerValue", method = RequestMethod.GET)
+    public ResponseEntity<String> queryUserQuestionAnswerValue(@RequestParam(value = "communityId") String communityId,
+                                                               @RequestParam(value = "page") int page,
+                                                               @RequestParam(value = "row") int row) {
+        UserQuestionAnswerValueDto userQuestionAnswerValueDto = new UserQuestionAnswerValueDto();
+        userQuestionAnswerValueDto.setPage(page);
+        userQuestionAnswerValueDto.setRow(row);
+        userQuestionAnswerValueDto.setObjId(communityId);
+        return getReportQuestionAnswerBMOImpl.get(userQuestionAnswerValueDto);
+    }
+}

+ 17 - 0
service-report/src/main/java/com/java110/report/bmo/reportQuestionAnswer/IGetReportQuestionAnswerBMO.java

@@ -0,0 +1,17 @@
+package com.java110.report.bmo.reportQuestionAnswer;
+import com.java110.dto.reportOweFee.ReportOweFeeDto;
+import com.java110.dto.userQuestionAnswerValue.UserQuestionAnswerValueDto;
+import org.springframework.http.ResponseEntity;
+
+public interface IGetReportQuestionAnswerBMO {
+
+
+    /**
+     * 查询投票明细
+     * add by wuxw
+     * @param  userQuestionAnswerValueDto
+     * @return
+     */
+    ResponseEntity<String> get(UserQuestionAnswerValueDto userQuestionAnswerValueDto);
+
+}

+ 61 - 0
service-report/src/main/java/com/java110/report/bmo/reportQuestionAnswer/impl/GetReportQuestionAnswerBMOImpl.java

@@ -0,0 +1,61 @@
+package com.java110.report.bmo.reportQuestionAnswer.impl;
+
+import com.java110.dto.userQuestionAnswerValue.UserQuestionAnswerValueDto;
+import com.java110.intf.report.IReportUserQuestionAnswerValueInnerServiceSMO;
+import com.java110.report.bmo.reportQuestionAnswer.IGetReportQuestionAnswerBMO;
+import com.java110.utils.util.StringUtil;
+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("getReportQuestionAnswerBMOImpl")
+public class GetReportQuestionAnswerBMOImpl implements IGetReportQuestionAnswerBMO {
+
+    @Autowired
+    private IReportUserQuestionAnswerValueInnerServiceSMO reportUserQuestionAnswerValueInnerServiceSMOImpl;
+
+
+    /**
+     * @param userQuestionAnswerValueDto
+     * @return 订单服务能够接受的报文
+     */
+    public ResponseEntity<String> get(UserQuestionAnswerValueDto userQuestionAnswerValueDto) {
+
+
+        int count = reportUserQuestionAnswerValueInnerServiceSMOImpl.queryUserQuestionAnswerValuesCount(userQuestionAnswerValueDto);
+
+        List<UserQuestionAnswerValueDto> userQuestionAnswerValueDtos = null;
+        if (count > 0) {
+            userQuestionAnswerValueDtos = reportUserQuestionAnswerValueInnerServiceSMOImpl.queryUserQuestionAnswerValues(userQuestionAnswerValueDto);
+
+            refreshQuestionAnswerValue(userQuestionAnswerValueDtos);
+        } else {
+            userQuestionAnswerValueDtos = new ArrayList<>();
+        }
+
+        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) userQuestionAnswerValueDto.getRow()), count, userQuestionAnswerValueDtos);
+
+        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
+
+        return responseEntity;
+    }
+
+    private void refreshQuestionAnswerValue(List<UserQuestionAnswerValueDto> userQuestionAnswerValueDtos) {
+
+        if (userQuestionAnswerValueDtos == null || userQuestionAnswerValueDtos.size() < 1) {
+            return;
+        }
+
+        for (UserQuestionAnswerValueDto userQuestionAnswerValueDto : userQuestionAnswerValueDtos) {
+            if (StringUtil.isEmpty(userQuestionAnswerValueDto.getQaValue())) {
+                userQuestionAnswerValueDto.setQaValue(userQuestionAnswerValueDto.getValueContent());
+            }
+        }
+    }
+
+}

+ 40 - 0
service-report/src/main/java/com/java110/report/dao/IReportUserQuestionAnswerValueServiceDao.java

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

+ 68 - 0
service-report/src/main/java/com/java110/report/dao/impl/ReportUserQuestionAnswerValueServiceDaoImpl.java

@@ -0,0 +1,68 @@
+package com.java110.report.dao.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.base.dao.BaseServiceDao;
+import com.java110.report.dao.IReportOweFeeServiceDao;
+import com.java110.report.dao.IReportUserQuestionAnswerValueServiceDao;
+import com.java110.utils.constant.ResponseConstant;
+import com.java110.utils.exception.DAOException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 欠费统计服务 与数据库交互
+ * Created by wuxw on 2017/4/5.
+ */
+@Service("reportUserQuestionAnswerValueServiceDaoImpl")
+//@Transactional
+public class ReportUserQuestionAnswerValueServiceDaoImpl extends BaseServiceDao implements IReportUserQuestionAnswerValueServiceDao {
+
+    private static Logger logger = LoggerFactory.getLogger(ReportUserQuestionAnswerValueServiceDaoImpl.class);
+
+
+
+
+
+
+    /**
+     * 查询欠费统计信息(instance)
+     * @param info bId 信息
+     * @return List<Map>
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public List<Map> getUserQuestionAnswerValueInfo(Map info) throws DAOException {
+        logger.debug("查询欠费统计信息 入参 info : {}",info);
+
+        List<Map> businessReportOweFeeInfos = sqlSessionTemplate.selectList("reportUserQuestionAnswerValueServiceDaoImpl.getUserQuestionAnswerValueInfo",info);
+
+        return businessReportOweFeeInfos;
+    }
+
+
+
+     /**
+     * 查询欠费统计数量
+     * @param info 欠费统计信息
+     * @return 欠费统计数量
+     */
+    @Override
+    public int queryUserQuestionAnswerValuesCount(Map info) {
+        logger.debug("查询欠费统计数据 入参 info : {}",info);
+
+        List<Map> businessReportOweFeeInfos = sqlSessionTemplate.selectList("reportUserQuestionAnswerValueServiceDaoImpl.queryUserQuestionAnswerValuesCount", info);
+        if (businessReportOweFeeInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessReportOweFeeInfos.get(0).get("count").toString());
+    }
+
+
+
+
+}

+ 53 - 0
service-report/src/main/java/com/java110/report/smo/impl/ReportUserQuestionAnswerValueInnerServiceSMOImpl.java

@@ -0,0 +1,53 @@
+package com.java110.report.smo.impl;
+
+
+import com.java110.core.base.smo.BaseServiceSMO;
+import com.java110.dto.PageDto;
+import com.java110.dto.userQuestionAnswerValue.UserQuestionAnswerValueDto;
+import com.java110.intf.report.IReportUserQuestionAnswerValueInnerServiceSMO;
+import com.java110.report.dao.IReportUserQuestionAnswerValueServiceDao;
+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 ReportUserQuestionAnswerValueInnerServiceSMOImpl extends BaseServiceSMO implements IReportUserQuestionAnswerValueInnerServiceSMO {
+
+    @Autowired
+    private IReportUserQuestionAnswerValueServiceDao reportUserQuestionAnswerValueServiceDaoImpl;
+
+
+    @Override
+    public List<UserQuestionAnswerValueDto> queryUserQuestionAnswerValues(@RequestBody UserQuestionAnswerValueDto userQuestionAnswerValueDto) {
+
+        //校验是否传了 分页信息
+
+        int page = userQuestionAnswerValueDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            userQuestionAnswerValueDto.setPage((page - 1) * userQuestionAnswerValueDto.getRow());
+        }
+
+        List<UserQuestionAnswerValueDto> userQuestionAnswerValues = BeanConvertUtil.covertBeanList(reportUserQuestionAnswerValueServiceDaoImpl.getUserQuestionAnswerValueInfo(BeanConvertUtil.beanCovertMap(userQuestionAnswerValueDto)), UserQuestionAnswerValueDto.class);
+
+        return userQuestionAnswerValues;
+    }
+
+
+    @Override
+    public int queryUserQuestionAnswerValuesCount(@RequestBody UserQuestionAnswerValueDto userQuestionAnswerValueDto) {
+        return reportUserQuestionAnswerValueServiceDaoImpl.queryUserQuestionAnswerValuesCount(BeanConvertUtil.beanCovertMap(userQuestionAnswerValueDto));
+    }
+
+}