Merge branch 'test' of http://gitlab.nhys.cdnhxx.com/root/zhihuishequ into test
| | |
| | | |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.time.Instant; |
| | | import java.util.UUID; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | |
| | | import com.panzhihua.applets_backstage.config.MinioUtil; |
| | | import com.panzhihua.common.model.dtos.community.convenient.DisableOrEnableConvenientMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.ResetPasswordConvenientMerchantDTO; |
| | | import org.apache.commons.io.FilenameUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.jcraft.jsch.SftpException; |
| | | import com.panzhihua.applets_backstage.config.MinioUtil; |
| | | import com.panzhihua.common.constants.FtpConstants; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.listen.ComCvtServeExcelListen; |
| | |
| | | import com.panzhihua.common.model.dtos.community.PageComCvtServeDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.ConvenientMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.ConvenientServiceCategoryDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.DisableOrEnableConvenientMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.PageConvenientMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.PageConvenientServiceCategoryDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.ResetPasswordConvenientMerchantDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActVO; |
New file |
| | |
| | | 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; |
| | | } |
| | |
| | | @ApiModelProperty("居住地址") |
| | | private String address; |
| | | |
| | | @ApiModelProperty("关键词") |
| | | private String keyWord; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "认证方式(1.视频认证 2.人脸认证 3.线下认证)") |
| | | private String authMethod; |
| | | |
| | | private String idCard; |
| | | } |
| | |
| | | private String idCard; |
| | | |
| | | @ApiModelProperty("咨询电话") |
| | | @Pattern(groups = {AddGroup.class}, message = "咨询电话格式错误", regexp = "(1[3|4|5|7|8][0-9]\\d{8})|(\\d{3}-\\d{8}|\\d{4}-\\d{7})") |
| | | @Pattern(groups = {AddGroup.class}, message = "咨询电话格式错误", regexp = "^(13[0-9]|14[01456879]|15[0-3,5-9]|16[2567]|17[0-8]|18[0-9]|19[0-3,5-9])\\d{8}$") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty("商家地址") |
| | |
| | | private Integer businessStatus; |
| | | |
| | | @ApiModelProperty("管理账号") |
| | | @Pattern(groups = {AddGroup.class}, message = "请输入6-10位管理账号,由英文或数字组成", regexp = "^[0-9A-Za-z]{6,10}$") |
| | | @NotBlank(groups = {AddGroup.class}, message = "管理账号不能为空") |
| | | private String account; |
| | | |
| | | @ApiModelProperty("登陆密码") |
| | | // @Pattern(groups = {AddGroup.class}, message = "请输入8-12位登陆密码,由英文,数字和特殊符号组成", |
| | | // regexp = "^(?=.*[A-Za-z])(?=.*\\d)(?=.*[$@$!%*#?&])[A-Za-z\\d$@$!%*#?&]{8,12}$") |
| | | @Pattern(groups = {AddGroup.class}, message = "请输入8-12位登陆密码,由英文,数字和特殊符号组成", |
| | | regexp = "^(?=.*[A-Za-z])(?=(.*[\\d]){1,})(?=(.*[\\W]){1,})(?!.*\\s).{8,}$") |
| | | regexp = "^(?=.*[A-Za-z])(?=(.*[\\d]){1,})(?=(.*[\\W]){1,})(?!.*\\s).{8,12}$") |
| | | private String password; |
| | | |
| | | @ApiModelProperty(value = "所属社区id") |
| | |
| | | |
| | | @ApiModelProperty(value = "更新人", hidden = true) |
| | | private Long updatedBy; |
| | | |
| | | @ApiModelProperty(value = "商家id", hidden = true) |
| | | private Long merchantId; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "处理人", hidden = true) |
| | | private Long updatedBy; |
| | | |
| | | @ApiModelProperty(value = "被禁用商家关联用户id", hidden = true) |
| | | private List<Long> userIds; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数", example = "10") |
| | | private Long pageSize; |
| | | |
| | | @ApiModelProperty(value = "商家id", hidden = true) |
| | | private Long merchantId; |
| | | } |
| | |
| | | @ApiModelProperty(value = "事件分类:1治安隐患、2公共服务、3矛盾纠纷、4不稳定因素、5突发事件", hidden = false, example = "1") |
| | | // @NotNull(message = "事件分类不能为空") |
| | | private Integer eventType; |
| | | @ApiModelProperty(value = "事件类型") |
| | | private String eventClazz; |
| | | @Max(127) |
| | | @ApiModelProperty(value = "危险级别", hidden = false, example = "1") |
| | | private Integer dangerLevel; |
| | |
| | | |
| | | @ApiModelProperty("新密码") |
| | | @Pattern(groups = {AddGroup.class}, message = "请输入8-12位登陆密码,由英文,数字和特殊符号组成", |
| | | regexp = "^(?=.*[A-Za-z])(?=.*\\d)(?=.*[$@$!%*#?&])[A-Za-z\\d$@$!%*#?&]{8,12}$") |
| | | regexp = "^(?=.*[A-Za-z])(?=(.*[\\d]){1,})(?=(.*[\\W]){1,})(?!.*\\s).{8,12}$") |
| | | private String newPassword; |
| | | } |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | * 小区id |
| | | */ |
| | | @ApiModelProperty(value = "小区id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long areaId; |
| | | |
| | | /** |
| | |
| | | private Integer authNoAmount; |
| | | |
| | | @ApiModelProperty(value = "待审核状态id集合列表") |
| | | private List<Long> nextIds; |
| | | private List<String> nextIds; |
| | | |
| | | @ApiModelProperty(value = "社区id") |
| | | private Long communityId; |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | |
| | | @ApiModelProperty(value = "更新时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date updateAt; |
| | | |
| | | @ApiModelProperty(value = "待处理id集合") |
| | | private List<String> nextIds; |
| | | |
| | | private Long communityId; |
| | | } |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | private String areaName; |
| | | |
| | | @ApiModelProperty("小区id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long areaId; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty("浏览量") |
| | | private Integer viewNum; |
| | | |
| | | public void setOnShelf(Boolean onShelf) { |
| | | this.onShelf = onShelf ? 1 : 0; |
| | | } |
| | | } |
| | |
| | | @ApiModelProperty("操作记录") |
| | | private List<ComActReserveMakeOperationAdminVO> operationList; |
| | | |
| | | @ApiModelProperty("处理人/备注人") |
| | | private String handleName; |
| | | |
| | | } |
| | |
| | | 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) |
| | |
| | | @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; |
| | |
| | | @ApiModelProperty("预约登记主题") |
| | | private String title; |
| | | |
| | | @ApiModelProperty("处理人/备注人") |
| | | private String handleName; |
| | | |
| | | } |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | @ApiModelProperty("处理人/备注人") |
| | | private String handleName; |
| | | |
| | | } |
| | |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("common/data/special/delete") |
| | | R deleteSpecialInputUser(@RequestParam(value = "id") Long id); |
| | | R deleteSpecialInputUser(@RequestParam(value = "id") Long id,@RequestParam("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 办事指南_新增 |
| | |
| | | /** |
| | | * 获取所有产品分类 |
| | | * @return |
| | | * @param merchantId |
| | | */ |
| | | @GetMapping("/convenient/product-category/all") |
| | | R getAllProductCategory(); |
| | | R getAllProductCategory(@RequestParam("merchantId") Long merchantId); |
| | | |
| | | /** |
| | | * 获取该社区商家数量大于0的分类 |
New file |
| | |
| | | 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; |
| | | } |
| | | } |
New file |
| | |
| | | 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; |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | 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(); |
| | |
| | | @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) || 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; |
| | | |
| | | 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; |
| | | } |
| | | 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(); |
| | | } |
| | | } |
| | | } |
| | | // String answer = sb.toString(); |
| | | // if(StringUtils.isNotEmpty(answer)){ |
| | | // userData.add(answer.substring(0, answer.length() - 1)); |
| | | // } |
| | | resultList.add(userData); |
| | | } |
| | | return resultList; |
| | | } |
| | | |
| | | } |
| | |
| | | @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") |
| | |
| | | |
| | | 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.*; |
| | |
| | | } |
| | | 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(); |
| | |
| | | } |
| | | 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; |
| | | } |
| | | |
| | | } |
| | |
| | | if (loginUserInfo == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | comActDiscussDTO.setUserId(loginUserInfo.getUserId()); |
| | | // comActDiscussDTO.setUserId(loginUserInfo.getUserId()); |
| | | comActDiscussDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | if (comActDiscussDTO.getType().equals(ComActDiscussDTO.type.tp)) { |
| | | if (ObjectUtils.isEmpty(comActDiscussDTO.getVoteTitle())) { |
| | |
| | | List<String> head5 = new ArrayList<String>(); |
| | | head5.add("与户主关系"); |
| | | List<String> head6 = new ArrayList<String>(); |
| | | head6.add("*街/路/巷"); |
| | | head6.add("*街/路/巷(如:格沙拉大道)"); |
| | | List<String> head7 = new ArrayList<String>(); |
| | | head7.add("*小区号(政府对于每个小区都有特定编号)"); |
| | | head7.add("*地址号(对于地址都有特定编号,如:格萨拉大道11号) 注:仅填写数字即可"); |
| | | List<String> head8 = new ArrayList<String>(); |
| | | head8.add("楼排号"); |
| | | head8.add("*楼排号(注:仅填写数字即可)"); |
| | | List<String> head9 = new ArrayList<String>(); |
| | | head9.add("单元号"); |
| | | head9.add("*单元号(注:仅填写数字即可.老式楼栋若没有单元划分则默认为一单元)"); |
| | | List<String> head10 = new ArrayList<String>(); |
| | | head10.add("户室(四位数表示。前两位楼层,后两位户号)"); |
| | | head10.add("户室(只能识别纯数字。根据实际有以下几种户室类型,请根据实际填写:①9楼1号—901;12楼10号—1210②没有楼层只有号。如9号—9:;13号—13)"); |
| | | List<String> head11 = new ArrayList<String>(); |
| | | head11.add("建筑用途"); |
| | | List<String> head12 = new ArrayList<String>(); |
| | |
| | | List<String> head2 = new ArrayList<String>(); |
| | | head2.add("民族"); |
| | | List<String> head3 = new ArrayList<String>(); |
| | | head3.add("*身份证号码"); |
| | | head3.add("*身份证(性别和年龄自动根据身份证号识别)"); |
| | | List<String> head4 = new ArrayList<String>(); |
| | | head4.add("联系电话"); |
| | | List<String> head5 = new ArrayList<String>(); |
| | | head5.add("*街/路/巷"); |
| | | head5.add("*街/路/巷(如:格沙拉大道)"); |
| | | List<String> head6 = new ArrayList<String>(); |
| | | head6.add("*小区号(政府对于每个小区都有特定编号)"); |
| | | head6.add("*地址号(对于地址都有特定编号,如:格萨拉大道11号) 注:仅填写数字即可"); |
| | | List<String> head7 = new ArrayList<String>(); |
| | | head7.add("楼排号"); |
| | | head7.add("*楼排号(注:仅填写数字即可)"); |
| | | List<String> head8 = new ArrayList<String>(); |
| | | head8.add("单元号"); |
| | | head8.add("*单元号(注:仅填写数字即可.老式楼栋若没有单元划分则默认为一单元)"); |
| | | List<String> head9 = new ArrayList<String>(); |
| | | head9.add("户室(四位数表示。前两位楼层,后两位户号)"); |
| | | head9.add("户室(只能识别纯数字。根据实际有以下几种户室类型,请根据实际填写:①9楼1号—901;12楼10号—1210②没有楼层只有号。如9号—9:;13号—13)"); |
| | | List<String> head10 = new ArrayList<String>(); |
| | | head10.add("是否租住(是/否)"); |
| | | List<String> head11 = new ArrayList<String>(); |
| | |
| | | List<String> head2 = new ArrayList<String>(); |
| | | head2.add("民族"); |
| | | List<String> head3 = new ArrayList<String>(); |
| | | head3.add("*身份证号码"); |
| | | head3.add("*身份证(性别和年龄自动根据身份证号识别)"); |
| | | List<String> head4 = new ArrayList<String>(); |
| | | head4.add("联系电话"); |
| | | List<String> head5 = new ArrayList<String>(); |
| | | head5.add("*街/路/巷"); |
| | | head5.add("*街/路/巷(如:格沙拉大道)"); |
| | | List<String> head6 = new ArrayList<String>(); |
| | | head6.add("*小区号(政府对于每个小区都有特定编号)"); |
| | | head6.add("*地址号(对于地址都有特定编号,如:格萨拉大道11号) 注:仅填写数字即可"); |
| | | List<String> head7 = new ArrayList<String>(); |
| | | head7.add("楼排号"); |
| | | head7.add("*楼排号(注:仅填写数字即可)"); |
| | | List<String> head8 = new ArrayList<String>(); |
| | | head8.add("单元号"); |
| | | head8.add("*单元号(注:仅填写数字即可.老式楼栋若没有单元划分则默认为一单元)"); |
| | | List<String> head9 = new ArrayList<String>(); |
| | | head9.add("户室(四位数表示。前两位楼层,后两位户号)"); |
| | | head9.add("*户室(只能识别纯数字。根据实际有以下几种户室类型,请根据实际填写:①9楼1号—901;12楼10号—1210②没有楼层只有号。如9号—9:;13号—13)"); |
| | | List<String> head10 = new ArrayList<String>(); |
| | | head10.add("是否租住(是/否)"); |
| | | List<String> head11 = new ArrayList<String>(); |
| | |
| | | List<String> head22 = new ArrayList<String>(); |
| | | head22.add("原判刑期"); |
| | | List<String> head23 = new ArrayList<String>(); |
| | | head23.add("原判刑开始日期"); |
| | | head23.add("原判刑开始日期(日期格式:2020/02/05)"); |
| | | List<String> head24 = new ArrayList<String>(); |
| | | head24.add("原判刑结束日期"); |
| | | head24.add("原判刑结束日期(日期格式:2020/02/05)"); |
| | | List<String> head25 = new ArrayList<String>(); |
| | | head25.add("矫正开始日期"); |
| | | head25.add("矫正开始日期(日期格式:2020/02/05)"); |
| | | List<String> head26 = new ArrayList<String>(); |
| | | head26.add("矫正结束日期"); |
| | | head26.add("矫正结束日期(日期格式:2020/02/05)"); |
| | | List<String> head27 = new ArrayList<String>(); |
| | | head27.add("接收方式"); |
| | | List<String> head28 = new ArrayList<String>(); |
| | |
| | | List<String> head1 = new ArrayList<String>(); |
| | | head1.add("*姓名"); |
| | | List<String> head2 = new ArrayList<String>(); |
| | | head2.add("*身份证号码"); |
| | | head2.add("*身份证(性别和年龄自动根据身份证号识别)"); |
| | | List<String> head3 = new ArrayList<String>(); |
| | | head3.add("*街/路/巷"); |
| | | head3.add("*街/路/巷(如:格沙拉大道)"); |
| | | List<String> head4 = new ArrayList<String>(); |
| | | head4.add("*小区号(政府对于每个小区都有特定编号)"); |
| | | head4.add("*地址号(对于地址都有特定编号,如:格萨拉大道11号) 注:仅填写数字即可"); |
| | | List<String> head5 = new ArrayList<String>(); |
| | | head5.add("楼排号"); |
| | | head5.add("*楼排号(注:仅填写数字即可)"); |
| | | List<String> head6 = new ArrayList<String>(); |
| | | head6.add("单元号"); |
| | | head6.add("*单元号(注:仅填写数字即可.老式楼栋若没有单元划分则默认为一单元)"); |
| | | List<String> head7 = new ArrayList<String>(); |
| | | head7.add("户室(四位数表示。前两位楼层,后两位户号)"); |
| | | head7.add("*户室(只能识别纯数字。根据实际有以下几种户室类型,请根据实际填写:①9楼1号—901;12楼10号—1210②没有楼层只有号。如9号—9:;13号—13)"); |
| | | List<String> head8 = new ArrayList<String>(); |
| | | head8.add("是否租住(是/否)"); |
| | | List<String> head9 = new ArrayList<String>(); |
| | |
| | | List<String> head1 = new ArrayList<String>(); |
| | | head1.add("*姓名"); |
| | | List<String> head2 = new ArrayList<String>(); |
| | | head2.add("*身份证号码"); |
| | | head2.add("*身份证(性别和年龄自动根据身份证号识别)"); |
| | | List<String> head3 = new ArrayList<String>(); |
| | | head3.add("民族"); |
| | | List<String> head4 = new ArrayList<String>(); |
| | |
| | | List<String> head7 = new ArrayList<String>(); |
| | | head7.add("政治面貌"); |
| | | List<String> head8 = new ArrayList<String>(); |
| | | head8.add("*街/路/巷"); |
| | | head8.add("*街/路/巷(如:格沙拉大道)"); |
| | | List<String> head9 = new ArrayList<String>(); |
| | | head9.add("*小区号(政府对于每个小区都有特定编号)"); |
| | | head9.add("*地址号(对于地址都有特定编号,如:格萨拉大道11号) 注:仅填写数字即可"); |
| | | List<String> head10 = new ArrayList<String>(); |
| | | head10.add("楼排号"); |
| | | head10.add("*楼排号(注:仅填写数字即可)"); |
| | | List<String> head11 = new ArrayList<String>(); |
| | | head11.add("单元号"); |
| | | head11.add("*单元号(注:仅填写数字即可.老式楼栋若没有单元划分则默认为一单元)"); |
| | | List<String> head12 = new ArrayList<String>(); |
| | | head12.add("户室(四位数表示。前两位楼层,后两位户号)"); |
| | | head12.add("*户室(只能识别纯数字。根据实际有以下几种户室类型,请根据实际填写:①9楼1号—901;12楼10号—1210②没有楼层只有号。如9号—9:;13号—13)"); |
| | | List<String> head13 = new ArrayList<String>(); |
| | | head13.add("是否租住(是/否)"); |
| | | List<String> head14 = new ArrayList<String>(); |
| | |
| | | List<String> head20 = new ArrayList<String>(); |
| | | head20.add("基本情况(参加邪教的活动情况)"); |
| | | List<String> head21 = new ArrayList<String>(); |
| | | head21.add("参加邪教时间"); |
| | | head21.add("参加邪教时间(日期格式:2020/02/05))"); |
| | | List<String> head22 = new ArrayList<String>(); |
| | | head22.add("是否对外宣传"); |
| | | List<String> head23 = new ArrayList<String>(); |
| | |
| | | List<String> head2 = new ArrayList<String>(); |
| | | head2.add("民族"); |
| | | List<String> head3 = new ArrayList<String>(); |
| | | head3.add("*身份证号码"); |
| | | head3.add("*身份证(性别和年龄自动根据身份证号识别)"); |
| | | List<String> head4 = new ArrayList<String>(); |
| | | head4.add("联系电话"); |
| | | List<String> head5 = new ArrayList<String>(); |
| | | head5.add("籍贯"); |
| | | List<String> head6 = new ArrayList<String>(); |
| | | head6.add("*街/路/巷"); |
| | | head6.add("*街/路/巷(如:格沙拉大道)"); |
| | | List<String> head7 = new ArrayList<String>(); |
| | | head7.add("*小区号(政府对于每个小区都有特定编号)"); |
| | | head7.add("*地址号(对于地址都有特定编号,如:格萨拉大道11号) 注:仅填写数字即可"); |
| | | List<String> head8 = new ArrayList<String>(); |
| | | head8.add("楼排号"); |
| | | head8.add("*楼排号(注:仅填写数字即可)"); |
| | | List<String> head9 = new ArrayList<String>(); |
| | | head9.add("单元号"); |
| | | head9.add("*单元号(注:仅填写数字即可.老式楼栋若没有单元划分则默认为一单元)"); |
| | | List<String> head10 = new ArrayList<String>(); |
| | | head10.add("户室(四位数表示。前两位楼层,后两位户号)"); |
| | | head10.add("*户室(只能识别纯数字。根据实际有以下几种户室类型,请根据实际填写:①9楼1号—901;12楼10号—1210②没有楼层只有号。如9号—9:;13号—13)"); |
| | | List<String> head11 = new ArrayList<String>(); |
| | | head11.add("是否租住(是/否)"); |
| | | List<String> head12 = new ArrayList<String>(); |
| | |
| | | List<String> head21 = new ArrayList<String>(); |
| | | head21.add("是否累犯"); |
| | | List<String> head22 = new ArrayList<String>(); |
| | | head22.add("原判刑期"); |
| | | head22.add("原判刑期(日期格式:2020/02/05)"); |
| | | List<String> head23 = new ArrayList<String>(); |
| | | head23.add("服刑日期"); |
| | | head23.add("服刑日期(日期格式:2020/02/05)"); |
| | | List<String> head24 = new ArrayList<String>(); |
| | | head24.add("原罪名"); |
| | | List<String> head25 = new ArrayList<String>(); |
| | | head25.add("释放日期"); |
| | | head25.add("释放日期(日期格式:2020/02/05)"); |
| | | List<String> head26 = new ArrayList<String>(); |
| | | head26.add("服刑场所"); |
| | | List<String> head27 = new ArrayList<String>(); |
| | | head27.add("危险性评估"); |
| | | List<String> head28 = new ArrayList<String>(); |
| | | head28.add("衔接日期"); |
| | | head28.add("衔接日期(日期格式:2020/02/05)"); |
| | | List<String> head29 = new ArrayList<String>(); |
| | | head29.add("衔接情况"); |
| | | List<String> head30 = new ArrayList<String>(); |
| | |
| | | List<String> head32 = new ArrayList<String>(); |
| | | head32.add("安置情况"); |
| | | List<String> head33 = new ArrayList<String>(); |
| | | head33.add("安置日期"); |
| | | head33.add("安置日期(日期格式:2020/02/05)"); |
| | | List<String> head34 = new ArrayList<String>(); |
| | | head34.add("未安置原因"); |
| | | List<String> head35 = new ArrayList<String>(); |
| | |
| | | List<String> head2 = new ArrayList<String>(); |
| | | head2.add("民族"); |
| | | List<String> head3 = new ArrayList<String>(); |
| | | head3.add("*身份证号码"); |
| | | head3.add("*身份证(性别和年龄自动根据身份证号识别)"); |
| | | List<String> head4 = new ArrayList<String>(); |
| | | head4.add("联系电话"); |
| | | List<String> head5 = new ArrayList<String>(); |
| | | head5.add("籍贯"); |
| | | List<String> head6 = new ArrayList<String>(); |
| | | head6.add("*街/路/巷"); |
| | | head6.add("*街/路/巷(如:格沙拉大道)"); |
| | | List<String> head7 = new ArrayList<String>(); |
| | | head7.add("*小区号(政府对于每个小区都有特定编号)"); |
| | | head7.add("*地址号(对于地址都有特定编号,如:格萨拉大道11号) 注:仅填写数字即可"); |
| | | List<String> head8 = new ArrayList<String>(); |
| | | head8.add("楼排号"); |
| | | head8.add("*楼排号(注:仅填写数字即可)"); |
| | | List<String> head9 = new ArrayList<String>(); |
| | | head9.add("单元号"); |
| | | head9.add("*单元号(注:仅填写数字即可.老式楼栋若没有单元划分则默认为一单元)"); |
| | | List<String> head10 = new ArrayList<String>(); |
| | | head10.add("户室(四位数表示。前两位楼层,后两位户号)"); |
| | | head10.add("*户室(只能识别纯数字。根据实际有以下几种户室类型,请根据实际填写:①9楼1号—901;12楼10号—1210②没有楼层只有号。如9号—9:;13号—13)"); |
| | | List<String> head11 = new ArrayList<String>(); |
| | | head11.add("是否租住(是/否)"); |
| | | List<String> head12 = new ArrayList<String>(); |
| | |
| | | List<String> head3 = new ArrayList<String>(); |
| | | head3.add("*姓名"); |
| | | List<String> head4 = new ArrayList<String>(); |
| | | head4.add("*身份证号码"); |
| | | head4.add("*身份证(性别和年龄自动根据身份证号识别)"); |
| | | List<String> head5 = new ArrayList<String>(); |
| | | head5.add("联系电话"); |
| | | List<String> head6 = new ArrayList<String>(); |
| | | head6.add("照片"); |
| | | List<String> head7 = new ArrayList<String>(); |
| | | head7.add("户籍性质"); |
| | | head7.add("户籍性质(城镇户口、农村户口)"); |
| | | List<String> head8 = new ArrayList<String>(); |
| | | head8.add("户口所在地(身份证地址)"); |
| | | List<String> head9 = new ArrayList<String>(); |
| | | head9.add("本地/外地"); |
| | | List<String> head10 = new ArrayList<String>(); |
| | | head10.add("*街/路/巷"); |
| | | head10.add("*街/路/巷(如:格沙拉大道)"); |
| | | List<String> head11 = new ArrayList<String>(); |
| | | head11.add("*小区号(政府对于每个小区都有特定编号)"); |
| | | head11.add("*地址号(对于地址都有特定编号,如:格萨拉大道11号) 注:仅填写数字即可"); |
| | | List<String> head12 = new ArrayList<String>(); |
| | | head12.add("楼排号"); |
| | | head12.add("*楼排号(注:仅填写数字即可)"); |
| | | List<String> head13 = new ArrayList<String>(); |
| | | head13.add("单元号"); |
| | | head13.add("*单元号(注:仅填写数字即可.老式楼栋若没有单元划分则默认为一单元)"); |
| | | List<String> head14 = new ArrayList<String>(); |
| | | head14.add("户室(四位数表示。前两位楼层,后两位户号)"); |
| | | head14.add("户室(只能识别纯数字。根据实际有以下几种户室类型,请根据实际填写:①9楼1号—901;12楼10号—1210②没有楼层只有号。如9号—9:;13号—13)"); |
| | | List<String> head15 = new ArrayList<String>(); |
| | | head15.add("是否租住(是/否)"); |
| | | List<String> head16 = new ArrayList<String>(); |
| | |
| | | List<String> head17 = new ArrayList<String>(); |
| | | head17.add("房屋用途(住宅/公寓/宿舍/仓库/其他)"); |
| | | List<String> head18 = new ArrayList<String>(); |
| | | head18.add("控状态(常规/关注/管控)"); |
| | | head18.add("管控状态(常规/关注/管控)"); |
| | | List<String> head19 = new ArrayList<String>(); |
| | | head19.add("入伍时间"); |
| | | head19.add("入伍时间(初次发现日期(日期格式:2020/02/05)"); |
| | | List<String> head20 = new ArrayList<String>(); |
| | | head20.add("退伍时间"); |
| | | head20.add("退伍时间(日期格式:2020/02/05)"); |
| | | List<String> head21 = new ArrayList<String>(); |
| | | head21.add("人员类别"); |
| | | List<String> head22 = new ArrayList<String>(); |
| | |
| | | List<String> head1 = new ArrayList<String>(); |
| | | head1.add("*姓名"); |
| | | List<String> head2 = new ArrayList<String>(); |
| | | head2.add("*身份证号码"); |
| | | head2.add("*身份证(性别和年龄自动根据身份证号识别)"); |
| | | List<String> head3 = new ArrayList<String>(); |
| | | head3.add("办证状况"); |
| | | List<String> head4 = new ArrayList<String>(); |
| | |
| | | List<String> head8 = new ArrayList<String>(); |
| | | head8.add("联系电话"); |
| | | List<String> head9 = new ArrayList<String>(); |
| | | head9.add("*街/路/巷"); |
| | | head9.add("*街/路/巷(如:格沙拉大道)"); |
| | | List<String> head10 = new ArrayList<String>(); |
| | | head10.add("*小区号(政府对于每个小区都有特定编号)"); |
| | | head10.add("*地址号(对于地址都有特定编号,如:格萨拉大道11号) 注:仅填写数字即可"); |
| | | List<String> head11 = new ArrayList<String>(); |
| | | head11.add("楼排号"); |
| | | head11.add("*楼排号(注:仅填写数字即可)"); |
| | | List<String> head12 = new ArrayList<String>(); |
| | | head12.add("单元号"); |
| | | head12.add("*单元号(注:仅填写数字即可.老式楼栋若没有单元划分则默认为一单元)"); |
| | | List<String> head13 = new ArrayList<String>(); |
| | | head13.add("户室(四位数表示。前两位楼层,后两位户号)"); |
| | | head13.add("户室(只能识别纯数字。根据实际有以下几种户室类型,请根据实际填写:①9楼1号—901;12楼10号—1210②没有楼层只有号。如9号—9:;13号—13)"); |
| | | List<String> head14 = new ArrayList<String>(); |
| | | head14.add("是否租住(是/否)"); |
| | | List<String> head15 = new ArrayList<String>(); |
| | |
| | | List<String> head1 = new ArrayList<String>(); |
| | | head1.add("*姓名"); |
| | | List<String> head2 = new ArrayList<String>(); |
| | | head2.add("*身份证号码"); |
| | | head2.add("*身份证(性别和年龄自动根据身份证号识别)"); |
| | | List<String> head3 = new ArrayList<String>(); |
| | | head3.add("联系电话"); |
| | | List<String> head4 = new ArrayList<String>(); |
| | |
| | | List<String> head11 = new ArrayList<String>(); |
| | | head11.add("户主编码"); |
| | | List<String> head12 = new ArrayList<String>(); |
| | | head12.add("*街/路/巷"); |
| | | head12.add("*街/路/巷(如:格沙拉大道)"); |
| | | List<String> head13 = new ArrayList<String>(); |
| | | head13.add("*小区号(政府对于每个小区都有特定编号)"); |
| | | head13.add("*地址号(对于地址都有特定编号,如:格萨拉大道11号) 注:仅填写数字即可"); |
| | | List<String> head14 = new ArrayList<String>(); |
| | | head14.add("楼排号"); |
| | | head14.add("*楼排号(注:仅填写数字即可)"); |
| | | List<String> head15 = new ArrayList<String>(); |
| | | head15.add("单元号"); |
| | | head15.add("*单元号(注:仅填写数字即可.老式楼栋若没有单元划分则默认为一单元)"); |
| | | List<String> head16 = new ArrayList<String>(); |
| | | head16.add("户室(四位数表示。前两位楼层,后两位户号)"); |
| | | head16.add("户室(只能识别纯数字。根据实际有以下几种户室类型,请根据实际填写:①9楼1号—901;12楼10号—1210②没有楼层只有号。如9号—9:;13号—13)"); |
| | | List<String> head17 = new ArrayList<String>(); |
| | | head17.add("是否租住(是/否)"); |
| | | List<String> head18 = new ArrayList<String>(); |
| | |
| | | List<String> head41 = new ArrayList<String>(); |
| | | head41.add("纬度"); |
| | | List<String> head42 = new ArrayList<String>(); |
| | | head42.add("始发年月"); |
| | | head42.add("始发年月(初次发现日期(日期格式:2020/02/05)"); |
| | | List<String> head43 = new ArrayList<String>(); |
| | | head43.add("护理费"); |
| | | List<String> head44 = new ArrayList<String>(); |
| | |
| | | List<String> head4 = new ArrayList<String>(); |
| | | head4.add("是否租住"); |
| | | List<String> head5 = new ArrayList<String>(); |
| | | head5.add("*街/路/巷"); |
| | | head5.add("*街/路/巷(如:格沙拉大道)"); |
| | | List<String> head6 = new ArrayList<String>(); |
| | | head6.add("*小区号(政府对于每个小区都有特定编号)"); |
| | | head6.add("*地址号(对于地址都有特定编号,如:格萨拉大道11号) 注:仅填写数字即可"); |
| | | List<String> head7 = new ArrayList<String>(); |
| | | head7.add("楼排号"); |
| | | head7.add("*楼排号(注:仅填写数字即可)"); |
| | | List<String> head8 = new ArrayList<String>(); |
| | | head8.add("单元号"); |
| | | head8.add("*单元号(注:仅填写数字即可.老式楼栋若没有单元划分则默认为一单元)"); |
| | | List<String> head9 = new ArrayList<String>(); |
| | | head9.add("户室(四位数表示。前两位楼层,后两位户号)"); |
| | | head9.add("*户室(只能识别纯数字。根据实际有以下几种户室类型,请根据实际填写:①9楼1号—901;12楼10号—1210②没有楼层只有号。如9号—9:;13号—13)"); |
| | | List<String> head10 = new ArrayList<String>(); |
| | | head10.add("房屋状态(自住/租住/其他)"); |
| | | List<String> head11 = new ArrayList<String>(); |
| | |
| | | List<String> head4 = new ArrayList<String>(); |
| | | head4.add("是否租住"); |
| | | List<String> head5 = new ArrayList<String>(); |
| | | head5.add("*街/路/巷(社区内无住所可填写社区街路巷地址)"); |
| | | head5.add("*街/路/巷(如:格沙拉大道)"); |
| | | List<String> head6 = new ArrayList<String>(); |
| | | head6.add("*小区号(政府对于每个小区都有特定编号)(社区内无住所可填写社区街路巷号)"); |
| | | head6.add("*地址号(对于地址都有特定编号,如:格萨拉大道11号) 注:仅填写数字即可"); |
| | | List<String> head7 = new ArrayList<String>(); |
| | | head7.add("楼排号"); |
| | | head7.add("*楼排号(注:仅填写数字即可)"); |
| | | List<String> head8 = new ArrayList<String>(); |
| | | head8.add("单元号"); |
| | | head8.add("*单元号(注:仅填写数字即可.老式楼栋若没有单元划分则默认为一单元)"); |
| | | List<String> head9 = new ArrayList<String>(); |
| | | head9.add("户室(四位数表示。前两位楼层,后两位户号)"); |
| | | head9.add("*户室(只能识别纯数字。根据实际有以下几种户室类型,请根据实际填写:①9楼1号—901;12楼10号—1210②没有楼层只有号。如9号—9:;13号—13)"); |
| | | List<String> head10 = new ArrayList<String>(); |
| | | head10.add("房屋状态(自住/租住/其他)"); |
| | | List<String> head11 = new ArrayList<String>(); |
| | |
| | | * @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); |
| | | } |
| | | |
| | | /** |
| | |
| | | package com.panzhihua.service_community.api; |
| | | |
| | | import java.time.Instant; |
| | | import java.util.List; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | /** |
| | | * 获取所有产品分类 |
| | | * @return |
| | | * @param merchantId |
| | | */ |
| | | @GetMapping("/product-category/all") |
| | | public R getAllProductCategory() { |
| | | return convenientProductCategoryService.getAllProductCategory(); |
| | | public R getAllProductCategory(@RequestParam("merchantId") Long merchantId) { |
| | | return convenientProductCategoryService.getAllProductCategory(merchantId); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param authRecordId 需要排除的详情id |
| | | * @return 待审核高龄认证记录id集合 |
| | | */ |
| | | List<Long> getNextIds(@Param("communityId") Long communityId,@Param("authRecordId") Long authRecordId); |
| | | List<String> getNextIds(@Param("communityId") Long communityId,@Param("authRecordId") Long authRecordId); |
| | | } |
| | |
| | | AreaAddressVO getAreaAddress(@Param("provinceCode") String provinceCode, @Param("cityCode") String cityCode, |
| | | @Param("districtCode") String districtCode); |
| | | |
| | | @Select("select count(id) as populationTotal " |
| | | @Select("select count(cmpct.id) as populationTotal " |
| | | + ",(select count(cmpct.id) from com_mng_population_community_tags cmpct left join com_mng_population cmp on cmpct.population_id = cmp.id where cmpct.community_id = #{communityId} and cmp.out_or_local = 1) as localTotal " |
| | | + ",(select count(cmpct.id) from com_mng_population_community_tags cmpct left join com_mng_population cmp on cmpct.population_id = cmp.id where cmpct.community_id = #{communityId} and cmp.out_or_local = 2) as outTotal " |
| | | + ",(select count(cmpct.id) from com_mng_population_community_tags cmpct left join com_mng_population cmp on cmpct.population_id = cmp.id where cmpct.community_id = #{communityId} and IFNULL(cmpct.label,'') != '') as specialTotal " |
| | |
| | | + ",(select count(id) from com_mng_population_community_tags where community_id = #{communityId} and label LIKE CONCAT('%','退役军人','%')) as veteransTotal " |
| | | + ",(select count(id) from com_mng_population_community_tags where community_id = #{communityId} and label LIKE CONCAT('%','残疾人','%')) as disabilityTotal " |
| | | + ",(select count(id) from com_mng_population_community_tags where community_id = #{communityId} and label LIKE CONCAT('%','低保户','%')) as lowSecurityTotal " |
| | | + " from com_mng_population_community_tags as cmpct where community_id = #{communityId}") |
| | | + " from com_mng_population_community_tags as cmpct inner join com_mng_population as cmp on cmp.id = cmpct.population_id where community_id = #{communityId}") |
| | | ComMngPopulationTotalVO getPopulationTotalByAdmin(@Param("communityId") Long communityId); |
| | | |
| | | @Select("select count(id) as populationTotal," + |
| | |
| | | + "</foreach>" + " </script>") |
| | | Integer getPopulationVisitingCount(@Param("ids") List<Long> ids); |
| | | |
| | | /** |
| | | * 综治后台删除居民,并清理人口与社区绑定关系 |
| | | * @param ids 需要删除的人口id集合 |
| | | */ |
| | | void deletePopulaitonRelation(@Param("ids") List<Long> ids); |
| | | |
| | | @Select("<script> " + "SELECT " + " cmp.id, " + " cmp.`name`, " + " cmp.card_no as idCard, " |
| | | + " cmpct.label, " + " cmp.sex, " + " IFNULL( cmp.phone, '暂无' ) as phone, " + " cmp.address, " |
| | | + " cmp.political_outlook " + " FROM " |
| | |
| | | * @return ComPensionAuthRecordVO |
| | | */ |
| | | IdentityAuthRecordDetailVO findById(@Param("identityAuthId") Long identityAuthId); |
| | | |
| | | /** |
| | | * 查询养老认证待处理id集合 |
| | | * @param communityId 社区id |
| | | * @param authRecordId 养老认证记录id |
| | | * @return 养老认证待处理id集合 |
| | | */ |
| | | List<String> getNextIds(@Param("communityId") Long communityId,@Param("authRecordId") Long authRecordId); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | List<ConvenientConsultationStatisticsVO> selectSumForConsultationNum(); |
| | | |
| | | /** |
| | | * 获取商家总咨询量 |
| | | * @param merchantId |
| | | * @return |
| | | */ |
| | | int selectTotalConsultationVolume(@Param("merchantId") Long merchantId); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | List<ExportMerchantVO> exportMerchantByIds(@Param("needExportIds") List<Long> needExportIds); |
| | | |
| | | /** |
| | | * 批量更新商家营业状态 |
| | | * @param convenientMerchantDOList |
| | | * @param status |
| | | * @return |
| | | */ |
| | | int batchUpdateBusinessStatus(@Param("convenientMerchantDOList") List<ConvenientMerchantDO> convenientMerchantDOList, @Param("status") int status); |
| | | } |
| | |
| | | /** |
| | | * 查询所有分类 |
| | | * @return |
| | | * @param merchantId |
| | | */ |
| | | List<ConvenientProductCategoryVO> selectAllCategories(); |
| | | List<ConvenientProductCategoryVO> selectAllCategories(@Param("merchantId") Long merchantId); |
| | | } |
| | |
| | | /** |
| | | * 删除传入ID以外的关联 |
| | | * @param notNeedDelIds |
| | | * @param productId |
| | | * @return |
| | | */ |
| | | int deleteLoseRelationSpecifications(@Param("notNeedDelIds") List<Long> notNeedDelIds); |
| | | int deleteLoseRelationSpecifications(@Param("notNeedDelIds") List<Long> notNeedDelIds, @Param("productId") Long productId); |
| | | |
| | | /** |
| | | * 通过产品ID删除相关规格 |
| | |
| | | * @return |
| | | */ |
| | | List<ConvenientViewStatisticsVO> selectSumForViewNum(); |
| | | |
| | | /** |
| | | * 获取商家总浏览量 |
| | | * @param merchantId |
| | | * @return |
| | | */ |
| | | int selectTotalViewNum(@Param("merchantId") Long merchantId); |
| | | } |
| | |
| | | /** |
| | | * 标签集合(多个标签以,隔开) |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private String label; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 标签集合(多个标签以,隔开) |
| | | */ |
| | | @TableField(fill = FieldFill.UPDATE) |
| | | @TableField(fill = FieldFill.UPDATE,updateStrategy = FieldStrategy.IGNORED) |
| | | private String label; |
| | | |
| | | /** |
| | |
| | | */ |
| | | private String name; |
| | | /** |
| | | * 分类所属商家 |
| | | */ |
| | | private Long merchantId; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String remark; |
| | |
| | | */ |
| | | private Boolean onShelf; |
| | | /** |
| | | * 上架时间 |
| | | */ |
| | | private Date onShelfAt; |
| | | /** |
| | | * 产品介绍 |
| | | */ |
| | | private String introduction; |
| | |
| | | * 特殊群体id |
| | | * @return 删除结果 |
| | | */ |
| | | R deleteSpecialInputUser(Long id); |
| | | R deleteSpecialInputUser(Long id,Long communityId); |
| | | |
| | | /** |
| | | * 基础数据》特殊群体》分页查询标签列表 |
| | |
| | | /** |
| | | * 获取所有产品分类 |
| | | * @return |
| | | * @param merchantId |
| | | */ |
| | | R getAllProductCategory(); |
| | | R getAllProductCategory(Long merchantId); |
| | | } |
| | |
| | | administratorsUserVO.setRoleId(comActCommiteeVO.getRoleId()); |
| | | administratorsUserVO.setCommunityId(comActCommiteeVO.getCommunityId()); |
| | | administratorsUserVO.setAreaId(comActCommiteeVO.getAreaId()); |
| | | administratorsUserVO.setPhone(comActCommiteeVO.getPhone()); |
| | | administratorsUserVO.setName(comActCommiteeVO.getName()); |
| | | R r=userService.addUserBackstageProperty(administratorsUserVO); |
| | | if(R.isOk(r)){ |
| | | comActCommittee.setUserId(Long.parseLong(r.getData().toString())); |
| | |
| | | } else { |
| | | comActDiscussDO.setStatus(ComActDiscussDO.status.yfb); |
| | | } |
| | | comActDiscussDO.setUpdateAt(new Date()); |
| | | comActDiscussDO.setUpdateAt(nowDate); |
| | | int insert = comActDiscussDAO.updateById(comActDiscussDO); |
| | | if (insert > 0) { |
| | | //如果是投票,需要把投票的选项存储 |
| | |
| | | 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("新增失败"); |
| | | } |
| | | |
| | | /** |
| | |
| | | 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("编辑失败"); |
| | | } |
| | | |
| | | /** |
| | |
| | | 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("删除失败"); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | page.setSize(pageSize); |
| | | page.setCurrent(pageNum); |
| | | |
| | | try { |
| | | //关键词为空时需要进行加密,通过加密去检索身份证号筛选高龄认证记录 |
| | | String idCard = AESUtil.encrypt128(pageElderAuthRecordsDTO.getSearchKey(), aesKey); |
| | | pageElderAuthRecordsDTO.setIdCard(idCard); |
| | | }catch (Exception e){ |
| | | log.error("查询高龄认证记录转换身份证号失败"); |
| | | } |
| | | |
| | | IPage<ComElderAuthRecordVO> iPage = comElderAuthRecordsDAO.pageElderAuthRecords(page, pageElderAuthRecordsDTO); |
| | | if (!iPage.getRecords().isEmpty()) { |
| | | iPage.getRecords().forEach(comElderAuthRecordVO -> { |
| | |
| | | } |
| | | // 查询该房屋的住户信息 |
| | | List<PopulationListVO> populationList = |
| | | this.baseMapper.getGridVillageBuildingPopulationList(buildingHouseDetailVO.getId(), null, 1); |
| | | this.baseMapper.getGridVillageBuildingPopulationList(buildingHouseDetailVO.getId(), null, null); |
| | | if (!populationList.isEmpty()) { |
| | | populationList.forEach(population -> { |
| | | try { |
| | |
| | | * @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 { |
| | |
| | | return R.fail("您选择的数据中存在被引用的,无法删除"); |
| | | } |
| | | this.baseMapper.deleteBatchIds(ids); |
| | | //删除人口并删除人口和社区关联关系 |
| | | this.baseMapper.deletePopulaitonRelation(ids); |
| | | return R.ok("删除成功"); |
| | | } |
| | | |
| | |
| | | |
| | | 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; |
| | |
| | | @Override |
| | | 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); |
| | | } |
| | | |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.vos.community.convenient.ExportMerchantVO; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | import com.panzhihua.common.model.vos.community.convenient.ConvenientProductSpecificationVO; |
| | | import com.panzhihua.common.model.vos.community.convenient.ConvenientProductVO; |
| | | import com.panzhihua.common.model.vos.community.convenient.ConvenientViewStatisticsVO; |
| | | import com.panzhihua.common.model.vos.community.convenient.ExportMerchantVO; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.service_community.dao.ComActDAO; |
| | | import com.panzhihua.service_community.dao.ConvenientConsultationStatisticsDAO; |
| | |
| | | import com.panzhihua.service_community.model.dos.ConvenientViewStatisticsDO; |
| | | import com.panzhihua.service_community.service.ConvenientMerchantService; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * @title: ConvenientMerchantServiceImpl |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | |
| | | * @date: 2021/09/16 16:14 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class ConvenientMerchantServiceImpl extends ServiceImpl<ConvenientMerchantDAO, ConvenientMerchantDO> implements ConvenientMerchantService { |
| | | |
| | | @Resource |
| | |
| | | }); |
| | | } |
| | | BeanUtils.copyProperties(convenientMerchantDTO, convenientMerchantDO); |
| | | convenientMerchantDO.setIntroduction(convenientMerchantDTO.getIntroduction()); |
| | | this.baseMapper.updateById(convenientMerchantDO); |
| | | return R.ok(); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public R disableOrEnableMerchant(DisableOrEnableConvenientMerchantDTO disableOrEnableConvenientMerchantDTO) { |
| | | List<ConvenientMerchantDO> convenientMerchantDOList = this.baseMapper.selectList(new QueryWrapper<ConvenientMerchantDO>() |
| | | .lambda().in(ConvenientMerchantDO::getId, disableOrEnableConvenientMerchantDTO.getIds())); |
| | | List<Long> userIds = convenientMerchantDOList.stream().map(ConvenientMerchantDO::getUserId).collect(Collectors.toList()); |
| | | disableOrEnableConvenientMerchantDTO.setUserIds(userIds); |
| | | R result = userService.disableOrEnableMerchantUsers(disableOrEnableConvenientMerchantDTO); |
| | | int type = disableOrEnableConvenientMerchantDTO.getType().intValue(); |
| | | if (type == 2) { |
| | | this.baseMapper.batchUpdateBusinessStatus(convenientMerchantDOList, 0); |
| | | } |
| | | if (R.isOk(result)) { |
| | | return R.ok(); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public R resetPasswordMerchant(ResetPasswordConvenientMerchantDTO resetPasswordConvenientMerchantDTO) { |
| | | List<ConvenientMerchantDO> convenientMerchantDOList = this.baseMapper.selectList(new QueryWrapper<ConvenientMerchantDO>() |
| | | .lambda().in(ConvenientMerchantDO::getId, resetPasswordConvenientMerchantDTO.getIds())); |
| | | List<Long> userIds = convenientMerchantDOList.stream().map(ConvenientMerchantDO::getUserId).collect(Collectors.toList()); |
| | | EventGridMemberPassResetDTO eventGridMemberPassResetDTO = new EventGridMemberPassResetDTO(); |
| | | eventGridMemberPassResetDTO.setPassword(resetPasswordConvenientMerchantDTO.getPassword()); |
| | | eventGridMemberPassResetDTO.setIds(resetPasswordConvenientMerchantDTO.getIds()); |
| | | eventGridMemberPassResetDTO.setIds(userIds); |
| | | return userService.gridMemberPassReset(eventGridMemberPassResetDTO); |
| | | } |
| | | |
| | |
| | | SimpleDateFormat dayFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String moth = mothFormat.format(nowDate); |
| | | String day = dayFormat.format(nowDate); |
| | | int consultationCount = convenientConsultationStatisticsDAO.selectTotalConsultationVolume(merchantId); |
| | | int monthConsultationVolume = convenientConsultationStatisticsDAO.selectMonthConsultationVolume(merchantId, moth); |
| | | int dayConsultationVolume = convenientConsultationStatisticsDAO.selectDayConsultationVolume(merchantId, day); |
| | | Integer viewCount = convenientViewStatisticsDAO.selectTotalViewNum(merchantId); |
| | | int monthViewNum = convenientViewStatisticsDAO.selectMonthViewNum(merchantId, moth); |
| | | int dayViewNum = convenientViewStatisticsDAO.selectDayViewNum(merchantId, day); |
| | | convenientMerchantVO.setConsultationVolume(consultationCount); |
| | | convenientMerchantVO.setViewNum(viewCount); |
| | | convenientMerchantVO.setMonthConsultationVolume(monthConsultationVolume); |
| | | convenientMerchantVO.setDayConsultationVolume(dayConsultationVolume); |
| | | convenientMerchantVO.setMonthViewNum(monthViewNum); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R getAllProductCategory() { |
| | | return R.ok(this.baseMapper.selectAllCategories()); |
| | | public R getAllProductCategory(Long merchantId) { |
| | | return R.ok(this.baseMapper.selectAllCategories(merchantId)); |
| | | } |
| | | } |
| | |
| | | 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(); |
| | |
| | | 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()); |
| | | //删除已失去关联的规格 |
| | | convenientProductSpecificationDAO.deleteLoseRelationSpecifications(notNeedDelIds); |
| | | Date nowDate = new Date(); |
| | | List<Long> notNeedDelIds = new ArrayList<>(); |
| | | productSpecificationDTOList.forEach(specificationDTO -> { |
| | | Long specificationId = specificationDTO.getId(); |
| | | if (isNull(specificationId)) { |
| | |
| | | convenientProductSpecificationDO.setCreatedAt(nowDate); |
| | | convenientProductSpecificationDO.setCreatedBy(updatedBy); |
| | | convenientProductSpecificationDAO.insert(convenientProductSpecificationDO); |
| | | notNeedDelIds.add(convenientProductSpecificationDO.getId()); |
| | | } else { |
| | | //更新 |
| | | ConvenientProductSpecificationDO convenientProductSpecificationDO = convenientProductSpecificationDAO.selectById(specificationId); |
| | | BeanUtils.copyProperties(specificationDTO, convenientProductSpecificationDO); |
| | | convenientProductSpecificationDO.setUpdatedBy(updatedBy); |
| | | convenientProductSpecificationDAO.updateById(convenientProductSpecificationDO); |
| | | notNeedDelIds.add(specificationId); |
| | | } |
| | | }); |
| | | //删除已失去关联的规格 |
| | | convenientProductSpecificationDAO.deleteLoseRelationSpecifications(notNeedDelIds, productId); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | List<ConvenientProductVO> productVOList = this.baseMapper.getMerchantProduct(merchantId); |
| | | List<ConvenientProductSpecificationVO> specificationVOList = this.baseMapper.getProductSpecifications(merchantId); |
| | | List<ConvenientProductLevelInfoVO> levelInfoVOList = new ArrayList<>(); |
| | | List<String> categoryList = new ArrayList<>(); |
| | | if (!productVOList.isEmpty()) { |
| | | productVOList.forEach(productVO -> { |
| | | List<ConvenientProductSpecificationVO> currentProductSpecificationVOList = new ArrayList<>(); |
| | |
| | | } |
| | | }); |
| | | productVO.setProductSpecificationVOList(currentProductSpecificationVOList); |
| | | if (!categoryList.contains(productVO.getCategoryName())) { |
| | | categoryList.add(productVO.getCategoryName()); |
| | | } |
| | | }); |
| | | //分类 |
| | | Map<String, List<ConvenientProductVO>> levelGroup = productVOList.stream() |
| | | .collect(Collectors.groupingBy(ConvenientProductVO::getCategoryName)); |
| | | Set<String> categoryNames = levelGroup.keySet(); |
| | | Iterator<String> iterator = categoryNames.iterator(); |
| | | while (iterator.hasNext()) { |
| | | String categoryName = iterator.next(); |
| | | categoryList.forEach(category -> { |
| | | ConvenientProductLevelInfoVO levelInfoVOLevelInfoVO = new ConvenientProductLevelInfoVO(); |
| | | levelInfoVOLevelInfoVO.setCategoryName(categoryName); |
| | | List<ConvenientProductVO> productVOS = levelGroup.get(categoryName); |
| | | levelInfoVOLevelInfoVO.setCategoryName(category); |
| | | List<ConvenientProductVO> productVOS = levelGroup.get(category); |
| | | List<ConvenientProductVO> sortedProductVOS = productVOS.stream() |
| | | .sorted(Comparator.comparing(ConvenientProductVO::getOnShelfAt).reversed()).collect(Collectors.toList()); |
| | | levelInfoVOLevelInfoVO.setProductVOList(sortedProductVOS); |
| | | levelInfoVOList.add(levelInfoVOLevelInfoVO); |
| | | } |
| | | }); |
| | | } |
| | | return R.ok(levelInfoVOList); |
| | | } |
| | |
| | | if (!records.isEmpty()) { |
| | | List<Long> productIds = records.stream().map(ConvenientProductVO::getId).collect(Collectors.toList()); |
| | | List<ConvenientProductSpecificationDO> specificationDOS = convenientProductSpecificationDAO |
| | | .selectList(new LambdaQueryWrapper<ConvenientProductSpecificationDO>().in(ConvenientProductSpecificationDO::getProductId, productIds)); |
| | | .selectList(new LambdaQueryWrapper<ConvenientProductSpecificationDO>() |
| | | .eq(ConvenientProductSpecificationDO::getIsDel, false).in(ConvenientProductSpecificationDO::getProductId, productIds)); |
| | | List<ConvenientProductSpecificationVO> specificationVOList = new ArrayList<>(); |
| | | if (!specificationDOS.isEmpty()) { |
| | | specificationDOS.forEach(specificationDO -> { |
| | |
| | | </select> |
| | | <select id="getIndexTopActivityList" resultMap="BaseResultMap"> |
| | | SELECT * FROM `com_act_activity` |
| | | WHERE community_id = #{communityId} and is_top = 1 and sign_up_end >= now() and sign_up_begin <= now() |
| | | WHERE community_id = #{communityId} and is_top = 1 and sign_up_end >= now() |
| | | </select> |
| | | </mapper> |
| | |
| | | </resultMap> |
| | | |
| | | <select id="pageList" resultType="com.panzhihua.common.model.vos.community.ComActCommiteeVO"> |
| | | select t.*,t1.account,t1.password,t2.name as areaName,t3.role_id as roleId from com_act_committee t |
| | | select t.*,t1.account,t1.password,t2.address as areaName,t3.role_id as roleId from com_act_committee t |
| | | left join sys_user t1 on t.user_id = t1.user_id |
| | | left join com_mng_village t2 on t.area_id = t2.village_id |
| | | left join sys_user_role t3 on t.user_id = t3.user_id |
| | |
| | | COUNT( c1.id ) replyNum, |
| | | c.create_at, |
| | | c.is_topping, |
| | | c.is_author, |
| | | c.id |
| | | FROM |
| | | com_act_discuss_comment c |
| | |
| | | and t.position like concat(#{commonPage.position},'%') |
| | | </if> |
| | | <if test="commonPage.keyword !=null and commonPage.keyword !=''"> |
| | | and (t1.name like concat(#{commonPage.keyword},'%') or t1.phone like concat(#{commonPage.keyword},'%') or t.jurisdiction_content like concat(#{commonPage.keyword},'%')) |
| | | and (t1.name like concat(#{commonPage.keyword},'%') or t1.phone like concat(#{commonPage.keyword},'%') or t.jurisdiction_content like concat('%',#{commonPage.keyword},'%')) |
| | | </if> |
| | | <if test="commonPage.status !=null"> |
| | | and t1.status =#{commonPage.status} |
| | |
| | | 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 |
| | |
| | | SELECT |
| | | carr.id, |
| | | su.nick_name, |
| | | su1.`name` as handleName, |
| | | carr.`name`, |
| | | carr.phone, |
| | | carr.reserve_time, |
| | |
| | | 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 != """> |
| | | AND carr.reserve_time <![CDATA[ >= ]]> #{pageMakeDTO.startTime} |
| | |
| | | SELECT |
| | | carr.id, |
| | | su.nick_name, |
| | | su1.`name` as handleName, |
| | | carr.`name`, |
| | | carr.phone, |
| | | carr.reserve_time, |
| | |
| | | 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> |
| | | |
| | |
| | | SELECT |
| | | carr.id, |
| | | su.nick_name, |
| | | su.`name` as handleName, |
| | | carr.`name`, |
| | | carr.phone, |
| | | carr.reserve_time, |
| | |
| | | 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 != """> |
| | | AND carr.reserve_time <![CDATA[ >= ]]> #{pageMakeDTO.startTime} |
| | |
| | | SELECT |
| | | carr.id, |
| | | su.nick_name, |
| | | su1.`name` as handleName, |
| | | carr.`name`, |
| | | carr.phone, |
| | | carr.reserve_time, |
| | |
| | | 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 |
| | |
| | | and cear.auth_method = #{pageElderAuthRecordsDTO.authMethod} |
| | | </if> |
| | | <if test="pageElderAuthRecordsDTO.authDateBegin != null and pageElderAuthRecordsDTO.authDateBegin != ''"> |
| | | and cear.auth_date after #{pageElderAuthRecordsDTO.authDateBegin} |
| | | and cear.auth_date <![CDATA[ >= ]]> #{pageElderAuthRecordsDTO.authDateBegin} |
| | | </if> |
| | | <if test="pageElderAuthRecordsDTO.authDateEnd != null and pageElderAuthRecordsDTO.authDateEnd != ''"> |
| | | and cear.auth_date before #{pageElderAuthRecordsDTO.authDateEnd} |
| | | and cear.auth_date <![CDATA[ <= ]]> #{pageElderAuthRecordsDTO.authDateEnd} |
| | | </if> |
| | | <if test="pageElderAuthRecordsDTO.approvalStatus != null and pageElderAuthRecordsDTO.approvalStatus != 0"> |
| | | and cear.approval_status = #{pageElderAuthRecordsDTO.approvalStatus} |
| | |
| | | </if> |
| | | <if test="pageElderAuthRecordsDTO.searchKey != null and pageElderAuthRecordsDTO.searchKey != ''"> |
| | | and (ceae.`name` like concat ('%', #{pageElderAuthRecordsDTO.searchKey}, '%') |
| | | or cear.mark like concat ('%', #{pageElderAuthRecordsDTO.searchKey}, '%')) |
| | | or cear.mark like concat ('%', #{pageElderAuthRecordsDTO.searchKey}, '%') |
| | | or ceae.id_card = #{pageElderAuthRecordsDTO.idCard}) |
| | | </if> |
| | | order by cear.create_at desc |
| | | </select> |
| | |
| | | order by ceahr.create_at desc |
| | | </select> |
| | | |
| | | <select id="getNextIds" resultType="long"> |
| | | <select id="getNextIds" resultType="String"> |
| | | select id from com_elder_auth_records where approval_status = 1 and community_id = #{communityId} and id != #{authRecordId} |
| | | </select> |
| | | |
| | |
| | | select t.village_id as villageId,concat(t.alley,t.house_num,'号') as villageName,t1.id,concat(t1.unit_no,'栋',t1.floor,'单元',t1.code,'号') as name from com_mng_village t left join com_mng_population_house t1 on t.village_id = t1.village_id where t.community_id=#{communityId} and t1.id is not null |
| | | </select> |
| | | |
| | | <delete id="deletePopulaitonRelation"> |
| | | delete from com_mng_population_community_tags where population_id in |
| | | <foreach item="item" collection="ids" separator="," open="(" close=")" index=""> |
| | | #{item} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <select id="pagePopulation" resultType="com.panzhihua.common.model.vos.community.ComMngPopulationVO"> |
| | | SELECT cmp.`name`, cmp.id, cmp.street_id, cmp.act_id, |
| | | cmp.village_id, cmp.sex, cmp.card_no, cmp.road, cmp.door_no, cmp.floor, |
| | | cmp.unit_no, cmp.house_no, cmp.political_outlook, cmp.work_company, |
| | | cmp.special_situation, cmp.phone, cmp.remark, cmp.native_place, cmp.nation, |
| | | cmpct.label, cmp.marriage, cmp.culture_level, cmp.profession, cmp.out_or_local, |
| | | cmp.census_register, cmp.healthy, cmp.birthday, cmp.update_at, cmp.address, |
| | | cmp.is_rent FROM com_mng_population AS cmp |
| | | LEFT JOIN com_mng_population_community_tags AS cmpct ON cmp.id = cmpct.population_id |
| | | <where> |
| | | <if test='comMngPopulationVO.name != null and comMngPopulationVO.name != ""'> |
| | | AND cmp.`name` LIKE concat(#{comMngPopulationVO.name},'%') </if> |
| | | <if test='comMngPopulationVO.label != null and comMngPopulationVO.label != ""'> |
| | | AND cmpct.label LIKE concat('%',#{comMngPopulationVO.label},'%') </if> |
| | | <if test='comMngPopulationVO.actId != null'> and cmpct.community_id = #{comMngPopulationVO.actId} |
| | | </if> <if test='comMngPopulationVO.outOrLocal != null'> |
| | | and cmp.out_or_local = #{comMngPopulationVO.outOrLocal} </if> |
| | | <if test='comMngPopulationVO.villageId != null and comMngPopulationVO.villageId != ""'> |
| | | and cmp.village_id = #{comMngPopulationVO.villageId} </if> |
| | | <if test='comMngPopulationVO.road != null and comMngPopulationVO.road != ""'> |
| | | AND cmp.road = #{comMngPopulationVO.road} </if> |
| | | <if test='comMngPopulationVO.doorNo != null and comMngPopulationVO.doorNo != ""'> |
| | | AND cmp.door_no = #{comMngPopulationVO.doorNo} </if> |
| | | <if test='comMngPopulationVO.floor != null and comMngPopulationVO.floor != ""'> |
| | | AND cmp.floor = #{comMngPopulationVO.floor} </if> |
| | | <if test='comMngPopulationVO.unitNo != null and comMngPopulationVO.unitNo != ""'> |
| | | AND cmp.unit_no = #{comMngPopulationVO.unitNo} </if> |
| | | <if test='comMngPopulationVO.houseNo != null and comMngPopulationVO.houseNo != ""'> |
| | | AND cmp.house_no = #{comMngPopulationVO.houseNo} </if> |
| | | <if test='comMngPopulationVO.sex != null and comMngPopulationVO.sex != ""'> |
| | | AND cmp.sex = #{comMngPopulationVO.sex} </if> |
| | | <if test='comMngPopulationVO.ageStartTime != null and comMngPopulationVO.ageStartTime != "" and comMngPopulationVO.ageEndTime == null'> |
| | | AND date_format(cmp.birthday,'%Y-%m-%d') <![CDATA[ <= ]]> #{comMngPopulationVO.ageStartTime} </if> |
| | | <if test='comMngPopulationVO.ageEndTime != null and comMngPopulationVO.ageEndTime != "" and comMngPopulationVO.ageStartTime == null'> |
| | | AND date_format(cmp.birthday,'%Y-%m-%d') <![CDATA[ >= ]]> #{comMngPopulationVO.ageEndTime} </if> |
| | | <if test='comMngPopulationVO.ageStartTime != null and comMngPopulationVO.ageEndTime != null and comMngPopulationVO.ageStartTime == comMngPopulationVO.ageEndTime'> |
| | | AND cmp.birthday BETWEEN #{comMngPopulationVO.ageStartTimeEnd} and #{comMngPopulationVO.ageEndTime} |
| | | </if> |
| | | <if test='comMngPopulationVO.ageStartTime != null and comMngPopulationVO.ageEndTime != null and comMngPopulationVO.ageStartTime != comMngPopulationVO.ageEndTime'> |
| | | AND cmp.birthday BETWEEN #{comMngPopulationVO.ageEndTimeEnd} and #{comMngPopulationVO.ageStartTime} |
| | | </if> |
| | | <if test='comMngPopulationVO.nativePlace != null and comMngPopulationVO.nativePlace != ""'> |
| | | AND cmp.native_place LIKE concat(#{comMngPopulationVO.nativePlace},'%') </if> |
| | | <if test='comMngPopulationVO.nation != null and comMngPopulationVO.nation != ""'> |
| | | AND cmp.nation = #{comMngPopulationVO.nation} </if> |
| | | <if test='comMngPopulationVO.politicalOutlook != null and comMngPopulationVO.politicalOutlook != ""'> |
| | | AND cmp.political_outlook = #{comMngPopulationVO.politicalOutlook} </if> |
| | | <if test='comMngPopulationVO.cardNo != null and comMngPopulationVO.cardNo != ""'> |
| | | AND cmp.card_no = #{comMngPopulationVO.cardNo} </if> |
| | | <if test='comMngPopulationVO.remark != null and comMngPopulationVO.remark != ""'> |
| | | AND cmp.remark = #{comMngPopulationVO.remark} </if> |
| | | <if test='comMngPopulationVO.keyWord != null and comMngPopulationVO.keyWord != ""'> |
| | | AND (cmp.`name` like concat (#{comMngPopulationVO.keyWord},'%') or |
| | | cmp.card_no_str = #{comMngPopulationVO.keyWord} or cmpct.label like concat ('%',#{comMngPopulationVO.keyWord},'%') |
| | | ) |
| | | </if> |
| | | </where> |
| | | order by cmp.create_at desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | cpar.auth_method, |
| | | cpar.auth_video, |
| | | cpar.approval_status, |
| | | cpar.community_id, |
| | | cpar.id, |
| | | su1.`name` as approverName, |
| | | cpar.approval_date |
| | |
| | | LEFT JOIN `com_act` ca ON cpap.community_id = ca.community_id |
| | | WHERE cpar.id = #{identityAuthId} |
| | | </select> |
| | | |
| | | <select id="getNextIds" resultType="String"> |
| | | select id from com_pension_auth_records where approval_status = 1 and community_id = #{communityId} and id != #{authRecordId} |
| | | </select> |
| | | </mapper> |
| | |
| | | </resultMap> |
| | | |
| | | <select id="pageList" resultType="com.panzhihua.common.model.vos.community.ComPropertyVO"> |
| | | select t.*,t1.account,t1.password,t2.name as areaName,t3.role_id as roleId from com_property t |
| | | select t.*,t1.account,t1.password,t2.address as areaName,t3.role_id as roleId from com_property t |
| | | left join sys_user t1 on t.user_id = t1.user_id |
| | | left join com_mng_village t2 on t.area_id = t2.village_id |
| | | left join sys_user_role t3 on t.user_id = t3.user_id |
| | |
| | | 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> |
| | |
| | | AND ccm.business_status = #{pageConvenientMerchantDTO.businessStatus} |
| | | </if> |
| | | <if test="pageConvenientMerchantDTO.keyword != null and pageConvenientMerchantDTO.keyword != """> |
| | | AND ccm.name LIKE CONCAT('%', #{pageConvenientMerchantDTO.keyword}, '%') |
| | | AND ccm.address LIKE CONCAT('%', #{pageConvenientMerchantDTO.keyword}, '%') |
| | | AND ccm.phone LIKE CONCAT('%', #{pageConvenientMerchantDTO.keyword}, '%') |
| | | AND ( |
| | | ccm.name LIKE CONCAT('%', #{pageConvenientMerchantDTO.keyword}, '%') |
| | | OR ccm.address LIKE CONCAT('%', #{pageConvenientMerchantDTO.keyword}, '%') |
| | | OR ccm.phone LIKE CONCAT('%', #{pageConvenientMerchantDTO.keyword}, '%') |
| | | ) |
| | | </if> |
| | | GROUP BY ccm.id |
| | | GROUP BY ccm.id ORDER BY ccm.created_at DESC |
| | | </select> |
| | | <select id="selectMerchantById" resultType="com.panzhihua.common.model.vos.community.convenient.ConvenientMerchantVO"> |
| | | SELECT ccm.*, su.account, su.status AS accountStatus |
| | |
| | | FROM com_convenient_merchants ccm |
| | | LEFT JOIN com_convenient_consultation_statistics cccs ON ccm.id = cccs.merchant_id |
| | | LEFT JOIN com_convenient_service_scope ccss ON ccm.id = ccss.merchant_id |
| | | WHERE ccm.community_id = #{communityId} AND (cccs.statistic_date LIKE #{currentMon} OR cccs.statistic_date IS NULL) GROUP BY cccs.id |
| | | WHERE ccm.community_id = #{communityId} AND ccm.business_status = 1 AND (cccs.statistic_date LIKE #{currentMon} OR cccs.statistic_date IS NULL) GROUP BY cccs.id |
| | | ) temp GROUP BY temp.id ORDER BY SUM(temp.consultation_volume) DESC |
| | | </select> |
| | | <select id="getClassifyMerchants" resultType="com.panzhihua.common.model.vos.community.convenient.ConvenientMerchantVO"> |
| | |
| | | FROM com_convenient_merchants ccm |
| | | LEFT JOIN com_convenient_consultation_statistics cccs ON ccm.id = cccs.merchant_id |
| | | LEFT JOIN com_convenient_service_scope ccss ON ccm.id = ccss.merchant_id |
| | | WHERE ccm.community_id = #{pageClassifyMerchantDTO.communityId} AND ccss.service_category_id = #{pageClassifyMerchantDTO.serviceId} |
| | | WHERE ccm.community_id = #{pageClassifyMerchantDTO.communityId} AND ccm.business_status = 1 AND ccss.service_category_id = #{pageClassifyMerchantDTO.serviceId} |
| | | AND (cccs.statistic_date LIKE #{currentMon} OR cccs.statistic_date IS NULL) GROUP BY cccs.id |
| | | ) temp GROUP BY temp.id ORDER BY SUM(temp.consultation_volume) DESC |
| | | </select> |
| | |
| | | ccm.id, ccm.name, ccm.introduction, ccm.logo, ccm.phone, ccm.begin_at, ccm.end_at, ccm.period, |
| | | ccm.address, ccm.lat, ccm.lon, cccs.consultation_volume,GROUP_CONCAT(ccss.service_name) AS serviceScope |
| | | FROM com_convenient_merchants ccm |
| | | INNER JOIN com_convenient_consultation_statistics cccs ON ccm.id = cccs.merchant_id |
| | | LEFT JOIN com_convenient_consultation_statistics cccs ON ccm.id = cccs.merchant_id |
| | | LEFT JOIN com_convenient_service_scope ccss ON ccm.id = ccss.merchant_id |
| | | WHERE ccm.id = #{merchantId} AND (cccs.statistic_date LIKE #{currentMon} OR cccs.statistic_date IS NULL) GROUP BY cccs.id |
| | | ) temp GROUP BY temp.id ORDER BY SUM(temp.consultation_volume) DESC |
| | |
| | | FROM com_convenient_merchants ccm |
| | | INNER JOIN com_convenient_consultation_statistics cccs ON ccm.id = cccs.merchant_id |
| | | LEFT JOIN com_convenient_service_scope ccss ON ccm.id = ccss.merchant_id |
| | | WHERE ccm.community_id = #{pageSearchDTO.communityId} AND ccm.`name` LIKE CONCAT('%', #{pageSearchDTO.keyword}, '%') |
| | | WHERE ccm.community_id = #{pageSearchDTO.communityId} AND ccm.business_status = 1 AND ccm.`name` LIKE CONCAT('%', #{pageSearchDTO.keyword}, '%') |
| | | AND ccm.is_del = 0 AND (cccs.statistic_date LIKE #{currentMon} OR cccs.statistic_date IS NULL) GROUP BY cccs.id |
| | | ) temp GROUP BY temp.id ORDER BY SUM(temp.consultation_volume) DESC |
| | | </select> |
| | |
| | | AND ccm.business_status = #{exportMerchantDTO.businessStatus} |
| | | </if> |
| | | <if test="exportMerchantDTO.keyword != null and exportMerchantDTO.keyword != """> |
| | | AND ccm.name LIKE CONCAT('%', #{exportMerchantDTO.keyword}, '%') |
| | | AND ccm.address LIKE CONCAT('%', #{exportMerchantDTO.keyword}, '%') |
| | | AND ccm.phone LIKE CONCAT('%', #{exportMerchantDTO.keyword}, '%') |
| | | AND ( |
| | | ccm.name LIKE CONCAT('%', #{exportMerchantDTO.keyword}, '%') |
| | | OR ccm.address LIKE CONCAT('%', #{exportMerchantDTO.keyword}, '%') |
| | | OR ccm.phone LIKE CONCAT('%', #{exportMerchantDTO.keyword}, '%') |
| | | ) |
| | | </if> |
| | | GROUP BY ccm.id |
| | | </select> |
| | |
| | | </foreach> |
| | | END |
| | | </update> |
| | | <update id="batchUpdateBusinessStatus"> |
| | | UPDATE `com_convenient_merchants` SET business_status = #{status} |
| | | WHERE id IN |
| | | <foreach collection="convenientMerchantDOList" open="(" separator="," close=")" item="item" index="index"> |
| | | #{item.id} |
| | | </foreach> |
| | | </update> |
| | | </mapper> |
| | |
| | | <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ConvenientProductCategoryDO"> |
| | | <id column="id" property="id" /> |
| | | <id column="name" property="name" /> |
| | | <id column="merchant_id" property="merchantId" /> |
| | | <id column="remark" property="remark" /> |
| | | <id column="weight" property="weight" /> |
| | | <id column="is_del" property="isDel" /> |
| | |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id,`name`,remark,weight,is_del,created_at,created_by,updated_at,updated_by |
| | | id,`name`,merchant_id,remark,weight,is_del,created_at,created_by,updated_at,updated_by |
| | | </sql> |
| | | <select id="pageProductCategory" resultType="com.panzhihua.common.model.vos.community.convenient.ConvenientProductCategoryVO"> |
| | | SELECT <include refid="Base_Column_List"/> |
| | | FROM com_convenient_product_categories |
| | | WHERE is_del = 0 |
| | | WHERE is_del = 0 AND merchant_id = #{pageConvenientProductCategoryDTO.merchantId} |
| | | <if test="pageConvenientProductCategoryDTO.name != null and pageConvenientProductCategoryDTO.name.trim() != """> |
| | | AND `name` LIKE concat('%', #{pageConvenientProductCategoryDTO.name}, '%' ) |
| | | </if> |
| | |
| | | <select id="selectAllCategories" resultType="com.panzhihua.common.model.vos.community.convenient.ConvenientProductCategoryVO"> |
| | | SELECT <include refid="Base_Column_List"/> |
| | | FROM com_convenient_product_categories |
| | | WHERE is_del = 0 ORDER BY weight DESC |
| | | WHERE is_del = 0 AND merchant_id = #{merchantId} ORDER BY weight DESC |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <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" /> |
| | |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <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 |
| | |
| | | </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> |
| | |
| | | <if test="pageConvenientProductDTO.onShelf != null"> |
| | | AND ccp.on_shelf = #{pageConvenientProductDTO.onShelf} |
| | | </if> |
| | | ORDER BY ccp.created_at DESC |
| | | </select> |
| | | <select id="getMerchantProduct" resultType="com.panzhihua.common.model.vos.community.convenient.ConvenientProductVO"> |
| | | SELECT ccp.id, ccp.name, ccp.category_id, ccp.on_shelf_at, ccp.introduction, ccpc.name AS categoryName |
| | |
| | | SELECT ccp.id,ccp.`name`,ccp.category_id,ccp.merchant_id,ccp.introduction |
| | | FROM com_convenient_products ccp |
| | | LEFT JOIN com_convenient_merchants ccm ON ccp.merchant_id = ccm.id |
| | | WHERE ccm.community_id = #{pageSearchDTO.communityId} AND ccp.`name` LIKE CONCAT('%', #{pageSearchDTO.keyword}, '%') |
| | | INNER JOIN com_convenient_product_specifications ccps ON ccp.id = ccps.product_id |
| | | WHERE ccm.community_id = #{pageSearchDTO.communityId} AND ccp.is_del = 0 |
| | | AND ccp.on_shelf = 1 AND ccps.is_del = 0 AND ccp.`name` LIKE CONCAT('%', #{pageSearchDTO.keyword}, '%') GROUP BY ccp.id |
| | | </select> |
| | | </mapper> |
| | |
| | | </insert> |
| | | <update id="deleteLoseRelationSpecifications" parameterType="java.util.List"> |
| | | UPDATE com_convenient_product_specifications SET is_del = 1 |
| | | WHERE id NOT IN |
| | | WHERE product_id = #{productId} AND id NOT IN |
| | | <foreach collection="notNeedDelIds" open="(" separator="," close=")" index="index" item="item"> |
| | | #{item} |
| | | </foreach> |
| | |
| | | FROM com_convenient_service_categories ccsc |
| | | INNER JOIN com_convenient_service_scope ccss ON ccsc.id = ccss.service_category_id |
| | | LEFT JOIN com_convenient_merchants ccm ON ccss.merchant_id = ccm.id |
| | | WHERE ccsc.is_del = 0 AND ccm.is_del = 0 AND ccm.community_id = #{communityId} GROUP BY ccsc.id |
| | | WHERE ccsc.is_del = 0 AND ccm.is_del = 0 AND ccm.community_id = #{communityId} AND ccm.business_status = 1 GROUP BY ccsc.id ORDER BY ccsc.weight desc |
| | | </select> |
| | | </mapper> |
| | |
| | | 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> |
| | |
| | | |
| | | 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 -> { |
| | |
| | | <if test="pageEventManageDTO.yellowCard!=null"> |
| | | AND e.yellow_card = #{pageEventManageDTO.yellowCard} |
| | | </if> |
| | | <if test="pageEventManageDTO.eventClazz != null and pageEventManageDTO.eventClazz != """> |
| | | AND e.event_clazz like concat('%',#{pageEventDTO.eventClazz},'%') |
| | | </if> |
| | | <if test="pageEventManageDTO.urgent!=null"> |
| | | AND e.urgent = #{pageEventManageDTO.urgent} |
| | | </if> |
| | |
| | | * 物业id |
| | | */ |
| | | @ApiModelProperty(value = "物业id") |
| | | private Integer propertyId; |
| | | private Long propertyId; |
| | | |
| | | } |
| | |
| | | if(!stringRedisTemplate.hasKey(comPropertyEquipment.getSerialNo())){ |
| | | ComPropertyAlarm comPropertyAlarm=new ComPropertyAlarm(); |
| | | comPropertyAlarm.setCreateTime(DateUtil.date()); |
| | | comPropertyAlarm.setPhone(comPropertyEquipment.getPhone()); |
| | | comPropertyAlarm.setSerialNo(comPropertyEquipment.getSerialNo()); |
| | | comPropertyAlarm.setType(ComPropertyAlarm.type.one); |
| | | comPropertyAlarm.setCommunityId(comPropertyEquipment.getCommunityId()); |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.panzhihua.service_user.model.dos.SysRoleMenuDO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | |
| | | * @create: 2020-12-25 09:51 |
| | | **/ |
| | | @Mapper |
| | | public interface SysRoleMenuDAO extends BaseMapper<SysRoleMenuDO> {} |
| | | public interface SysRoleMenuDAO extends BaseMapper<SysRoleMenuDO> { |
| | | /** |
| | | * 批量插入角色菜单关系 |
| | | * @param menuIds |
| | | * @param roleId |
| | | * @return |
| | | */ |
| | | int batchInsertWithRoleId(@Param("menuIds") List<Long> menuIds, @Param("roleId") Long roleId); |
| | | } |
| | |
| | | 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(); |
| | | } |
| | |
| | | throw new ServiceException("手机号已经存在"); |
| | | } else if (e.getMessage().contains("union_account_type")) { |
| | | throw new ServiceException("账户已经存在"); |
| | | }else if(e.getMessage().contains("23000")){ |
| | | throw new ServiceException("手机号已存在"); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | // 获取所有权限id |
| | | List<SysMenuDO> menuDOList = sysMenuDAO.selectList(new QueryWrapper<SysMenuDO>().lambda() |
| | | .eq(SysMenuDO::getCommunityId, 2l).orderByAsc(SysMenuDO::getOrderNum)); |
| | | .eq(SysMenuDO::getCommunityId, 2L).orderByAsc(SysMenuDO::getOrderNum)); |
| | | if (!menuDOList.isEmpty()) { |
| | | menuIds = menuDOList.stream().map(sysMenuDO -> sysMenuDO.getMenuId()).collect(Collectors.toList()); |
| | | for (int i = 0; i < menuIds.size(); i++) { |
| | | SysRoleMenuDO sysRoleMenuDO = sysRoleMenuDAO.selectOne(new QueryWrapper<SysRoleMenuDO>().lambda() |
| | | .eq(SysRoleMenuDO::getMenuId, menuIds.get(i)).eq(SysRoleMenuDO::getRoleId, roleId)); |
| | | if (sysRoleMenuDO == null) { |
| | | sysRoleMenuDO = new SysRoleMenuDO(); |
| | | sysRoleMenuDO.setMenuId(menuIds.get(i)); |
| | | sysRoleMenuDO.setRoleId(roleId); |
| | | sysRoleMenuDAO.insert(sysRoleMenuDO); |
| | | } |
| | | |
| | | List<SysRoleMenuDO> sysRoleMenuDOList = sysRoleMenuDAO.selectList(new QueryWrapper<SysRoleMenuDO>().lambda().eq(SysRoleMenuDO::getRoleId, roleId).in(SysRoleMenuDO::getMenuId, menuIds)); |
| | | if (!sysRoleMenuDOList.isEmpty()) { |
| | | menuIds = menuIds.stream().filter(menuId -> !sysRoleMenuDOList.stream() |
| | | .anyMatch(sysRoleMenuDO -> sysRoleMenuDO.getMenuId().equals(menuId))).collect(Collectors.toList()); |
| | | } |
| | | if (!menuIds.isEmpty()) { |
| | | sysRoleMenuDAO.batchInsertWithRoleId(menuIds, roleId); |
| | | } |
| | | // for (int i = 0; i < menuIds.size(); i++) { |
| | | // SysRoleMenuDO sysRoleMenuDO = sysRoleMenuDAO.selectOne(new QueryWrapper<SysRoleMenuDO>().lambda() |
| | | // .eq(SysRoleMenuDO::getMenuId, menuIds.get(i)).eq(SysRoleMenuDO::getRoleId, roleId)); |
| | | // if (sysRoleMenuDO == null) { |
| | | // sysRoleMenuDO = new SysRoleMenuDO(); |
| | | // sysRoleMenuDO.setMenuId(menuIds.get(i)); |
| | | // sysRoleMenuDO.setRoleId(roleId); |
| | | // sysRoleMenuDAO.insert(sysRoleMenuDO); |
| | | // } |
| | | // } |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R addGridUser(EventGridMemberAddDTO eventGridMemberAddDTO) { |
| | | |
| | | SysRoleDO gridMemberDefaultRole = roleDAO.selectOne( |
| | | new QueryWrapper<SysRoleDO>().lambda().eq(SysRoleDO::getRoleKey, Constants.GRID_DEFAULT_ROLE_KEY)); |
| | | if (gridMemberDefaultRole == null) { |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R addConvenientMerchantUser(ConvenientMerchantDTO convenientMerchantDTO) { |
| | | SysUserDO sysUserDO = new SysUserDO(); |
| | | Long communityId = 0L; |
| | | // 新增社区高级管理员角色 |
| | | SysRoleDO sysRoleDO = new SysRoleDO(); |
| | | sysRoleDO.setCommunityId(0L); |
| | | sysRoleDO.setRoleName(convenientMerchantDTO.getName()); |
| | | sysRoleDO.setRoleKey(Constants.CONVENIENT_MERCHANT_ROLE_KEY + convenientMerchantDTO.getAccount()); |
| | | sysRoleDO.setRoleSort(0); |
| | | sysRoleDO.setCreateBy(convenientMerchantDTO.getCreatedBy()); |
| | | try { |
| | | int insert = roleDAO.insert(sysRoleDO); |
| | | if (insert != 1) { |
| | | return R.fail("网络错误"); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("新增角色报错【{}】", e.getMessage()); |
| | | if (e.getMessage().contains("unique_role_name_community_id")) { |
| | | return R.fail("商家名称已被占用"); |
| | | } else { |
| | | return R.fail("建立商家角色失败"); |
| | | } |
| | | SysUserDO sysUserDO; |
| | | sysUserDO = userDao.selectOne(new QueryWrapper<SysUserDO>().lambda().eq(SysUserDO::getAccount, convenientMerchantDTO.getAccount())); |
| | | if (nonNull(sysUserDO)) { |
| | | return R.fail("账户已经存在"); |
| | | } |
| | | // 新角色设置所有权限 |
| | | MenuRoleVO menuRoleVO = new MenuRoleVO(); |
| | | menuRoleVO.setIsAll(1); |
| | | menuRoleVO.setCommunityId(communityId); |
| | | menuRoleVO.setRoleId(sysRoleDO.getRoleId()); |
| | | this.putMenuRole(menuRoleVO); |
| | | |
| | | sysUserDO = userDao.selectOne(new QueryWrapper<SysUserDO>().lambda().eq(SysUserDO::getPhone, convenientMerchantDTO.getPhone())); |
| | | if (nonNull(sysUserDO)) { |
| | | return R.fail("手机号已经存在"); |
| | | } |
| | | // sys_user 表 |
| | | sysUserDO = new SysUserDO(); |
| | | String encode = new BCryptPasswordEncoder().encode(convenientMerchantDTO.getPassword()); |
| | | BeanUtils.copyProperties(convenientMerchantDTO, sysUserDO); |
| | | sysUserDO.setAccount(convenientMerchantDTO.getAccount()); |
| | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("新增后台用户报错【{}】", e.getMessage()); |
| | | roleDAO.deleteByRoleKey(Constants.CONVENIENT_MERCHANT_ROLE_KEY + convenientMerchantDTO.getAccount()); |
| | | if (e.getMessage().contains("union_phone_type")) { |
| | | return R.fail("手机号已经存在"); |
| | | } else if (e.getMessage().contains("union_account_type")) { |
| | | return R.fail("账户已经存在"); |
| | | } |
| | | } |
| | | return R.fail("新增商户发生错误"); |
| | | } |
| | |
| | | if (isNull(sysUserDO)) { |
| | | return R.fail("用户不存在"); |
| | | } |
| | | String oldAccount = sysUserDO.getAccount(); |
| | | sysUserDO.setAccount(account); |
| | | int result = userDao.updateById(sysUserDO); |
| | | if (result > 0) { |
| | | SysRoleDO sysRoleDO = roleDAO.selectOne(new QueryWrapper<SysRoleDO>() |
| | | .lambda().eq(SysRoleDO::getRoleKey, Constants.CONVENIENT_MERCHANT_ROLE_KEY + oldAccount)); |
| | | if (nonNull(sysRoleDO)) { |
| | | sysRoleDO.setRoleKey(Constants.CONVENIENT_MERCHANT_ROLE_KEY + account); |
| | | roleDAO.updateById(sysRoleDO); |
| | | } |
| | | } |
| | | userDao.updateById(sysUserDO); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R disableOrEnableMerchantUsers(DisableOrEnableConvenientMerchantDTO disableOrEnableConvenientMerchantDTO) { |
| | | userDao.disableOrEnableMerchantUsers(disableOrEnableConvenientMerchantDTO.getType(), disableOrEnableConvenientMerchantDTO.getIds()); |
| | | userDao.disableOrEnableMerchantUsers(disableOrEnableConvenientMerchantDTO.getType(), disableOrEnableConvenientMerchantDTO.getUserIds()); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | <sql id="columns"> |
| | | `role_id`,`menu_id` |
| | | </sql> |
| | | |
| | | |
| | | <insert id="batchInsertWithRoleId"> |
| | | INSERT INTO `sys_role_menu`(role_id,menu_id) |
| | | VALUES |
| | | <foreach collection="menuIds" item="item" index="index" separator="," > |
| | | (#{roleId}, #{item}) |
| | | </foreach> |
| | | </insert> |
| | | </mapper> |
| | |
| | | package com.panzhihua.shop_backstage.api; |
| | | |
| | | import static org.apache.commons.lang3.StringUtils.isBlank; |
| | | |
| | | import java.io.InputStream; |
| | | import java.util.ArrayList; |
| | | import java.util.Comparator; |
| | | import java.util.List; |
| | | import java.util.TreeSet; |
| | | import java.util.UUID; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.validation.Valid; |
| | | |
| | | import com.panzhihua.common.model.vos.community.convenient.ConvenientProductShelfVO; |
| | | import org.apache.commons.io.FilenameUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | import com.panzhihua.common.model.dtos.community.convenient.ConvenientMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.ConvenientProductCategoryDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.ConvenientProductDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.ConvenientProductSpecificationDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.DeleteConvenientProductDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.OnShelfOrOffShelfProductDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.PageConvenientProductCategoryDTO; |
| | |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.convenient.ConvenientMerchantVO; |
| | | import com.panzhihua.common.model.vos.community.convenient.ConvenientProductCategoryVO; |
| | | import com.panzhihua.common.model.vos.community.convenient.ConvenientProductShelfVO; |
| | | import com.panzhihua.common.model.vos.community.convenient.ConvenientProductVO; |
| | | import com.panzhihua.common.model.vos.community.convenient.ConvenientServiceCategoryVO; |
| | | import com.panzhihua.common.model.vos.shop.LoginMerchantUserInfoVO; |
| | |
| | | @ApiOperation(value = "新增产品分类") |
| | | @PostMapping("/product-category/add") |
| | | public R addProductCategory(@RequestBody @Validated(AddGroup.class) ConvenientProductCategoryDTO convenientProductCategoryDTO) { |
| | | convenientProductCategoryDTO.setCreatedBy(this.getUserId()); |
| | | return communityService.addProductCategory(convenientProductCategoryDTO); |
| | | R<ConvenientMerchantVO> merchantInfo = communityService.getUserConvenientMerchantInfo(this.getUserId()); |
| | | if (R.isOk(merchantInfo)) { |
| | | ConvenientMerchantVO merchantVO = |
| | | JSONObject.parseObject(JSONObject.toJSONString(merchantInfo.getData()), ConvenientMerchantVO.class); |
| | | convenientProductCategoryDTO.setCreatedBy(this.getUserId()); |
| | | convenientProductCategoryDTO.setMerchantId(merchantVO.getId()); |
| | | return communityService.addProductCategory(convenientProductCategoryDTO); |
| | | } |
| | | return R.fail("获取登录信息失败,请重新尝试"); |
| | | } |
| | | |
| | | @ApiOperation(value = "编辑产品分类") |
| | |
| | | @ApiOperation(value = "分页查询产品分类", response = ConvenientProductCategoryVO.class) |
| | | @PostMapping("/product-category/page") |
| | | public R pageProductCategory(@RequestBody PageConvenientProductCategoryDTO pageConvenientProductCategoryDTO) { |
| | | return communityService.pageProductCategory(pageConvenientProductCategoryDTO); |
| | | R<ConvenientMerchantVO> merchantInfo = communityService.getUserConvenientMerchantInfo(this.getUserId()); |
| | | if (R.isOk(merchantInfo)) { |
| | | ConvenientMerchantVO merchantVO = |
| | | JSONObject.parseObject(JSONObject.toJSONString(merchantInfo.getData()), ConvenientMerchantVO.class); |
| | | pageConvenientProductCategoryDTO.setMerchantId(merchantVO.getId()); |
| | | return communityService.pageProductCategory(pageConvenientProductCategoryDTO); |
| | | } |
| | | return R.fail("获取登录信息失败,请重新尝试"); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取所有产品分类", response = ConvenientProductCategoryVO.class) |
| | | @GetMapping("/product-category/all") |
| | | public R getAllProductCategory() { |
| | | return communityService.getAllProductCategory(); |
| | | R<ConvenientMerchantVO> merchantInfo = communityService.getUserConvenientMerchantInfo(this.getUserId()); |
| | | if (R.isOk(merchantInfo)) { |
| | | ConvenientMerchantVO merchantVO = |
| | | JSONObject.parseObject(JSONObject.toJSONString(merchantInfo.getData()), ConvenientMerchantVO.class); |
| | | return communityService.getAllProductCategory(merchantVO.getId()); |
| | | } |
| | | return R.fail("获取登录信息失败,请重新尝试"); |
| | | } |
| | | |
| | | @ApiOperation(value = "便民服务商家后台新增产品") |
| | | @PostMapping("/product/add") |
| | | public R addProduct(@RequestBody @Validated(AddGroup.class) ConvenientProductDTO convenientProductDTO) { |
| | | List<ConvenientProductSpecificationDTO> specificationDTOList = convenientProductDTO.getProductSpecificationDTOList(); |
| | | boolean isDirtyData = specificationDTOList.stream().filter(specificationDTO -> isBlank(specificationDTO.getName())).findFirst().isPresent(); |
| | | if (isDirtyData) { |
| | | return R.fail("请不要传入空规格!"); |
| | | } |
| | | ArrayList<ConvenientProductSpecificationDTO> filteredSpecificationList = specificationDTOList.stream() |
| | | .collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(ConvenientProductSpecificationDTO::getName))), ArrayList::new)); |
| | | if (specificationDTOList.size() != filteredSpecificationList.size()) { |
| | | return R.fail("规格名称重复!"); |
| | | } |
| | | Long userId = this.getUserId(); |
| | | convenientProductDTO.setCreatedBy(userId); |
| | | R<ConvenientMerchantVO> merchantInfo = communityService.getUserConvenientMerchantInfo(userId); |
| | |
| | | @ApiOperation(value = "便民服务商家后台编辑产品") |
| | | @PutMapping("/product/put") |
| | | public R putProduct(@RequestBody @Validated(PutGroup.class) ConvenientProductDTO convenientProductDTO) { |
| | | List<ConvenientProductSpecificationDTO> specificationDTOList = convenientProductDTO.getProductSpecificationDTOList(); |
| | | boolean isDirtyData = specificationDTOList.stream().filter(specificationDTO -> isBlank(specificationDTO.getName())).findFirst().isPresent(); |
| | | if (isDirtyData) { |
| | | return R.fail("请不要传入空规格!"); |
| | | } |
| | | ArrayList<ConvenientProductSpecificationDTO> filteredSpecificationList = specificationDTOList.stream() |
| | | .collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(ConvenientProductSpecificationDTO::getName))), ArrayList::new)); |
| | | if (specificationDTOList.size() != filteredSpecificationList.size()) { |
| | | return R.fail("规格名称重复!"); |
| | | } |
| | | Long userId = this.getUserId(); |
| | | convenientProductDTO.setUpdatedBy(userId); |
| | | R<ConvenientMerchantVO> merchantInfo = communityService.getUserConvenientMerchantInfo(userId); |
| | |
| | | boolean convenientLogin = "/convenient/login".equals(uri); |
| | | boolean isConvenientReq = uri.contains("/convenient"); |
| | | boolean storeLogin = "/login".equals(uri); |
| | | boolean isUpload = "/convenient/upload/file".equals(uri); |
| | | |
| | | if (isDoc) { |
| | | if (isDoc || isUpload) { |
| | | //放过swagger请求 |
| | | } else { |
| | | if (!storeLogin && !isConvenientReq) { |
| | |
| | | noLoginUrl.add("/api/applets/convenient/merchant/incr-consult"); |
| | | noLoginUrl.add("/api/applets/convenient/merchant/incr-view"); |
| | | noLoginUrl.add("/api/applets/convenient/product/incr-view"); |
| | | noLoginUrl.add("/api/shopbackstage/convenient/upload/file"); |
| | | if (noLoginUrl.contains(requestURI)) { |
| | | List<SimpleGrantedAuthority> authorities = new ArrayList<>(); |
| | | authorities.add(new SimpleGrantedAuthority(SecurityConstants.ROLE_APPLETS)); |