huanghongfa
2021-09-06 993956917c04f3f97e69df049a9427be4f67add3
bug修复
7个文件已修改
171 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/neighbor/AddComActNeighborCircleAppDTO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActQuestnaireAnswerContentVO.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ComActReserveApi.java 137 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActMicroWishDAO.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActNeighborCircleServiceImpl.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActMicroWishOperationRecordMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActNeighborCircleDOMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/neighbor/AddComActNeighborCircleAppDTO.java
@@ -37,6 +37,9 @@
    @ApiModelProperty(value = "微信审核结果(1.通过 2.拒绝)",hidden = true)
    private Integer wxExamineResult;
    @ApiModelProperty("用户新增邻里圈话题")
    private String topicName;
    /**
     * 是否需要审核(1.是 2.否)
     */
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActQuestnaireAnswerContentVO.java
@@ -31,6 +31,8 @@
    private Long selectionId;
    @ApiModelProperty("答题记录id")
    private Long reserveRecordId;
    @ApiModelProperty("题目id")
    private Long reserveSubId;
    @ApiModelProperty("填报时间")
    private Date time;
    @ApiModelProperty("用户昵称")
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ComActReserveApi.java
@@ -24,6 +24,7 @@
import com.panzhihua.common.service.user.UserService;
import com.panzhihua.common.utlis.DateUtils;
import com.panzhihua.common.utlis.SFTPUtil;
import com.panzhihua.common.utlis.StringUtils;
import com.panzhihua.community_backstage.config.SFTPConfig;
import com.panzhihua.community_backstage.excel.CustomSheetWriteHandler;
import io.swagger.annotations.Api;
@@ -161,7 +162,7 @@
            List<ComActReserveMakeRightStatisticsAdminVO> rightStatisticsList = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ComActReserveMakeRightStatisticsAdminVO.class);
            rightStatisticsList.forEach(rightStatistics -> {
                ComActReserveMakeRightExcelAdminVO makeRightExcelAdminVO = new ComActReserveMakeRightExcelAdminVO();
                BeanUtils.copyProperties(rightStatistics,makeRightExcelAdminVO);
                BeanUtils.copyProperties(rightStatistics, makeRightExcelAdminVO);
                resultList.add(makeRightExcelAdminVO);
            });
            try {
@@ -244,7 +245,7 @@
            List<ComActReserveMakeListAdminVO> rightStatisticsList = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ComActReserveMakeListAdminVO.class);
            rightStatisticsList.forEach(rightStatistics -> {
                ComActReserveMakeDetailedExcelAdminVO makeRightExcelAdminVO = new ComActReserveMakeDetailedExcelAdminVO();
                BeanUtils.copyProperties(rightStatistics,makeRightExcelAdminVO);
                BeanUtils.copyProperties(rightStatistics, makeRightExcelAdminVO);
                resultList.add(makeRightExcelAdminVO);
            });
            try {
@@ -320,7 +321,7 @@
            List<ComActReserveRegisterStatisticsAdminVO> rightStatisticsList = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ComActReserveRegisterStatisticsAdminVO.class);
            rightStatisticsList.forEach(rightStatistics -> {
                ComActReserveRegisterExcelAdminVO makeRightExcelAdminVO = new ComActReserveRegisterExcelAdminVO();
                BeanUtils.copyProperties(rightStatistics,makeRightExcelAdminVO);
                BeanUtils.copyProperties(rightStatistics, makeRightExcelAdminVO);
                resultList.add(makeRightExcelAdminVO);
            });
            try {
@@ -407,7 +408,7 @@
            List<ComActReserveMakeHandleListAdminVO> rightStatisticsList = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ComActReserveMakeHandleListAdminVO.class);
            rightStatisticsList.forEach(rightStatistics -> {
                ComActReserveMakeHandleExcelAdminVO makeRightExcelAdminVO = new ComActReserveMakeHandleExcelAdminVO();
                BeanUtils.copyProperties(rightStatistics,makeRightExcelAdminVO);
                BeanUtils.copyProperties(rightStatistics, makeRightExcelAdminVO);
                makeRightExcelAdminVO.setStatus(ReserveRecordStatusEnum.getCnDescByName(rightStatistics.getStatus()));
                resultList.add(makeRightExcelAdminVO);
            });
@@ -492,59 +493,14 @@
                    head1.add("登记时间");
                    headList.add(head1);
                    subVOList.forEach(sub -> {
                        if(sub.getType() != 5){
                        if (sub.getType() != 5) {
                            List<String> headn = new ArrayList<>();
                            headn.add(firstRowContent);
                            headn.add(sub.getContent());
                            headList.add(headn);
                        }
                    });
                    List<List<Object>> datalist = new ArrayList<>();
                    List<ComActQuestnaireAnswerContentVO> answerContentVOList = questnaireAnswersDTOS.getAnswers();
                    if(answerContentVOList!=null && answerContentVOList.size()>0) {
                        List<Object> userData = new ArrayList<>();
                        List<ComActQuestnaireAnswerContentVO> usersAnswers = questnaireAnswersDTOS.getAnswers();
                        //查询用户回答的所有答案,并新增到答案列表中
                        Long reserveRecordId = null;
                        StringBuffer sb = new StringBuffer();
                        Boolean isDX = false;
                        for (ComActQuestnaireAnswerContentVO userAnswers:usersAnswers) {
                            if (userAnswers.getOptionType().equals(5)){
                                continue;
                            }
                            if(reserveRecordId == null){
                                reserveRecordId = userAnswers.getReserveRecordId();
                                userData.add(userAnswers.getNickName());
                                userData.add(DateUtils.format(userAnswers.getTime(),DateUtils.ymdhms_format));
                            }
                            if(!reserveRecordId.equals(userAnswers.getReserveRecordId())){
                                if(isDX){
                                    String answer = sb.toString();
                                    userData.add(answer.substring(0,answer.length()-1));
                                    sb = new StringBuffer();
                                    isDX = false;
                                }
                                datalist.add(userData);
                                userData = new ArrayList<>();
                                reserveRecordId = userAnswers.getReserveRecordId();
                                userData.add(userAnswers.getNickName());
                                userData.add(DateUtils.format(userAnswers.getTime(),DateUtils.ymdhms_format));
                            }
                            //判断是否是多选框
                            if(userAnswers.getOptionType().equals(1)){
                                isDX = true;
                                sb.append(userAnswers.getAnswerContent() + ",");
                                continue;
                            }
                            userData.add(userAnswers.getAnswerContent());
                        }
                        if(isDX){
                            String answer = sb.toString();
                            userData.add(answer.substring(0,answer.length()-1));
                        }
                        datalist.add(userData);
                    }
                    List<List<Object>> datalist = dataList(questnaireAnswersDTOS.getAnswers());
                    WriteCellStyle headWriteCellStyle = new WriteCellStyle();
                    WriteCellStyle contentWriteCellStyle = new WriteCellStyle();
@@ -587,22 +543,95 @@
        }
    }
    @ApiOperation(value = "查询题目列表",response = ComActReserveSubListVO.class)
    @ApiOperation(value = "查询题目列表", response = ComActReserveSubListVO.class)
    @GetMapping("/subject/list")
    public R subjectList(@RequestParam("reserveId") Long reserveId) {
        return communityService.subjectListAdmin(reserveId);
    }
    @ApiOperation(value = "分页查询登记明细列表",response = ComActReserveRegisterDetailedVO.class)
    @ApiOperation(value = "分页查询登记明细列表", response = ComActReserveRegisterDetailedVO.class)
    @PostMapping("/register/detailed/list")
    public R registerDetailedList(@RequestBody PageReserveRegisterDetailedAdminDTO detailedAdminDTO) {
        return communityService.registerDetailedListAdmin(detailedAdminDTO);
    }
    @ApiOperation(value = "查询登记明细详情",response = ComActReserveRegisterDetailedVO.class)
    @ApiOperation(value = "查询登记明细详情", response = ComActReserveRegisterDetailedVO.class)
    @PostMapping("/register/detailed/detail")
    public R registerDetailedDetail(@RequestParam("reserveRecordId") Long reserveRecordId) {
        return communityService.registerDetailedDetailAdmin(reserveRecordId);
    }
    /**
     * 数据转换--登记明细用户填写答案导出数据格式转换
     *
     * @param answerContentVOList 用户答题记录
     * @return 用户填写答案数据
     */
    private List<List<Object>> dataList(List<ComActQuestnaireAnswerContentVO> answerContentVOList) {
        //结果数据集合
        List<List<Object>> resultList = new ArrayList<>();
        //构建单个用户数据
        List<Object> userData = new ArrayList<>();
        //遍历答案列表
        Long reserveRecordId = 0L;
        Long reserveSubId = 0L;
        StringBuffer sb = new StringBuffer();
        if (answerContentVOList != null && answerContentVOList.size() > 0) {
            for (ComActQuestnaireAnswerContentVO userAnswers : answerContentVOList) {
                //判断是文字描述直接跳过
                if (userAnswers.getOptionType().equals(5)) {
                    continue;
                }
                //判断reserveRecordId为空则为第一条记录,默认加上昵称和灯谜是
                if (reserveRecordId.equals(0L)) {
                    reserveRecordId = userAnswers.getReserveRecordId();
                    userData.add(userAnswers.getNickName());
                    userData.add(DateUtils.format(userAnswers.getTime(), DateUtils.ymdhms_format));
                }
                //根据reserveRecordId判断是否是第二条填报记录
                if (!reserveRecordId.equals(userAnswers.getReserveRecordId())) {
                    reserveSubId = 0L;
                    String answer = sb.toString();
                    userData.add(answer.substring(0, answer.length() - 1));
                    sb = new StringBuffer();
                    resultList.add(userData);
                    userData = new ArrayList<>();
                    reserveRecordId = userAnswers.getReserveRecordId();
                    userData.add(userAnswers.getNickName());
                    userData.add(DateUtils.format(userAnswers.getTime(), DateUtils.ymdhms_format));
                    answer = sb.toString();
                    if(StringUtils.isEmpty(answer)){
                        userData.add(userAnswers.getAnswerContent());
                    }
                }else{
                    if(reserveSubId.equals(0L)){
                        reserveSubId = userAnswers.getReserveSubId();
                    }
                    if(!reserveSubId.equals(userAnswers.getReserveSubId())){
                        reserveSubId = userAnswers.getReserveSubId();
                        String answer = sb.toString();
                        if(StringUtils.isEmpty(answer)){
                            sb.append(userAnswers.getAnswerContent() + ",");
                            answer = sb.toString();
                        }
                        userData.add(answer.substring(0, answer.length() - 1));
                        sb = new StringBuffer();
                        sb.append(userAnswers.getAnswerContent() + ",");
                    }else{
                        sb.append(userAnswers.getAnswerContent() + ",");
                    }
                }
            }
            String answer = sb.toString();
            if(StringUtils.isNotEmpty(answer)){
                userData.add(answer.substring(0, answer.length() - 1));
            }
            resultList.add(userData);
        }
        return resultList;
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActMicroWishDAO.java
@@ -75,7 +75,7 @@
            "AND w.`status` = #{comActMicroWishVO.status}  " +
            " </if> " +
            "<if test='comActMicroWishVO.status == 3  and comActMicroWishVO.isPageMyWish==null'>" +
            "AND w.`status` = 3 " +
            "AND w.`status` in (2,3) " +
            " </if> " +
            "<if test='comActMicroWishVO.status != null and comActMicroWishVO.status!=0 and comActMicroWishVO.isPageMyWish!=null and comActMicroWishVO.status==1'>" +
            "AND w.`status` =1  " +
@@ -121,6 +121,7 @@
            "su.`name` responsible_name, " +
            "w.form, " +
            "w.reject_reason, " +
            "w.community_id, " +
            "w.examine_at, " +
            "w.finish, " +
            "w.finish_photo_path_list, " +
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActNeighborCircleServiceImpl.java
@@ -6,6 +6,7 @@
import javax.annotation.Resource;
import com.panzhihua.service_community.service.ComActNeighborCircleTopicService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -61,6 +62,8 @@
    private ComActDAO comActDAO;
    @Resource
    private ComActNeighborCircleTopicMapper comActNeighborCircleTopicMapper;
    @Resource
    private ComActNeighborCircleTopicService comActNeighborCircleTopicService;
    /**
     * 分页查询邻里圈列表
@@ -139,6 +142,25 @@
                neighborCircleDO.setRefuseReason("内容违规");
            }
        }
        //判断用户的话题是否是新增的
        if(StringUtils.isNotEmpty(addNeighborCircleAppDTO.getTopicName())){
            //新增邻里圈话题
            ComActNeighborCircleTopicDO circleTopicDO = comActNeighborCircleTopicMapper.selectOne(new QueryWrapper<ComActNeighborCircleTopicDO>()
                    .lambda().eq(ComActNeighborCircleTopicDO::getCommunityId,neighborCircleDO.getCommunityId())
                    .eq(ComActNeighborCircleTopicDO::getName,addNeighborCircleAppDTO.getTopicName()));
            if(circleTopicDO == null){
                circleTopicDO = new ComActNeighborCircleTopicDO();
                circleTopicDO.setCommunityId(neighborCircleDO.getCommunityId());
                circleTopicDO.setName(addNeighborCircleAppDTO.getTopicName());
                circleTopicDO.setCreateBy(neighborCircleDO.getReleaseId());
                circleTopicDO.setCreateAt(new Date());
                circleTopicDO.setCount(1);
                circleTopicDO.setHotNum(0L);
                circleTopicDO.setStatus(ComActNeighborCircleTopicDO.status.yes);
                comActNeighborCircleTopicMapper.insert(circleTopicDO);
            }
            neighborCircleDO.setTopicId(circleTopicDO.getId());
        }
        if(this.baseMapper.insert(neighborCircleDO) > 0){
            return R.ok();
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActMicroWishOperationRecordMapper.xml
@@ -24,7 +24,7 @@
    <select id="selectId" resultType="Long">
        select id from com_act_micro_wish
        <where>
            1=1
            1=1 and community_id = #{communityId}
            <if test="status !=null">
                and status=#{status}
            </if>
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActNeighborCircleDOMapper.xml
@@ -100,7 +100,7 @@
        LEFT JOIN sys_user u ON nc.release_id = u.user_id
        LEFT JOIN com_act_neighbor_circle_topic as canct ON canct.id = nc.topic_id
        <where>
            nc.community_id = #{neighborCircleAdminDTO.communityId}
            nc.community_id = #{neighborCircleAdminDTO.communityId} and is_del = 2
            <if test='neighborCircleAdminDTO.releaseContent != null and neighborCircleAdminDTO.releaseContent != &quot;&quot;'>
                and nc.release_content like concat('%',#{neighborCircleAdminDTO.releaseContent},'%')
            </if>