罗元桥
2021-09-27 faae303cd25f90b1c732b6bc737ede8b8ab714a0
Merge branch 'test' into 'test_bak'

Test

See merge request root/zhihuishequ!203
31个文件已修改
3个文件已添加
674 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/applets_backstage/src/main/java/com/panzhihua/applets_backstage/api/CommunityConvenientApi.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/FtpConfig.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/reserve/ComActReserveMakeDetailAdminVO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/reserve/ComActReserveMakeDetailedExcelAdminVO.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/reserve/ComActReserveMakeHandleExcelAdminVO.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/reserve/ComActReserveMakeHandleListAdminVO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/reserve/ComActReserveMakeListAdminVO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/AssemblyUtils.java 130 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/ExcelUtils.java 79 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ComActReserveApi.java 122 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/CommonDataApi.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/CommunityQuestnaireApi.java 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommonDataApi.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ConvenientApi.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ConvenientConsultationStatisticsDAO.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ConvenientViewStatisticsDAO.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComMngPopulationCommunityTagsDO.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComMngPopulationDO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ConvenientProductDO.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComMngPopulationService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComClusterOrganizationServiceImpl.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComPensionAuthRecordServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientMerchantServiceImpl.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientProductServiceImpl.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActQuestnaireDOMapper.xml 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActReserveRecordMapper.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientConsultationStatisticsMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientProductMapper.xml 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientViewStatisticsMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventServiceImpl.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/RoleServiceImpl.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/applets_backstage/src/main/java/com/panzhihua/applets_backstage/api/CommunityConvenientApi.java
@@ -2,6 +2,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.time.Instant;
import java.util.UUID;
import javax.annotation.Resource;
@@ -306,6 +307,7 @@
    @ApiOperation(value = "新增便民服务商家")
    @PostMapping("/merchant/add")
    public R addMerchant(@RequestBody @Validated(AddGroup.class) ConvenientMerchantDTO convenientMerchantDTO) {
        log.error("catTimeStamp进入appletsbackstage", Instant.now().toEpochMilli());
        convenientMerchantDTO.setCreatedBy(this.getUserId());
        return communityService.addMerchant(convenientMerchantDTO);
    }
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/FtpConfig.java
New file
@@ -0,0 +1,20 @@
package com.panzhihua.common.model.dtos;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
/**
 * @author lyq
 *  ftp配置信息传递类
 */
@Data
public class FtpConfig {
    private String userName;
    private String password;
    private String host;
    private int port;
    private String url;
    private String excelUrl;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/reserve/ComActReserveMakeDetailAdminVO.java
@@ -41,4 +41,7 @@
    @ApiModelProperty("操作记录")
    private List<ComActReserveMakeOperationAdminVO> operationList;
    @ApiModelProperty("处理人/备注人")
    private String handleName;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/reserve/ComActReserveMakeDetailedExcelAdminVO.java
@@ -25,8 +25,8 @@
    private Date reserveTime;
    @ExcelProperty(value = "预约内容" ,index = 4)
    private String content;
    @ExcelProperty(value = "备注" ,index = 5)
    private String remark;
    @ExcelProperty(value = "备注人" ,index = 5)
    private String handleName;
    @ExcelProperty(value = "社区备注" ,index = 6)
    private String actRemark;
    @ExcelProperty(value = "提交时间" ,index = 7)
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/reserve/ComActReserveMakeHandleExcelAdminVO.java
@@ -31,8 +31,8 @@
    @ExcelProperty(value = "预约内容" ,index = 5)
    private String content;
    @ExcelProperty(value = "备注" ,index = 6)
    private String remark;
    @ExcelProperty(value = "备注人" ,index = 6)
    private String handleName;
    @ExcelProperty(value = "社区备注" ,index = 7)
    private String actRemark;
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/reserve/ComActReserveMakeHandleListAdminVO.java
@@ -46,4 +46,7 @@
    @ApiModelProperty("预约登记主题")
    private String title;
    @ApiModelProperty("处理人/备注人")
    private String handleName;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/reserve/ComActReserveMakeListAdminVO.java
@@ -40,4 +40,7 @@
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createAt;
    @ApiModelProperty("处理人/备注人")
    private String handleName;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -3154,7 +3154,7 @@
     * @return 删除结果
     */
    @PostMapping("common/data/special/delete")
    R deleteSpecialInputUser(@RequestParam(value = "id") Long id);
    R deleteSpecialInputUser(@RequestParam(value = "id") Long id,@RequestParam("communityId") Long communityId);
    /**
     * 办事指南_新增
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/AssemblyUtils.java
New file
@@ -0,0 +1,130 @@
package com.panzhihua.common.utlis;
import com.panzhihua.common.model.vos.community.ComActQuestnaireAnswerContentVO;
import lombok.extern.slf4j.Slf4j;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
/**
 * @author lyq
 *  前端H5组件库工具类
 */
@Slf4j
public class AssemblyUtils {
    /**
     * 数据转换--登记明细用户填写答案导出数据格式转换
     *
     * @param answerContentVOList 用户答题记录
     * @return 用户填写答案数据
     */
    public static List<List<Object>> ReserveData(List<ComActQuestnaireAnswerContentVO> answerContentVOList) {
        //结果数据集合
        List<List<Object>> resultList = new ArrayList<>();
        //构建单个用户数据
        List<Object> userData = new ArrayList<>();
        //遍历答案列表
        Long reserveRecordId = 0L;
        Long reserveSubId = 0L;
        Boolean isOldDuo = false;
        StringBuffer sb = new StringBuffer();
        if (answerContentVOList != null && answerContentVOList.size() > 0) {
            for (ComActQuestnaireAnswerContentVO userAnswers : answerContentVOList) {
                //判断是文字描述直接跳过
                if (userAnswers.getOptionType().equals(5) || userAnswers.getOptionType().equals(11)) {
                    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;
                    if(isOldDuo){
                        String answer = sb.toString();
                        userData.add(answer.substring(0, answer.length() - 1));
                        sb = new StringBuffer();
                        isOldDuo = false;
                    }
                    resultList.add(userData);
                    userData = new ArrayList<>();
                    reserveRecordId = userAnswers.getReserveRecordId();
                    userData.add(userAnswers.getNickName());
                    userData.add(DateUtils.format(userAnswers.getTime(), DateUtils.ymdhms_format));
                    if(StringUtils.isNotEmpty(userAnswers.getAnswerContent())){
                        userData.add(userAnswers.getAnswerContent());
                    }else{
                        userData.add(" ");
                    }
                }else{
                    if(reserveSubId.equals(0L)){
                        reserveSubId = userAnswers.getReserveSubId();
                    }
                    if(!reserveSubId.equals(userAnswers.getReserveSubId())){
                        reserveSubId = userAnswers.getReserveSubId();
                        //判断当前的组件类型是否是图片上传,导出时需要导出图片
                        if(userAnswers.getOptionType().equals(11)){
                            reserveSubId = userAnswers.getReserveSubId();
                            try {
                                userData.add(new URL(userAnswers.getAnswerContent()));
                            }catch (Exception e){
                                userData.add(" ");
                                log.error("导出转换图片失败!");
                            }
                            continue;
                        }
                        if(userAnswers.getOptionType().equals(1)){
                            isOldDuo = true;
                            sb.append(userAnswers.getAnswerContent()==null?"无":userAnswers.getAnswerContent() + ",");
                            continue;
                        }else{
                            isOldDuo = false;
                        }
                        sb.append(userAnswers.getAnswerContent()==null?"无":userAnswers.getAnswerContent() + ",");
                        String answer = sb.toString();
                        userData.add(answer.substring(0, answer.length() - 1));
                        sb = new StringBuffer();
                    }else{
                        //判断当前的组件类型是否是图片上传,导出时需要导出图片
                        if(userAnswers.getOptionType().equals(11)){
                            reserveSubId = userAnswers.getReserveSubId();
                            try {
                                userData.add(new URL(userAnswers.getAnswerContent()));
                            }catch (Exception e){
                                userData.add(" ");
                                log.error("导出转换图片失败!");
                            }
                            continue;
                        }
                        if(userAnswers.getOptionType().equals(1)){
                            isOldDuo = true;
                            sb.append(userAnswers.getAnswerContent()==null?"无":userAnswers.getAnswerContent() + ",");
                            continue;
                        }else{
                            isOldDuo = false;
                        }
                        sb.append(userAnswers.getAnswerContent()==null?"无":userAnswers.getAnswerContent() + ",");
                        String answer = sb.toString();
                        userData.add(answer.substring(0, answer.length() - 1));
                        sb = new StringBuffer();
                    }
                }
            }
            if(isOldDuo){
                String answer = sb.toString();
                userData.add(answer.substring(0, answer.length() - 1));
            }
            resultList.add(userData);
        }
        return resultList;
    }
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/ExcelUtils.java
New file
@@ -0,0 +1,79 @@
package com.panzhihua.common.utlis;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.metadata.style.WriteCellStyle;
import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;
import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
import com.panzhihua.common.excel.CustomSheetWriteHandler;
import com.panzhihua.common.model.dtos.FtpConfig;
import lombok.extern.slf4j.Slf4j;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.List;
/**
 * @author lyq
 * excel工具类
 */
@Slf4j
public class ExcelUtils {
    public static String adminExport(FtpConfig config, String name, List<List<String>> headList
            , List<List<Object>> datalist, String sheetName, Object obj) {
        String ftpUrl = "/mnt/data/web/excel/";
        try {
            SFTPUtil sftp = new SFTPUtil(config.getUserName(), config.getPassword(), config.getHost(), config.getPort());
            sftp.login();
            boolean existDir = sftp.isExistDir(ftpUrl + name);
            if (!existDir) {
                String property = System.getProperty("user.dir");
                String fileName = property + File.separator + name;
                ExcelWriter excelWriter = null;
                InputStream inputStream = null;
                try {
                    WriteCellStyle headWriteCellStyle = new WriteCellStyle();
                    WriteCellStyle contentWriteCellStyle = new WriteCellStyle();
                    contentWriteCellStyle.setWrapped(true);
                    HorizontalCellStyleStrategy horizontalCellStyleStrategy =
                            new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle);
                    LongestMatchColumnWidthStyleStrategy longestMatchColumnWidthStyleStrategy = new LongestMatchColumnWidthStyleStrategy();
                    excelWriter = EasyExcel.write(fileName, Object.class)
                            .registerWriteHandler(horizontalCellStyleStrategy)
                            .registerWriteHandler(longestMatchColumnWidthStyleStrategy)
                            .registerWriteHandler(new CustomSheetWriteHandler()).build();
                    WriteSheet writeSheet = EasyExcel.writerSheet(sheetName).head(headList).build();
                    excelWriter.write(datalist, writeSheet);
                    excelWriter.finish();
                    File file = new File(fileName);
                    inputStream = new FileInputStream(file);
                    sftp.uploadMore(ftpUrl, name, inputStream);
                    sftp.logout();
                    inputStream.close();
                    String absolutePath = file.getAbsolutePath();
                    boolean delete = file.delete();
                    log.info("删除excel【{}】结果【{}】", absolutePath, delete);
                } finally {
                    // 千万别忘记finish 会帮忙关闭流
                    if (inputStream != null) {
                        inputStream.close();
                    }
                    if (excelWriter != null) {
                        excelWriter.finish();
                    }
                }
                return config.getExcelUrl() + name;
            }
        } catch (Exception e) {
            e.printStackTrace();
            log.error("文件传输失败【{}】", e.getMessage());
            return null;
        }
        return null;
    }
}
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ComActReserveApi.java
@@ -22,6 +22,7 @@
import com.panzhihua.common.model.vos.community.reserve.*;
import com.panzhihua.common.service.community.CommunityService;
import com.panzhihua.common.service.user.UserService;
import com.panzhihua.common.utlis.AssemblyUtils;
import com.panzhihua.common.utlis.DateUtils;
import com.panzhihua.common.utlis.SFTPUtil;
import com.panzhihua.common.utlis.StringUtils;
@@ -505,7 +506,8 @@
                            headList.add(headn);
                        }
                    });
                    List<List<Object>> datalist = dataList(questnaireAnswersDTOS.getAnswers());
                    //数据转换
                    List<List<Object>> datalist = AssemblyUtils.ReserveData(questnaireAnswersDTOS.getAnswers());
                    WriteCellStyle headWriteCellStyle = new WriteCellStyle();
                    WriteCellStyle contentWriteCellStyle = new WriteCellStyle();
@@ -564,124 +566,6 @@
    @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;
        Boolean isOldDuo = false;
        StringBuffer sb = new StringBuffer();
        if (answerContentVOList != null && answerContentVOList.size() > 0) {
            for (ComActQuestnaireAnswerContentVO userAnswers : answerContentVOList) {
                //判断是文字描述直接跳过
                if (userAnswers.getOptionType().equals(5) || userAnswers.getOptionType().equals(11)) {
                    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;
                    if(isOldDuo){
                        String answer = sb.toString();
                        userData.add(answer.substring(0, answer.length() - 1));
                        sb = new StringBuffer();
                        isOldDuo = false;
                    }
                    resultList.add(userData);
                    userData = new ArrayList<>();
                    reserveRecordId = userAnswers.getReserveRecordId();
                    userData.add(userAnswers.getNickName());
                    userData.add(DateUtils.format(userAnswers.getTime(), DateUtils.ymdhms_format));
                    if(StringUtils.isNotEmpty(userAnswers.getAnswerContent())){
                        userData.add(userAnswers.getAnswerContent());
                    }else{
                        userData.add(" ");
                    }
                }else{
                    if(reserveSubId.equals(0L)){
                        reserveSubId = userAnswers.getReserveSubId();
                    }
                    if(!reserveSubId.equals(userAnswers.getReserveSubId())){
                        reserveSubId = userAnswers.getReserveSubId();
                        //判断当前的组件类型是否是图片上传,导出时需要导出图片
                        if(userAnswers.getOptionType().equals(11)){
                            reserveSubId = userAnswers.getReserveSubId();
                            try {
                                userData.add(new URL(userAnswers.getAnswerContent()));
                            }catch (Exception e){
                                userData.add(" ");
                                log.error("导出转换图片失败!");
                            }
                            continue;
                        }
                        if(userAnswers.getOptionType().equals(1)){
                            isOldDuo = true;
                            sb.append(userAnswers.getAnswerContent()==null?"无":userAnswers.getAnswerContent() + ",");
                            continue;
                        }else{
                            isOldDuo = false;
                        }
                        sb.append(userAnswers.getAnswerContent()==null?"无":userAnswers.getAnswerContent() + ",");
                        String answer = sb.toString();
                        userData.add(answer.substring(0, answer.length() - 1));
                        sb = new StringBuffer();
                    }else{
                        //判断当前的组件类型是否是图片上传,导出时需要导出图片
                        if(userAnswers.getOptionType().equals(11)){
                            reserveSubId = userAnswers.getReserveSubId();
                            try {
                                userData.add(new URL(userAnswers.getAnswerContent()));
                            }catch (Exception e){
                                userData.add(" ");
                                log.error("导出转换图片失败!");
                            }
                            continue;
                        }
                        if(userAnswers.getOptionType().equals(1)){
                            isOldDuo = true;
                            sb.append(userAnswers.getAnswerContent()==null?"无":userAnswers.getAnswerContent() + ",");
                            continue;
                        }else{
                            isOldDuo = false;
                        }
                        sb.append(userAnswers.getAnswerContent()==null?"无":userAnswers.getAnswerContent() + ",");
                        String answer = sb.toString();
                        userData.add(answer.substring(0, answer.length() - 1));
                        sb = new StringBuffer();
                    }
                }
            }
//            String answer = sb.toString();
//            if(StringUtils.isNotEmpty(answer)){
//                userData.add(answer.substring(0, answer.length() - 1));
//            }
            if(isOldDuo){
                String answer = sb.toString();
                userData.add(answer.substring(0, answer.length() - 1));
            }
            resultList.add(userData);
        }
        return resultList;
    }
}
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/CommonDataApi.java
@@ -491,65 +491,10 @@
    @ApiOperation(value = "特殊群体/删除", response = InputUserInfoVO.class)
    @DeleteMapping("/special/delete")
    public R deleteSpecialInputUser(@RequestParam(value = "id") Long id) {
        return communityService.deleteSpecialInputUser(id);
        // 获取登陆用户绑定社区id
        Long communityId = this.getLoginUserInfo().getCommunityId();
        return communityService.deleteSpecialInputUser(id,communityId);
    }
    // @ApiOperation(value = "特殊群体 导出特殊群体Excel")
    // @PostMapping("/special/export")
    // public R exportSpecial(@RequestBody ExportSpecialUserDTO exportSpecialUserDTO) {
    // exportSpecialUserDTO.setCommunityId(this.getCommunityId());
    // String url = excelUrl;
    // String uuid = UUID.randomUUID().toString().replace("-", "");
    // String name = uuid + ".xlsx";
    // String ftpUrl = "/mnt/data/web/excel/";
    //// 用户搜索了就下载搜索的用户否则下载所有用户
    // R r = userService.specialUserExport(exportSpecialUserDTO);
    // if (R.isOk(r)) {
    // List<EexcelUserDTO> eexcelUserDTOS = JSONArray.parseArray(JSONArray.toJSONString(r.getData()),
    // EexcelUserDTO.class);
    // try {
    // SFTPUtil sftp = new SFTPUtil(userName, password, host, port);
    // sftp.login();
    // boolean existDir = sftp.isExistDir(ftpUrl + name);
    // if (!existDir) {
    // String property = System.getProperty("user.dir");
    // String fileName = property + File.separator + name;
    // // 这里 需要指定写用哪个class去写
    // ExcelWriter excelWriter = null;
    // InputStream inputStream = null;
    // try {
    // excelWriter = EasyExcel.write(fileName, EexcelUserDTO.class).registerWriteHandler(new
    // LongestMatchColumnWidthStyleStrategy()).registerWriteHandler(new CustomSheetWriteHandler()).build();
    // WriteSheet writeSheet = EasyExcel.writerSheet("模板").build();
    // excelWriter.write(eexcelUserDTOS, writeSheet);
    // excelWriter.finish();
    // File file = new File(fileName);
    // inputStream = new FileInputStream(file);
    // sftp.uploadMore(ftpUrl, name, inputStream);
    // sftp.logout();
    // inputStream.close();
    // String absolutePath = file.getAbsolutePath();
    // boolean delete = file.delete();
    // log.info("删除excel【{}】结果【{}】", absolutePath, delete);
    // } finally {
    // // 千万别忘记finish 会帮忙关闭流
    // if (inputStream != null) {
    // inputStream.close();
    // }
    // if (excelWriter != null) {
    // excelWriter.finish();
    // }
    // }
    // }
    // return R.ok(url + name);
    // } catch (Exception e) {
    // e.printStackTrace();
    // log.error("文件传输失败【{}】", e.getMessage());
    // return R.fail();
    // }
    // }
    // return R.fail("未查询到用户");
    // }
    @ApiOperation(value = "特殊群体-数据导出")
    @PostMapping("/special/export")
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/CommunityQuestnaireApi.java
@@ -9,6 +9,7 @@
import javax.annotation.Resource;
import com.panzhihua.common.utlis.AssemblyUtils;
import com.panzhihua.common.utlis.DateUtils;
import com.panzhihua.common.utlis.StringUtils;
import org.springframework.web.bind.annotation.*;
@@ -191,7 +192,7 @@
                        }
                        headList.add(headn);
                    });
                    List<List<Object>> datalist = dataList(questnaireAnswersDTOS.getAnswers());
                    List<List<Object>> datalist = AssemblyUtils.ReserveData(questnaireAnswersDTOS.getAnswers());
                    WriteCellStyle headWriteCellStyle = new WriteCellStyle();
                    WriteCellStyle contentWriteCellStyle = new WriteCellStyle();
@@ -308,91 +309,4 @@
        }
        return communityService.statisticsSummaryHeader(questId, loginUserInfo.getCommunityId());
    }
    /**
     * 数据转换
     * @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;
                    userData = new ArrayList<>();
                    reserveRecordId = userAnswers.getReserveRecordId();
                    userData.add(userAnswers.getNickName());
                    userData.add(DateUtils.format(userAnswers.getTime(), DateUtils.ymdhms_format));
                    if(StringUtils.isNotEmpty(userAnswers.getAnswerContent())){
                        userData.add(userAnswers.getAnswerContent());
                    }else{
                        userData.add(" ");
                    }
                }else{
                    if(reserveSubId.equals(0L)){
                        reserveSubId = userAnswers.getReserveSubId();
                    }
                    if(!reserveSubId.equals(userAnswers.getReserveSubId())){
                        reserveSubId = userAnswers.getReserveSubId();
                        //判断当前的组件类型是否是图片上传,导出时需要导出图片
                        if(userAnswers.getOptionType().equals(11)){
                            reserveSubId = userAnswers.getReserveSubId();
                            try {
                                userData.add(new URL(userAnswers.getAnswerContent()));
                            }catch (Exception e){
                                userData.add(" ");
                                log.error("导出转换图片失败!");
                            }
                            continue;
                        }
                        sb.append(userAnswers.getAnswerContent()==null?"无":userAnswers.getAnswerContent() + ",");
                        String answer = sb.toString();
                        userData.add(answer.substring(0, answer.length() - 1));
                        sb = new StringBuffer();
                    }else{
                        //判断当前的组件类型是否是图片上传,导出时需要导出图片
                        if(userAnswers.getOptionType().equals(11)){
                            reserveSubId = userAnswers.getReserveSubId();
                            try {
                                userData.add(new URL(userAnswers.getAnswerContent()));
                            }catch (Exception e){
                                userData.add(" ");
                                log.error("导出转换图片失败!");
                            }
                            continue;
                        }
                        sb.append(userAnswers.getAnswerContent()==null?"无":userAnswers.getAnswerContent() + ",");
                        String answer = sb.toString();
                        userData.add(answer.substring(0, answer.length() - 1));
                        sb = new StringBuffer();
                    }
                }
            }
            resultList.add(userData);
        }
        return resultList;
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommonDataApi.java
@@ -680,8 +680,8 @@
     * @return 删除结果
     */
    @PostMapping("/special/delete")
    public R deleteSpecialInputUser(@RequestParam(value = "id") Long id) {
        return comMngPopulationService.deleteSpecialInputUser(id);
    public R deleteSpecialInputUser(@RequestParam(value = "id") Long id,@RequestParam(value = "communityId") Long communityId) {
        return comMngPopulationService.deleteSpecialInputUser(id,communityId);
    }
    /**
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ConvenientApi.java
@@ -1,5 +1,6 @@
package com.panzhihua.service_community.api;
import java.time.Instant;
import java.util.List;
import javax.annotation.Resource;
@@ -364,6 +365,7 @@
     */
    @PostMapping("/merchant/add")
    public R addMerchant(@RequestBody ConvenientMerchantDTO convenientMerchantDTO) {
        log.error("catTimeStamp进入service_community", Instant.now().toEpochMilli());
        return convenientMerchantService.addMerchant(convenientMerchantDTO);
    }
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ConvenientConsultationStatisticsDAO.java
@@ -55,4 +55,11 @@
     * @return
     */
    List<ConvenientConsultationStatisticsVO> selectSumForConsultationNum();
    /**
     * 获取商家总咨询量
     * @param merchantId
     * @return
     */
    int selectTotalConsultationVolume(@Param("merchantId") Long merchantId);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ConvenientViewStatisticsDAO.java
@@ -55,4 +55,11 @@
     * @return
     */
    List<ConvenientViewStatisticsVO> selectSumForViewNum();
    /**
     * 获取商家总浏览量
     * @param merchantId
     * @return
     */
    int selectTotalViewNum(@Param("merchantId") Long merchantId);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComMngPopulationCommunityTagsDO.java
@@ -38,6 +38,7 @@
    /**
     * 标签集合(多个标签以,隔开)
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String label;
    /**
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComMngPopulationDO.java
@@ -219,7 +219,7 @@
    /**
     * 标签集合(多个标签以,隔开)
     */
    @TableField(fill = FieldFill.UPDATE)
    @TableField(fill = FieldFill.UPDATE,updateStrategy = FieldStrategy.IGNORED)
    private String label;
    /**
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ConvenientProductDO.java
@@ -43,6 +43,10 @@
     */
    private Boolean onShelf;
    /**
     * 上架时间
     */
    private Date onShelfAt;
    /**
     * 产品介绍
     */
    private String introduction;
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComMngPopulationService.java
@@ -307,7 +307,7 @@
     *            特殊群体id
     * @return 删除结果
     */
    R deleteSpecialInputUser(Long id);
    R deleteSpecialInputUser(Long id,Long communityId);
    /**
     * 基础数据》特殊群体》分页查询标签列表
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComClusterOrganizationServiceImpl.java
@@ -71,9 +71,9 @@
        BeanUtils.copyProperties(addClusterAdminDto,organizationDO);
        organizationDO.setCreateAt(new Date());
        if(this.baseMapper.insert(organizationDO) > 0){
            return R.ok();
            return R.ok("新增成功");
        }
        return R.fail();
        return R.fail("新增失败");
    }
    /**
@@ -98,9 +98,9 @@
        BeanUtils.copyProperties(editClusterAdminDto,organizationDO);
        organizationDO.setUpdateAt(new Date());
        if(this.baseMapper.updateById(organizationDO) > 0){
            return R.ok();
            return R.ok("编辑成功");
        }
        return R.fail();
        return R.fail("编辑失败");
    }
    /**
@@ -121,9 +121,9 @@
        organizationDO.setIsDel(ComClusterOrganizationDO.isOk.yes);
        organizationDO.setUpdateAt(new Date());
        if(this.baseMapper.updateById(organizationDO) > 0){
            return R.ok();
            return R.ok("删除成功");
        }
        return R.fail();
        return R.fail("删除失败");
    }
    /**
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java
@@ -6668,13 +6668,24 @@
     * @return 删除结果
     */
    @Override
    public R deleteSpecialInputUser(Long id) {
    public R deleteSpecialInputUser(Long id,Long communityId) {
        // 查询特殊群体人员
        ComMngPopulationDO populationDO = this.baseMapper.selectById(id);
        if (populationDO == null) {
            return R.fail("未查询到该记录");
        }
        populationDO.setLabel(null);
        //  清理社区与人口关联信息的label信息
        List<ComMngPopulationCommunityTagsDO> communityTagsDOList = comMngPopulationCommunityTagsDAO.selectList(new QueryWrapper<ComMngPopulationCommunityTagsDO>()
                .lambda().eq(ComMngPopulationCommunityTagsDO::getPopulationId,id).eq(ComMngPopulationCommunityTagsDO::getCommunityId,communityId));
        if(communityTagsDOList != null && communityTagsDOList.size() > 0){
            communityTagsDOList.forEach(communityTags -> {
                communityTags.setLabel(null);
                comMngPopulationCommunityTagsDAO.updateById(communityTags);
            });
        }
        if (this.baseMapper.updateById(populationDO) > 0) {
            return R.ok();
        } else {
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComPensionAuthRecordServiceImpl.java
@@ -15,6 +15,7 @@
import javax.annotation.Resource;
import cn.hutool.core.util.IdcardUtil;
import com.panzhihua.common.utlis.WxUtil;
import com.panzhihua.common.utlis.WxXCXTempSend;
import com.panzhihua.service_community.dao.ComActActSignDAO;
@@ -120,6 +121,11 @@
    public R detailPensionAuthRecords(Long authRecordId) {
        ComPensionAuthRecordVO comPensionAuthRecordVO = comPensionAuthRecordDAO.detailPensionAuthRecords(authRecordId);
        comPensionAuthRecordVO.setNextIds(comPensionAuthRecordDAO.getNextIds(comPensionAuthRecordVO.getCommunityId(),authRecordId));
        try {
            comPensionAuthRecordVO.setAge(IdcardUtil.getAgeByIdCard(comPensionAuthRecordVO.getIdCard()));
        }catch (Exception e){
            log.error("身份证转换失败");
        }
        return R.ok(comPensionAuthRecordVO);
    }
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientMerchantServiceImpl.java
@@ -5,6 +5,7 @@
import static org.apache.commons.lang3.StringUtils.isNotBlank;
import java.text.SimpleDateFormat;
import java.time.Instant;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -12,6 +13,7 @@
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -62,6 +64,7 @@
 * @date: 2021/09/16 16:14
 */
@Service
@Slf4j
public class ConvenientMerchantServiceImpl extends ServiceImpl<ConvenientMerchantDAO, ConvenientMerchantDO> implements ConvenientMerchantService {
    @Resource
@@ -80,6 +83,7 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public R addMerchant(ConvenientMerchantDTO convenientMerchantDTO) {
        log.error("catTimeStamp开始执行addMerchant", Instant.now().toEpochMilli());
        ComActDO comActDO = comActDAO.selectById(convenientMerchantDTO.getCommunityId());
        ConvenientMerchantDO convenientMerchantDO = new ConvenientMerchantDO();
        BeanUtils.copyProperties(convenientMerchantDTO, convenientMerchantDO);
@@ -99,6 +103,7 @@
                });
            }
        }
        log.error("catTimeStamp商家创建完成开始添加用户", Instant.now().toEpochMilli());
        //添加user
        R addUserResult = userService.addConvenientMerchantUser(convenientMerchantDTO);
        if (R.isOk(addUserResult)) {
@@ -108,6 +113,7 @@
        } else {
            throw new ServiceException("406", addUserResult.getMsg());
        }
        log.error("catTimeStamp全部完成", Instant.now().toEpochMilli());
        return R.ok();
    }
@@ -191,7 +197,7 @@
        R result = userService.disableOrEnableMerchantUsers(disableOrEnableConvenientMerchantDTO);
        int type = disableOrEnableConvenientMerchantDTO.getType().intValue();
        if (type == 2) {
            this.baseMapper.batchUpdateBusinessStatus(convenientMerchantDOList, 2);
            this.baseMapper.batchUpdateBusinessStatus(convenientMerchantDOList, 0);
        }
        if (R.isOk(result)) {
            return R.ok();
@@ -252,12 +258,10 @@
        SimpleDateFormat dayFormat = new SimpleDateFormat("yyyy-MM-dd");
        String moth = mothFormat.format(nowDate);
        String day = dayFormat.format(nowDate);
        int consultationCount = convenientConsultationStatisticsDAO.selectCount(new QueryWrapper<ConvenientConsultationStatisticsDO>()
                .lambda().eq(ConvenientConsultationStatisticsDO::getMerchantId, merchantId));
        int consultationCount = convenientConsultationStatisticsDAO.selectTotalConsultationVolume(merchantId);
        int monthConsultationVolume = convenientConsultationStatisticsDAO.selectMonthConsultationVolume(merchantId, moth);
        int dayConsultationVolume = convenientConsultationStatisticsDAO.selectDayConsultationVolume(merchantId, day);
        Integer viewCount = convenientViewStatisticsDAO.selectCount(new QueryWrapper<ConvenientViewStatisticsDO>()
                .lambda().eq(ConvenientViewStatisticsDO::getMerchantId, merchantId));
        Integer viewCount = convenientViewStatisticsDAO.selectTotalViewNum(merchantId);
        int monthViewNum = convenientViewStatisticsDAO.selectMonthViewNum(merchantId, moth);
        int dayViewNum = convenientViewStatisticsDAO.selectDayViewNum(merchantId, day);
        convenientMerchantVO.setConsultationVolume(consultationCount);
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientProductServiceImpl.java
@@ -66,6 +66,9 @@
        ConvenientProductDO convenientProductDO = new ConvenientProductDO();
        BeanUtils.copyProperties(convenientProductDTO, convenientProductDO);
        Date nowDate = new Date();
        if (convenientProductDTO.getOnShelf()) {
            convenientProductDO.setOnShelfAt(nowDate);
        }
        convenientProductDO.setCreatedAt(nowDate);
        this.baseMapper.insert(convenientProductDO);
        Long productId = convenientProductDO.getId();
@@ -91,16 +94,20 @@
        Long productId = convenientProductDTO.getId();
        Long updatedBy = convenientProductDTO.getUpdatedBy();
        ConvenientProductDO convenientProductDO = this.baseMapper.selectById(productId);
        Boolean isOnShelf = convenientProductDO.getOnShelf();
        if (isNull(convenientProductDO)) {
            return R.fail("产品不存在");
        }
        BeanUtils.copyProperties(convenientProductDTO, convenientProductDO);
        Date nowDate = new Date();
        if (!isOnShelf && convenientProductDTO.getOnShelf()) {
            convenientProductDO.setOnShelfAt(nowDate);
        }
        convenientProductDO.setUpdatedBy(updatedBy);
        this.baseMapper.updateById(convenientProductDO);
        List<ConvenientProductSpecificationDTO> productSpecificationDTOList = convenientProductDTO.getProductSpecificationDTOList();
        List<Long> notNeedDelIds = productSpecificationDTOList.stream().filter(specificationDTO -> nonNull(specificationDTO.getId()))
                .map(ConvenientProductSpecificationDTO::getId).collect(Collectors.toList());
        Date nowDate = new Date();
        productSpecificationDTOList.forEach(specificationDTO -> {
            Long specificationId = specificationDTO.getId();
            if (isNull(specificationId)) {
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActQuestnaireDOMapper.xml
@@ -197,10 +197,11 @@
            SELECT
                count( id )
            FROM
                com_pb_member AS su
            WHERE
                community_id = #{communityId}
            AND user_id NOT IN ( SELECT user_id FROM com_act_questnaire_user_answer WHERE questnaire_id = #{questId} )) AS noPartymemberCount,
                (
                SELECT id FROM com_pb_member AS su  WHERE community_id = #{communityId} AND user_id IS NULL UNION ALL
                SELECT id FROM com_pb_member AS su  WHERE community_id = #{communityId} AND user_id IS NOT NULL
                AND user_id NOT IN ( SELECT user_id FROM com_act_questnaire_user_answer WHERE questnaire_id = #{questId}  )
                ) AS member) AS noPartymemberCount,
            (select count(user_id) from sys_user where community_id = 2 and type = 1) as userCount
        FROM
            com_act_questnaire_user_answer AS caqua
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActReserveRecordMapper.xml
@@ -51,6 +51,7 @@
        SELECT
            carr.id,
            su.nick_name,
            su1.`name` as handleName,
            carr.`name`,
            carr.phone,
            carr.reserve_time,
@@ -61,6 +62,7 @@
        FROM
            com_act_reserve_record AS carr
            LEFT JOIN sys_user AS su ON su.user_id = carr.user_id
            LEFT JOIN sys_user AS su1 ON su1.user_id = carr.handle_id
            where carr.status = 2 and carr.`type` = 1 and carr.reserve_id = #{pageMakeDTO.reserveId}
            <if test="pageMakeDTO.startTime != null and pageMakeDTO.startTime != &quot;&quot;">
                AND carr.reserve_time <![CDATA[ >= ]]> #{pageMakeDTO.startTime}
@@ -75,6 +77,7 @@
        SELECT
            carr.id,
            su.nick_name,
            su1.`name` as handleName,
            carr.`name`,
            carr.phone,
            carr.reserve_time,
@@ -85,6 +88,7 @@
        FROM
            com_act_reserve_record AS carr
            LEFT JOIN sys_user AS su ON su.user_id = carr.user_id
            LEFT JOIN sys_user AS su1 ON su1.user_id = carr.handle_id
            where carr.id = #{reserveRecordId}
    </select>
@@ -107,6 +111,7 @@
        SELECT
        carr.id,
        su.nick_name,
        su.`name` as handleName,
        carr.`name`,
        carr.phone,
        carr.reserve_time,
@@ -117,6 +122,7 @@
        FROM
        com_act_reserve_record AS carr
        LEFT JOIN sys_user AS su ON su.user_id = carr.user_id
        LEFT JOIN sys_user AS su1 ON su1.user_id = carr.handle_id
        where carr.status = 2 and carr.`type` = 1 and carr.reserve_id = #{pageMakeDTO.reserveId}
        <if test="pageMakeDTO.startTime != null and pageMakeDTO.startTime != &quot;&quot;">
            AND carr.reserve_time <![CDATA[ >= ]]> #{pageMakeDTO.startTime}
@@ -239,6 +245,7 @@
        SELECT
        carr.id,
        su.nick_name,
        su1.`name` as handleName,
        carr.`name`,
        carr.phone,
        carr.reserve_time,
@@ -251,6 +258,7 @@
        FROM
        com_act_reserve_record AS carr
        LEFT JOIN sys_user AS su ON su.user_id = carr.user_id
        LEFT JOIN sys_user AS su1 ON su1.user_id = carr.handle_id
        LEFT JOIN com_act_reserve AS car ON car.id = carr.reserve_id
        WHERE
        carr.`type` = 1
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientConsultationStatisticsMapper.xml
@@ -35,5 +35,10 @@
        SELECT merchant_id, SUM(consultation_volume) AS totalConsultationNum
        FROM com_convenient_consultation_statistics GROUP BY merchant_id
    </select>
    <select id="selectTotalConsultationVolume" resultType="java.lang.Integer">
        SELECT IF(SUM(consultation_volume) IS NULL,0,SUM(consultation_volume))
        FROM com_convenient_consultation_statistics
        WHERE merchant_id = #{merchantId}
    </select>
</mapper>
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientProductMapper.xml
@@ -9,6 +9,7 @@
                <id column="category_id" property="categoryId" />
                <id column="merchant_id" property="merchantId" />
                <id column="on_shelf" property="onShelf" />
                <id column="on_shelf_at" property="onShelfAt" />
                <id column="introduction" property="introduction" />
                <id column="is_del" property="isDel" />
                <id column="view_num" property="viewNum" />
@@ -20,7 +21,7 @@
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id,`name`,category_id,merchant_id,on_shelf,introduction,is_del,view_num,created_at,created_by,updated_at,updated_by
        id,`name`,category_id,merchant_id,on_shelf,on_shelf_at,introduction,is_del,view_num,created_at,created_by,updated_at,updated_by
    </sql>
    <update id="batchDeleteByIds">
        UPDATE com_convenient_products SET is_del = 1 WHERE id IN
@@ -29,7 +30,11 @@
        </foreach>
    </update>
    <update id="batchOnShelfOrOffShelfByIds">
        UPDATE com_convenient_products SET on_shelf = #{saleStatus}, updated_by = #{updatedBy} WHERE id IN
        UPDATE com_convenient_products SET on_shelf = #{saleStatus},
         <if test="saleStatus">
             on_shelf_at = NOW(),
         </if>
        updated_by = #{updatedBy} WHERE id IN
        <foreach collection="needDealIds" open="(" separator="," close=")" index="index" item="item">
            #{item}
        </foreach>
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientViewStatisticsMapper.xml
@@ -35,5 +35,10 @@
        SELECT merchant_id, SUM(view_num) AS totalViewNum
        FROM com_convenient_view_statistics GROUP BY merchant_id
    </select>
    <select id="selectTotalViewNum" resultType="java.lang.Integer">
        SELECT IF(SUM(view_num) IS NULL,0,SUM(view_num))
        FROM com_convenient_view_statistics
        WHERE merchant_id = #{merchantId}
    </select>
</mapper>
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventServiceImpl.java
@@ -317,7 +317,9 @@
        if (eventMapper.insert(eventDO) == 1) {
            // 如果是特殊人群,则新增特殊人群与事件关系
            if (commonEventAddDTO.getEventType().equals(6)) {
            if (commonEventAddDTO.getEventType().equals(6)
                    && commonEventAddDTO.getPopulationIds() != null
                    && commonEventAddDTO.getPopulationIds().size() > 0) {
                if (commonEventAddDTO.getPopulationIds() != null && commonEventAddDTO.getPopulationIds().size() > 0) {
                    List<EventSpecialCrowdRecordDO> crowdRecordList = new ArrayList<>();
                    commonEventAddDTO.getPopulationIds().forEach(populationId -> {
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/RoleServiceImpl.java
@@ -312,7 +312,20 @@
        if (!ObjectUtils.isEmpty(sysRoleMenuDOS)) {
            List<Long> longs =
                sysRoleMenuDOS.stream().map(sysRoleMenuDO -> sysRoleMenuDO.getMenuId()).collect(Collectors.toList());
                return R.ok(longs);
            List<SysMenuDO> sysMenuDOList=this.sysMenuDAO.selectList(new QueryWrapper<SysMenuDO>().lambda().in(SysMenuDO::getMenuId,longs).eq(SysMenuDO::getParentId,0));
            sysMenuDOList.forEach(sysMenuDO -> {
                List<SysMenuDO> sysMenuDOS=this.sysMenuDAO.selectList(new QueryWrapper<SysMenuDO>().lambda().in(SysMenuDO::getMenuId,longs).eq(SysMenuDO::getParentId,sysMenuDO.getMenuId()));
                sysMenuDOS.forEach(sysMenuDO1 -> {
                    List<SysMenuDO> sysMenuDOS1=this.sysMenuDAO.selectList(new QueryWrapper<SysMenuDO>().lambda().in(SysMenuDO::getMenuId,longs).eq(SysMenuDO::getParentId,sysMenuDO1.getMenuId()));
                    if(!sysMenuDOS1.isEmpty()){
                        longs.remove(sysMenuDO1.getMenuId());
                    }
                });
                if(!sysMenuDOS.isEmpty()){
                    longs.remove(sysMenuDO.getMenuId());
                }
            });
            return R.ok(longs);
        }
        return R.fail();
    }
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java
@@ -3,6 +3,7 @@
import static java.util.Objects.isNull;
import static java.util.Objects.nonNull;
import java.time.Instant;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
@@ -2167,7 +2168,7 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public R addGridUser(EventGridMemberAddDTO eventGridMemberAddDTO) {
        //todo 网格
        SysRoleDO gridMemberDefaultRole = roleDAO.selectOne(
            new QueryWrapper<SysRoleDO>().lambda().eq(SysRoleDO::getRoleKey, Constants.GRID_DEFAULT_ROLE_KEY));
        if (gridMemberDefaultRole == null) {
@@ -2590,11 +2591,13 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public R addConvenientMerchantUser(ConvenientMerchantDTO convenientMerchantDTO) {
        // todo 便民
        log.error("catTimeStamp进入addConvenientMerchantUser", Instant.now().toEpochMilli());
        SysUserDO sysUserDO = new SysUserDO();
        Long communityId = 0L;
        // 新增社区高级管理员角色
        SysRoleDO sysRoleDO = new SysRoleDO();
        sysRoleDO.setCommunityId(0L);
        sysRoleDO.setCommunityId(communityId);
        sysRoleDO.setRoleName(convenientMerchantDTO.getName());
        sysRoleDO.setRoleKey(Constants.CONVENIENT_MERCHANT_ROLE_KEY + convenientMerchantDTO.getAccount());
        sysRoleDO.setRoleSort(0);
@@ -2609,15 +2612,18 @@
            if (e.getMessage().contains("unique_role_name_community_id")) {
                return R.fail("商家名称已被占用");
            } else {
                return R.fail("建立商家角色失败");
                return R.fail("建立商家角色失败,商家名称可能已被占用!");
            }
        }
        log.error("catTimeStamp-SysRoleDO创建完成", Instant.now().toEpochMilli());
        // 新角色设置所有权限
        MenuRoleVO menuRoleVO = new MenuRoleVO();
        menuRoleVO.setIsAll(1);
        menuRoleVO.setCommunityId(communityId);
        menuRoleVO.setRoleId(sysRoleDO.getRoleId());
        this.putMenuRole(menuRoleVO);
        log.error("catTimeStamp-MenuRoleVO创建完成", Instant.now().toEpochMilli());
        // sys_user 表
        String encode = new BCryptPasswordEncoder().encode(convenientMerchantDTO.getPassword());
@@ -2631,6 +2637,7 @@
        sysUserDO.setPassword(encode);
        try {
            userDao.insert(sysUserDO);
            log.error("catTimeStamp-sysUserDO创建完成", Instant.now().toEpochMilli());
            return R.ok(sysUserDO.getUserId());
        } catch (Exception e) {
            e.printStackTrace();