Merge branch 'test' into 'master'
Test
See merge request root/zhihuishequ!147
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.CancelRecordDTO; |
| | | import com.panzhihua.common.model.dtos.community.OperationDetailDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageUserReserveDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActReserveCommitVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 预约/登记服务 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("reserve") |
| | | @Api(tags = "预约/登记服务") |
| | | public class ComReserveApi extends BaseController { |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @ApiOperation("详情") |
| | | @GetMapping("/detail") |
| | | public R detail(@RequestParam("id") Long id,@RequestParam("recordId") Long recordId,@RequestParam("isBack") Integer isBack){ |
| | | return communityService.reserveDetail(id,this.getUserId(),recordId,isBack); |
| | | } |
| | | |
| | | @ApiOperation("用户提交数据") |
| | | @PostMapping("/commit") |
| | | public R commit(@RequestBody ComActReserveCommitVO comActReserveCommitVO){ |
| | | comActReserveCommitVO.setCommunityId(this.getCommunityId()); |
| | | comActReserveCommitVO.setUserId(this.getUserId()); |
| | | return communityService.reserveCommit(comActReserveCommitVO); |
| | | } |
| | | |
| | | /** |
| | | * 我的预约/登记 |
| | | * @param pageUserReserveDTO |
| | | * @return |
| | | */ |
| | | @ApiOperation("我的预约/登记") |
| | | @PostMapping("/userReserveList") |
| | | public R userReserveList(@RequestBody PageUserReserveDTO pageUserReserveDTO){ |
| | | pageUserReserveDTO.setUserId(this.getUserId()); |
| | | return communityService.userReserveList(pageUserReserveDTO); |
| | | } |
| | | /** |
| | | * 取消预约/登记 |
| | | */ |
| | | @ApiOperation("取消预约/登记") |
| | | @PostMapping("/cancelReserve") |
| | | public R userCancelReserve(@RequestBody CancelRecordDTO cancelRecordDTO){ |
| | | return communityService.userCancelReserve(cancelRecordDTO); |
| | | } |
| | | |
| | | /** |
| | | * 预约详情操作记录 |
| | | */ |
| | | @ApiOperation("预约详情操作记录") |
| | | @PostMapping("/detailOperation") |
| | | public R reserveOperation(@RequestBody OperationDetailDTO comActReserveOperationRecordDO){ |
| | | comActReserveOperationRecordDO.setUserId(this.getUserId()); |
| | | return communityService.reserveOperation(comActReserveOperationRecordDO); |
| | | } |
| | | } |
| | |
| | | return communityService.detailActivity(id, userId); |
| | | } |
| | | |
| | | @ApiOperation(value = "社区活动/志愿者活动签到") |
| | | @PostMapping("activity/sign-in") |
| | | public R activitySignIn(@RequestBody ComActActRegistVO comActActRegistVO) { |
| | | comActActRegistVO.setUserId(this.getUserId()); |
| | | return communityService.activitySignIn(comActActRegistVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "社区活动/志愿者活动评价") |
| | | @PostMapping("activity/evaluate") |
| | | public R activityEvaluate(@RequestBody ComActActEvaluateVO comActActEvaluateVO) { |
| | | comActActEvaluateVO.setUserId(this.getUserId()); |
| | | return communityService.activityEvaluate(comActActEvaluateVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "报名/取消报名社区活动") |
| | | @PutMapping("signactivity") |
| | | public R signActivity(@RequestBody @Validated(AddGroup.class) SignactivityVO signactivityVO) { |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import java.util.*; |
| | | import java.util.ArrayList; |
| | | import java.util.Comparator; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | import java.util.TreeSet; |
| | | import java.util.concurrent.atomic.AtomicBoolean; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.vos.community.ComActActEvaluateVO; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | |
| | | import com.panzhihua.common.model.dtos.user.SysUserFeedbackDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.model.vos.community.ComActActRegistVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActivityVO; |
| | | import com.panzhihua.common.model.vos.community.ComActEasyPhotoVO; |
| | | import com.panzhihua.common.model.vos.community.ComActMicroWishVO; |
| | | import com.panzhihua.common.model.vos.community.ComActVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngStructAreaVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngStructHouseVO; |
| | | import com.panzhihua.common.model.vos.partybuilding.PartyBuildingMemberVO; |
| | | import com.panzhihua.common.model.vos.user.*; |
| | | import com.panzhihua.common.model.vos.user.ComMngFamilyInfoVO; |
| | | import com.panzhihua.common.model.vos.user.SysUserNoticeVO; |
| | | import com.panzhihua.common.model.vos.user.UpdateUserArchivesVO; |
| | | import com.panzhihua.common.model.vos.user.UserArchivesVO; |
| | | import com.panzhihua.common.model.vos.user.UserPhoneVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.service.partybuilding.PartyBuildingService; |
| | | import com.panzhihua.common.service.user.UserService; |
| | |
| | | if (!ObjectUtils.isEmpty(comActActivityVOS)) { |
| | | List<ComActActivityVO> collect = comActActivityVOS.stream() |
| | | .sorted(Comparator.comparing(ComActActivityVO::getSingDate).reversed()).collect(Collectors.toList()); |
| | | //当前用户最近签到时间 |
| | | R r2 = communityService.listSignInActivity(userId); |
| | | if (R.isOk(r2) && !ObjectUtils.isEmpty(r2.getData())) { |
| | | ArrayList<ComActActRegistVO> comActActRegistVOS = JSONArray.parseArray(JSONArray.toJSONString(r2.getData()), ComActActRegistVO.class).stream() |
| | | .sorted(Comparator.comparing(ComActActRegistVO::getCreateAt).reversed()) |
| | | .collect(Collectors.collectingAndThen(Collectors.toCollection(() -> |
| | | new TreeSet<>(Comparator.comparing(f -> String.join("", f.getUserId().toString(), f.getActivityId().toString())))), ArrayList::new)); |
| | | collect.forEach(comActActivityVO -> comActActRegistVOS.forEach(activitySignInVO -> { |
| | | if (comActActivityVO.getId().equals(activitySignInVO.getActivityId())) { |
| | | comActActivityVO.setActivitySignInDate(activitySignInVO.getCreateAt()); |
| | | } |
| | | })); |
| | | } |
| | | //当前用户活动评分 |
| | | R r3 = communityService.listEvaluate(userId); |
| | | if (R.isOk(r3) && !ObjectUtils.isEmpty(r3.getData())) { |
| | | List<ComActActEvaluateVO> comActActEvaluateVOS = JSONArray.parseArray(JSONArray.toJSONString(r3.getData()), ComActActEvaluateVO.class); |
| | | collect.forEach(comActActivityVO -> comActActEvaluateVOS.forEach(comActActEvaluateVO -> { |
| | | if (comActActEvaluateVO.getActivityId().equals(comActActivityVO.getId())) { |
| | | comActActivityVO.setMyRating(comActActEvaluateVO.getStarLevel()); |
| | | } |
| | | })); |
| | | } |
| | | return R.ok(collect); |
| | | } |
| | | return R.ok(comActActivityVOS); |
| | |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.google.zxing</groupId> |
| | | <artifactId>core</artifactId> |
| | | <version>3.1.0</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.google.zxing</groupId> |
| | | <artifactId>javase</artifactId> |
| | | <version>3.1.0</version> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | |
New file |
| | |
| | | package com.panzhihua.common.enums; |
| | | |
| | | import lombok.Getter; |
| | | |
| | | /** |
| | | * 预约登记记录状态枚举 |
| | | * |
| | | * @author lyq |
| | | */ |
| | | @Getter |
| | | public enum ReserveRecordStatusEnum { |
| | | dcl(1, "待处理"), yycg(2, "预约成功"), yysb(3, "预约失败"), yqx(4, "已取消"), wz(5, "未知"); |
| | | |
| | | private final Integer code; |
| | | private final String name; |
| | | |
| | | ReserveRecordStatusEnum(Integer code, String name) { |
| | | this.code = code; |
| | | this.name = name; |
| | | } |
| | | |
| | | public static int getCodeByName(String name) { |
| | | for (ReserveRecordStatusEnum item : ReserveRecordStatusEnum.values()) { |
| | | if (item.name.equals(name)) { |
| | | return item.getCode(); |
| | | } |
| | | } |
| | | return wz.code; |
| | | } |
| | | |
| | | public static String getCnDescByName(Integer code) { |
| | | for (ReserveRecordStatusEnum item : ReserveRecordStatusEnum.values()) { |
| | | if (item.code.equals(code)) { |
| | | return item.getName(); |
| | | } |
| | | } |
| | | return wz.name; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("取消预约/登记参数") |
| | | public class CancelRecordDTO { |
| | | @ApiModelProperty("记录id") |
| | | private Long id; |
| | | /** |
| | | * 内容 |
| | | */ |
| | | @ApiModelProperty("内容") |
| | | private String content; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty("备注") |
| | | private String remark; |
| | | |
| | | private Integer status; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class OperationDetailDTO { |
| | | /** |
| | | * 预约登记记录id |
| | | */ |
| | | private Long reserveRecordId; |
| | | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 类型(1.本人操作 2.社区操作) |
| | | */ |
| | | private Integer type; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class PageUserReserveDTO { |
| | | private Integer pageNum; |
| | | private Integer pageSize; |
| | | private Integer type; |
| | | private Long userId; |
| | | private Integer status; |
| | | } |
| | |
| | | import com.panzhihua.common.model.vos.community.ComActQuestnaireAnswerContentVO; |
| | | import com.panzhihua.common.model.vos.community.ComActQuestnaireSubVO; |
| | | |
| | | import com.panzhihua.common.model.vos.community.reserve.ComActReserveRegisterDetailedVO; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | |
| | | |
| | | @ApiModelProperty("题目用户回答列表") |
| | | private List<ComActQuestnaireAnswerContentVO> answers; |
| | | |
| | | @ApiModelProperty("用户填报记录") |
| | | private ComActReserveRegisterDetailedVO recordListVO; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.reserve; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel("新增预约登记请求参数") |
| | | public class AddReserveAdminDTO { |
| | | |
| | | @ApiModelProperty(value = "类型(1.预约 2.登记)") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "主题") |
| | | private String title; |
| | | |
| | | @ApiModelProperty(value = "数量上限数量(如果不限制数量,这里传0)") |
| | | private Integer joinAllCount; |
| | | |
| | | @ApiModelProperty(value = "图标类型(1.预设1 2.预设2 3.预设3 4.预设4 5.用户自定义图片)") |
| | | private Integer imgType; |
| | | |
| | | @ApiModelProperty(value = "图标url(当img_type为5时,此字段的值为图标url地址)") |
| | | private String imgUrl; |
| | | |
| | | @ApiModelProperty("广告顶部(1.是 2.否)") |
| | | private Integer adverPositionTop; |
| | | |
| | | @ApiModelProperty("广告应用(1.是 2.否)") |
| | | private Integer adverPositionApplication; |
| | | |
| | | @ApiModelProperty(value = "社区id",hidden = true) |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty(value = "用户id",hidden = true) |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty("是否可重复提交(1.是 2.否)") |
| | | private Integer isRepeat; |
| | | |
| | | @ApiModelProperty("组件json数据") |
| | | private String jsonObject; |
| | | |
| | | @ApiModelProperty("是否发布(1.是 2.否)") |
| | | private Integer isPublish = 2; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.reserve; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel("取消预约登记请求参数") |
| | | public class CancelReserveRecordDTO { |
| | | |
| | | @ApiModelProperty(value = "需要取消的预约记录id集合") |
| | | private List<Long> ids; |
| | | |
| | | @ApiModelProperty(value = "取消原因") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "用户id",hidden = true) |
| | | private Long userId; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.reserve; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("查询预约统计汇总数据请求参数") |
| | | public class ComActReserveMakeStatisticsDTO { |
| | | |
| | | @ApiModelProperty(value = "开始时间查询") |
| | | private String startTime; |
| | | |
| | | @ApiModelProperty(value = "结束时间查询") |
| | | private String endTime; |
| | | |
| | | @ApiModelProperty(value = "社区id",hidden = true) |
| | | private Long communityId; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.reserve; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("查询登记统计汇总数据请求参数") |
| | | public class ComActReserveRegisterStatisticsDTO { |
| | | |
| | | @ApiModelProperty(value = "开始时间查询") |
| | | private String startTime; |
| | | |
| | | @ApiModelProperty(value = "结束时间查询") |
| | | private String endTime; |
| | | |
| | | @ApiModelProperty(value = "社区id",hidden = true) |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数",example = "1") |
| | | private Long pageNum = 1L; |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数",example = "10") |
| | | private Long pageSize = 10L; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.reserve; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 继续预约登记请求参数 |
| | | */ |
| | | @Data |
| | | @ApiModel("继续预约登记请求参数") |
| | | public class EditComActReserveInfoDTO { |
| | | @ApiModelProperty(value = "预约登记id") |
| | | private Long id; |
| | | @ApiModelProperty(value = "用户id",hidden = true) |
| | | private Long userId; |
| | | @ApiModelProperty(value = "主题") |
| | | private String title; |
| | | |
| | | @ApiModelProperty(value = "数量上限数量(如果不限制数量,这里传0)") |
| | | private Integer joinAllCount; |
| | | |
| | | @ApiModelProperty(value = "图标类型(1.预设1 2.预设2 3.预设3 4.预设4 5.用户自定义图片)") |
| | | private Integer imgType; |
| | | |
| | | @ApiModelProperty(value = "图标url(当img_type为5时,此字段的值为图标url地址)") |
| | | private String imgUrl; |
| | | |
| | | @ApiModelProperty("广告顶部(1.是 2.否)") |
| | | private Integer adverPositionTop; |
| | | |
| | | @ApiModelProperty("广告应用(1.是 2.否)") |
| | | private Integer adverPositionApplication; |
| | | |
| | | @ApiModelProperty("是否可重复提交(1.是 2.否)") |
| | | private Integer isRepeat; |
| | | |
| | | @ApiModelProperty("是否发布(1.是 2.否)") |
| | | private Integer isPublish; |
| | | |
| | | /** |
| | | * 类型(1.继续 2.停止 3.发布) |
| | | */ |
| | | public interface type{ |
| | | int jx = 1; |
| | | int tz = 2; |
| | | int fb = 3; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.reserve; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 修改预约登记状态请求参数 |
| | | */ |
| | | @Data |
| | | @ApiModel("修改预约登记状态请求参数") |
| | | public class EditComActReserveStatusDTO { |
| | | @ApiModelProperty(value = "预约登记id") |
| | | private Long id; |
| | | @ApiModelProperty(value = "类型(1.停止 2.发布)") |
| | | private Integer type; |
| | | @ApiModelProperty(value = "用户id",hidden = true) |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 类型(1.停止 2.发布) |
| | | */ |
| | | public interface type{ |
| | | int tz = 1; |
| | | int fb = 2; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.reserve; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("编辑预约登记请求参数") |
| | | public class EditReserveAdminDTO { |
| | | |
| | | @ApiModelProperty(value = "预约登记id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "类型(1.预约 2.登记)") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "主题") |
| | | private String title; |
| | | |
| | | @ApiModelProperty(value = "数量上限数量(如果不限制数量,这里传0)") |
| | | private Integer joinAllCount; |
| | | |
| | | @ApiModelProperty(value = "图标类型(1.预设1 2.预设2 3.预设3 4.预设4 5.用户自定义图片)") |
| | | private Integer imgType; |
| | | |
| | | @ApiModelProperty(value = "图标url(当img_type为5时,此字段的值为图标url地址)") |
| | | private String imgUrl; |
| | | |
| | | @ApiModelProperty("广告顶部(1.是 2.否)") |
| | | private Integer adverPositionTop; |
| | | |
| | | @ApiModelProperty("广告应用(1.是 2.否)") |
| | | private Integer adverPositionApplication; |
| | | |
| | | @ApiModelProperty(value = "社区id",hidden = true) |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty(value = "用户id",hidden = true) |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty("是否可重复提交(1.是 2.否)") |
| | | private Integer isRepeat; |
| | | |
| | | @ApiModelProperty("组件json数据") |
| | | private String jsonObject; |
| | | |
| | | @ApiModelProperty("是否发布(1.是 2.否)") |
| | | private Integer isPublish; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.reserve; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel("处理预约记录请求参数") |
| | | public class MakeHandleAdminDTO { |
| | | |
| | | @ApiModelProperty(value = "批量处理id集合") |
| | | private List<Long> ids; |
| | | |
| | | @ApiModelProperty(value = "预约成功时间(格式:yyyy-MM-dd HH:mm:ss)") |
| | | private String makeTime; |
| | | |
| | | @ApiModelProperty(value = "预约状态(1.同意 2.拒绝)") |
| | | private Integer isOk; |
| | | |
| | | @ApiModelProperty(value = "处理备注") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "用户id",hidden = true) |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 预约状态(1.同意 2.拒绝) |
| | | */ |
| | | public interface isOk{ |
| | | int yes = 1; |
| | | int no = 2; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.reserve; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel("分页查询预约登记列表请求参数") |
| | | public class PageReserveAdminDTO { |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数",example = "1") |
| | | private Long pageNum = 1L; |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数",example = "10") |
| | | private Long pageSize = 10L; |
| | | |
| | | @ApiModelProperty(value = "类型(1.预约 2.登记)") |
| | | private List<Integer> type; |
| | | |
| | | @ApiModelProperty(value = "状态(1.进行中 2.已停止 3.待发布)") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "广告位置(1.无 2.首页顶部 3.首页应用)") |
| | | private Integer advertType; |
| | | |
| | | @ApiModelProperty(value = "开始时间查询") |
| | | private String startTime; |
| | | |
| | | @ApiModelProperty(value = "结束时间查询") |
| | | private String endTime; |
| | | |
| | | @ApiModelProperty(value = "关键词") |
| | | private String keyWord; |
| | | |
| | | @ApiModelProperty(value = "社区id",hidden = true) |
| | | private Long communityId; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.reserve; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel("分页查询预约登记列表请求参数") |
| | | public class PageReserveMakeAdminDTO { |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数",example = "1") |
| | | private Long pageNum = 1L; |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数",example = "10") |
| | | private Long pageSize = 10L; |
| | | |
| | | @ApiModelProperty(value = "预约登记id") |
| | | private Long reserveId; |
| | | |
| | | @ApiModelProperty(value = "开始时间查询") |
| | | private String startTime; |
| | | |
| | | @ApiModelProperty(value = "结束时间查询") |
| | | private String endTime; |
| | | |
| | | @ApiModelProperty(value = "需要导出id集合") |
| | | private List<Long> ids; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.reserve; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel("分页查询预约登记列表请求参数") |
| | | public class PageReserveMakeHandleAdminDTO { |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数",example = "1") |
| | | private Long pageNum = 1L; |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数",example = "10") |
| | | private Long pageSize = 10L; |
| | | |
| | | @ApiModelProperty(value = "关键词") |
| | | private String keyWord; |
| | | |
| | | @ApiModelProperty(value = "开始时间查询") |
| | | private String startTime; |
| | | |
| | | @ApiModelProperty(value = "结束时间查询") |
| | | private String endTime; |
| | | |
| | | @ApiModelProperty(value = "状态集合") |
| | | private List<Integer> status; |
| | | |
| | | @ApiModelProperty(value = "预约登记id") |
| | | private Long reserveId; |
| | | |
| | | @ApiModelProperty(value = "社区id",hidden = true) |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty(value = "需要导出的id集合") |
| | | private List<Long> ids; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.reserve; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel("分页查询预约登记列表请求参数") |
| | | public class PageReserveRegisterDetailedAdminDTO { |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数",example = "1") |
| | | private Long pageNum = 1L; |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数",example = "10") |
| | | private Long pageSize = 10L; |
| | | |
| | | @ApiModelProperty(value = "开始时间查询") |
| | | private String startTime; |
| | | |
| | | @ApiModelProperty(value = "结束时间查询") |
| | | private String endTime; |
| | | |
| | | @ApiModelProperty(value = "预约登记id") |
| | | private Long reserveId; |
| | | |
| | | } |
| | |
| | | private String nickName; |
| | | @ApiModelProperty("身份") |
| | | private String identity; |
| | | @ApiModelProperty("人群标签") |
| | | private String tags; |
| | | @ApiModelProperty("手机号") |
| | | private String phone; |
| | | @ApiModelProperty("报名时间") |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * title: ComActActEvaluateDO 社区活动评价表 |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * description: 记录和展示社区活动评价内容 |
| | | * |
| | | * @author txb |
| | | * @date 2021/8/24 10:21 |
| | | */ |
| | | |
| | | @Data |
| | | @ApiModel("社区活动评价表") |
| | | public class ComActActEvaluateExcelVO { |
| | | |
| | | @ExcelProperty(value = "姓名", index = 1) |
| | | private String name; |
| | | |
| | | @ExcelProperty(value = "身份", index = 2) |
| | | private String identity; |
| | | |
| | | @ExcelProperty(value = "电话", index = 3) |
| | | private String phone; |
| | | |
| | | @ExcelProperty(value = "评价时间", index = 0) |
| | | private Date createAt; |
| | | |
| | | @ExcelProperty(value = "评价星级", index = 4) |
| | | private Integer starLevel; |
| | | |
| | | @ExcelProperty(value = "评价详情", index = 5) |
| | | private String evaluateContent; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * title: ComActActEvaluateDO 社区活动评价表 |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * description: 记录和展示社区活动评价内容 |
| | | * |
| | | * @author txb |
| | | * @date 2021/8/24 10:21 |
| | | */ |
| | | |
| | | @Data |
| | | @ApiModel("社区活动评价表") |
| | | public class ComActActEvaluateVO{ |
| | | |
| | | @ApiModelProperty("自增id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("所属活动id") |
| | | private Long activityId; |
| | | |
| | | @ApiModelProperty("用户id, 和用户信息表的相关id关联") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty("名字") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("用户昵称") |
| | | private String nickName; |
| | | |
| | | @ApiModelProperty("身份") |
| | | private String identity; |
| | | |
| | | @ApiModelProperty("手机号") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty("人员头像") |
| | | private String imageUrl; |
| | | |
| | | @ApiModelProperty(value = "列表人员类型 1 普通居民 2 志愿者", hidden = true) |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("评价时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | @ApiModelProperty("是否是志愿者 0 否 1 是") |
| | | private Integer isVolunteer; |
| | | |
| | | @ApiModelProperty("评分星级1.差 2.一般 3.还不错 4.很满意 5.强烈推荐") |
| | | private Integer starLevel; |
| | | |
| | | @ApiModelProperty("评价内容") |
| | | private String evaluateContent; |
| | | |
| | | @ApiModelProperty("人群标签") |
| | | private String tags; |
| | | |
| | | @ApiModelProperty("照片(多张以逗号隔开)") |
| | | private String photo; |
| | | |
| | | @ApiModelProperty("用户openid") |
| | | private String openid; |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数", example = "1") |
| | | private Long pageNum = 1L; |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数", example = "10") |
| | | private Long pageSize = 10L; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * title: ComActActPictureDO 社区》活动》历史上传图片实体类 |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * description: 社区》活动》历史上传图片实体类 |
| | | * |
| | | * @author txb |
| | | * @date 2021/8/27 14:21 |
| | | */ |
| | | |
| | | @Data |
| | | @ApiModel("社区活动封面") |
| | | public class ComActActPictureVO { |
| | | |
| | | @ApiModelProperty("自增id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("所属活动id") |
| | | private Long activityId; |
| | | |
| | | @ApiModelProperty("用户id, 和用户信息表的相关id关联") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty("上传时间") |
| | | private Date createAt; |
| | | |
| | | @ApiModelProperty("上传图片") |
| | | private String uploadPicture; |
| | | |
| | | @ApiModelProperty("图片名称") |
| | | private String pictureName; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * title: ComActActRegistExcelVO 社区活动签到表 |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * description: 记录和展示社区活动签到内容 |
| | | * |
| | | * @author txb |
| | | * @date 2021/8/24 10:21 |
| | | */ |
| | | |
| | | @Data |
| | | @ApiModel("社区活动签到表") |
| | | public class ComActActRegistExcelVO { |
| | | |
| | | @ExcelProperty(value = "姓名", index = 1) |
| | | private String name; |
| | | |
| | | @ExcelProperty(value = "身份", index = 2) |
| | | private String identity; |
| | | |
| | | @ExcelProperty(value = "电话", index = 4) |
| | | private String phone; |
| | | |
| | | @ExcelProperty(value = "签到时间(未签到就是报名时间)", index = 0) |
| | | private Date createAt; |
| | | |
| | | @ExcelProperty(value = "人群标签", index = 3) |
| | | private String tags; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * title: ComActActEvaluateDO 社区活动签到表 |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * description: 记录和展示社区活动签到内容 |
| | | * |
| | | * @author txb |
| | | * @date 2021/8/24 10:21 |
| | | */ |
| | | |
| | | @Data |
| | | @ApiModel("社区活动签到表") |
| | | public class ComActActRegistVO { |
| | | |
| | | @ApiModelProperty("自增id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("所属活动id") |
| | | private Long activityId; |
| | | |
| | | @ApiModelProperty("用户id, 和用户信息表的相关id关联") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty("名字") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("用户昵称") |
| | | private String nickName; |
| | | |
| | | @ApiModelProperty("身份") |
| | | private String identity; |
| | | |
| | | @ApiModelProperty("人群标签") |
| | | private String tags; |
| | | |
| | | @ApiModelProperty("手机号") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty("人员头像") |
| | | private String imageUrl; |
| | | |
| | | @ApiModelProperty(value = "列表人员类型 1 普通居民 2 志愿者", hidden = true) |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("签到时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | @ApiModelProperty("是否是志愿者 0 否 1 是") |
| | | private Integer isVolunteer; |
| | | |
| | | @ApiModelProperty("用户openid") |
| | | private String openid; |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数", example = "1") |
| | | private Long pageNum = 1L; |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数", example = "10") |
| | | private Long pageSize = 10L; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * title: ComActActSignExcelVO 社区活动报名名单 |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * description: 记录和展示社区活动报名名单 |
| | | * |
| | | * @author txb |
| | | * @date 2021/8/24 10:21 |
| | | */ |
| | | |
| | | @Data |
| | | @ApiModel("社区活动签到表") |
| | | public class ComActActSignExcelVO { |
| | | |
| | | @ExcelProperty(value = "姓名", index = 1) |
| | | private String name; |
| | | |
| | | @ExcelProperty(value = "身份", index = 2) |
| | | private String identity; |
| | | |
| | | @ExcelProperty(value = "电话", index = 4) |
| | | private String phone; |
| | | |
| | | @ExcelProperty(value = "报名时间", index = 0) |
| | | private Date createAt; |
| | | |
| | | @ExcelProperty(value = "人群标签", index = 3) |
| | | private String tags; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 社区活动数据统计返回参数 |
| | | */ |
| | | @Data |
| | | @ApiModel("社区活动数据统计返回参数") |
| | | public class ComActActivityStatisticsVO { |
| | | |
| | | /** |
| | | * 应报名总人数 |
| | | */ |
| | | @ApiModelProperty("应报名总人数") |
| | | private Integer signTotal; |
| | | /** |
| | | * 应报名总人数Str |
| | | */ |
| | | @ApiModelProperty("应报名总人数Str") |
| | | private String signTotalStr; |
| | | /** |
| | | * 实际报名总人数 |
| | | */ |
| | | @ApiModelProperty("实际报名总人数") |
| | | private Integer reallySignTotal; |
| | | /** |
| | | * 未报名报名总人数 |
| | | */ |
| | | @ApiModelProperty("未报名报名总人数") |
| | | private Integer noSignTotal; |
| | | /** |
| | | * 未报名报名总人数Str |
| | | */ |
| | | @ApiModelProperty("未报名报名总人数Str") |
| | | private String noSignTotalStr; |
| | | /** |
| | | * 报名总人数百分比 |
| | | */ |
| | | @ApiModelProperty("报名总人数百分比") |
| | | private String signPersent; |
| | | /** |
| | | * 应签到总人数 |
| | | */ |
| | | @ApiModelProperty("应签到总人数") |
| | | private Integer registTotal; |
| | | |
| | | /** |
| | | * 实际签到总人数 |
| | | */ |
| | | @ApiModelProperty("实际签到总人数") |
| | | private Integer reallyRegistTotal; |
| | | |
| | | /** |
| | | * 未签到总人数 |
| | | */ |
| | | @ApiModelProperty("未签到总人数") |
| | | private Integer noRegistTotal; |
| | | |
| | | /** |
| | | * 签到总人数百分比 |
| | | */ |
| | | @ApiModelProperty("签到总人数百分比") |
| | | private String registPersent; |
| | | |
| | | /** |
| | | * 应评价总人数 |
| | | */ |
| | | @ApiModelProperty("应评价总人数") |
| | | private Integer evaluateTotal; |
| | | |
| | | /** |
| | | * 实际评价总人数 |
| | | */ |
| | | @ApiModelProperty("实际评价总人数") |
| | | private Integer reallyEvaluateTotal; |
| | | |
| | | /** |
| | | * 未评价总人数 |
| | | */ |
| | | @ApiModelProperty("未评价总人数") |
| | | private Integer noEvaluateTotal; |
| | | |
| | | /** |
| | | * 评价人数百分比 |
| | | */ |
| | | @ApiModelProperty("评价人数百分比") |
| | | private String evaluatePersent; |
| | | } |
| | |
| | | @ApiModelProperty("活动地址") |
| | | private String activityAddr; |
| | | |
| | | @ApiModelProperty("纬度") |
| | | private String lat; |
| | | |
| | | @ApiModelProperty("经度") |
| | | private String lng; |
| | | |
| | | @ApiModelProperty("活动状态 1 待发布 2 未开始 3 报名中 4 进行中 5 已结束 6 已取消") |
| | | private Integer status; |
| | | |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date signUpEnd; |
| | | |
| | | @ApiModelProperty("参加人群(多个以逗号隔开)") |
| | | private String aattendPeople; |
| | | |
| | | @ApiModelProperty("志愿者人数下线") |
| | | private Integer volunteerMin; |
| | | |
| | | @ApiModelProperty("志愿者人数上限") |
| | | @ApiModelProperty("志愿者人数上限(不需要则不填写)") |
| | | private Integer volunteerMax; |
| | | |
| | | @ApiModelProperty("当前志愿者数量") |
| | |
| | | @ApiModelProperty("参与者人数下线") |
| | | private Integer participantMin; |
| | | |
| | | @ApiModelProperty("参与者人数上限") |
| | | @ApiModelProperty("参与者人数上限(不填写则默认不限人数)") |
| | | private Integer participantMax; |
| | | |
| | | @ApiModelProperty("当前参与者数量") |
| | |
| | | |
| | | @ApiModelProperty("是否有奖品 1 有 0 无") |
| | | private Integer hasPrize; |
| | | |
| | | @ApiModelProperty("是否二维码签到 1 是 0否") |
| | | private Integer isQrCode; |
| | | |
| | | @ApiModelProperty("用户最近签到时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date activitySignInDate; |
| | | |
| | | @ApiModelProperty("联系人姓名") |
| | | private String contactName; |
| | | |
| | | @ApiModelProperty("联系人电话") |
| | | private String contactPhone; |
| | | |
| | | @ApiModelProperty("是否签到 1 是 0否") |
| | | private Integer isRegist; |
| | | |
| | | @ApiModelProperty("是否顶部 1 是 0否") |
| | | private Integer isTop; |
| | | |
| | | @ApiModelProperty("奖品备注") |
| | | private String prizeRemark; |
| | |
| | | |
| | | @ApiModelProperty("活动奖品集合") |
| | | private List<ComActActPrizeVO> comActActPrizeVOList; |
| | | |
| | | @ApiModelProperty("活动评价集合") |
| | | private List<ComActActEvaluateVO> comActActEvaluateVOList; |
| | | |
| | | @ApiModelProperty("活动评价总数") |
| | | private Integer evaluateAmount; |
| | | |
| | | @ApiModelProperty("活动评分星级平均数") |
| | | private Double evaluateLevel; |
| | | |
| | | @ApiModelProperty("当前用户对活动的评分") |
| | | private Integer myRating; |
| | | |
| | | @ApiModelProperty("活动是否已默认好评") |
| | | private Integer isDefaultPraise; |
| | | |
| | | @ApiModelProperty(value = "社区id", hidden = true) |
| | | private Long communityId; |
| | |
| | | private Integer isVolunteer = 0; |
| | | |
| | | @ApiModelProperty(value = "当前登录者id", hidden = true) |
| | | private Integer userId; |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty("活动参加普通人员集合") |
| | | private List<ActivitySignVO> activitySignVOList; |
| | |
| | | @ApiModelProperty("banner图位置问卷调查列表") |
| | | private List<ComActQuestnaireAppVO> bannerQuestnaireList; |
| | | |
| | | @ApiModelProperty("banner图位置活动列表") |
| | | private List<ComActActivityVO> bannerActivityList; |
| | | |
| | | @ApiModelProperty("应用位置问卷调查列表") |
| | | private List<ComActQuestnaireAppVO> applicationQuestnaireList; |
| | | |
| | | @ApiModelProperty("banner预约/登记列表") |
| | | private List<ComActReserveIndexVo> comActReserveIndexBannerVos; |
| | | |
| | | @ApiModelProperty("应用预约/登记列表") |
| | | private List<ComActReserveIndexVo> comActReserveIndexApplicationVos; |
| | | |
| | | } |
| | |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | import com.panzhihua.common.model.vos.community.reserve.ComActReserveRegisterDetailedVO; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | private Integer type; |
| | | @ApiModelProperty("题目选项ID") |
| | | private Long selectionId; |
| | | @ApiModelProperty("答题记录id") |
| | | private Long reserveRecordId; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ApiModel("提交预约/登记参数") |
| | | public class ComActReserveCommitVO { |
| | | @ApiModelProperty("记录id") |
| | | private Long id; |
| | | @ApiModelProperty("表单json") |
| | | private String jsonObject; |
| | | @ApiModelProperty("用户id") |
| | | private Long userId; |
| | | @ApiModelProperty("社区id") |
| | | private Long communityId; |
| | | @ApiModelProperty("手机号") |
| | | private String phone; |
| | | @ApiModelProperty("类型 1预约 2登记") |
| | | private Integer type; |
| | | @ApiModelProperty("预约时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date reserveTime; |
| | | @ApiModelProperty("姓名") |
| | | private String name; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("预约/登记返回参数") |
| | | public class ComActReserveIndexVo { |
| | | |
| | | private Long id; |
| | | @ApiModelProperty("标题") |
| | | private String title; |
| | | @ApiModelProperty("类型(1.预约 2.登记) ") |
| | | private Integer type; |
| | | @ApiModelProperty("图标类型(1.预设1 2.预设2 3.预设3 4.预设4 5.用户自定义图片)") |
| | | private Integer imgType; |
| | | @ApiModelProperty("图标url(当img_type为5时,此字段的值为图标url地址)") |
| | | private String imgUrl; |
| | | @ApiModelProperty("是否是首页顶部(1.是 2.否)") |
| | | private Integer adverPositionTop; |
| | | @ApiModelProperty("是否是首页应用(1.是 2.否)") |
| | | private Integer adverPositionApplication; |
| | | } |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | |
| | |
| | | private String dangerType; |
| | | |
| | | /** |
| | | * 状态 |
| | | */ |
| | | @ExcelProperty(value = "状态", index = 3) |
| | | private String status; |
| | | |
| | | /** |
| | | * 风险等级 |
| | | */ |
| | | @ExcelProperty(value = "风险等级", index = 3) |
| | | @ExcelProperty(value = "风险等级", index = 4) |
| | | private String dangerLevel; |
| | | |
| | | /** |
| | | * 巡查人员 |
| | | */ |
| | | @ExcelProperty(value = "巡查人员", index = 4) |
| | | private String personName; |
| | | @ExcelProperty(value = "巡查人员", index = 5) |
| | | private String ppersonName; |
| | | |
| | | /** |
| | | * 联系电话 |
| | | */ |
| | | @ExcelProperty(value = "联系电话", index = 5) |
| | | private String personPhone; |
| | | @ExcelProperty(value = "联系电话", index = 6) |
| | | private String ppersonPhone; |
| | | |
| | | /** |
| | | * 填报时间 |
| | | */ |
| | | @ExcelProperty(value = "填报时间", index = 7) |
| | | private Date createAt; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ExcelProperty(value = "备注", index = 6) |
| | | @ExcelProperty(value = "备注", index = 8) |
| | | private String remark; |
| | | |
| | | /** |
| | | * 整改人员 |
| | | */ |
| | | @ExcelProperty(value = "整改人员", index = 9) |
| | | private String dpersonName; |
| | | |
| | | /** |
| | | * 联系电话 |
| | | */ |
| | | @ExcelProperty(value = "联系电话", index = 10) |
| | | private String dpersonPhone; |
| | | |
| | | /** |
| | | * 整改时间 |
| | | */ |
| | | @ExcelProperty(value = "整改时间", index = 11) |
| | | private Date rectifyTime; |
| | | |
| | | } |
| | |
| | | @ExcelProperty("发生地点") |
| | | private String happenAddr; |
| | | @ExcelProperty("事件类型") |
| | | private String photoType = "其他"; |
| | | private String photoType; |
| | | @ExcelProperty("联系电话") |
| | | private String phone; |
| | | @ExcelProperty("处理人名字") |
| | | private String handlerName; |
| | | @ExcelProperty("创建时间") |
| | | private Date createAt; |
| | | } |
| | |
| | | private int sort; |
| | | @ApiModelProperty(value = "题目内容") |
| | | private String label; |
| | | @ApiModelProperty(value = "类型 0单选1多选2问答题", example = "0") |
| | | @ApiModelProperty(value = "类型 0 单选 1 多选 2 输入框 2姓名输入框 3 手机号 4 身份证 5 文字描述 6 日期选择", example = "0") |
| | | private Integer type; |
| | | @ApiModelProperty(value = "问卷题目选项") |
| | | private List<QuestnaiteSubSelectionVO> options; |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.reserve; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ApiModel("预约登记返回参数") |
| | | public class ComActReserveDetailAdminVO { |
| | | |
| | | @ApiModelProperty("预约登记id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("社区id") |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty("类型(1.预约 2.登记)") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("主题") |
| | | private String title; |
| | | |
| | | @ApiModelProperty("浏览量") |
| | | private Integer viewNum; |
| | | |
| | | @ApiModelProperty("限定参加人总数") |
| | | private Integer joinAllCount; |
| | | |
| | | @ApiModelProperty("参加人数") |
| | | private Integer joinCount; |
| | | |
| | | @ApiModelProperty("广告位置") |
| | | private String advertPosition; |
| | | |
| | | @ApiModelProperty("状态(1.待发布 2.进行中 3.已停止)") |
| | | private Integer status; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @ApiModelProperty("发布时间") |
| | | private Date publishTime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @ApiModelProperty("创建时间") |
| | | private Date createAt; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @ApiModelProperty("结束时间") |
| | | private Date endTime; |
| | | |
| | | @ApiModelProperty("是否是首页顶部(1.是 2.否)") |
| | | private Integer adverPositionTop; |
| | | |
| | | @ApiModelProperty("是否是首页应用(1.是 2.否)") |
| | | private Integer adverPositionApplication; |
| | | |
| | | @ApiModelProperty("组件json数据") |
| | | private String jsonObject; |
| | | |
| | | @ApiModelProperty("是否可重复提交(1.是 2.否)") |
| | | private Integer isRepeat; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.reserve; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class ComActReserveDetailVO { |
| | | private Long id; |
| | | |
| | | /** |
| | | * 社区id |
| | | */ |
| | | private Long communityId; |
| | | |
| | | /** |
| | | * 类型(1.预约 2.登记) |
| | | */ |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 主题 |
| | | */ |
| | | private String title; |
| | | |
| | | /** |
| | | * 浏览量 |
| | | */ |
| | | private Integer viewNum; |
| | | |
| | | /** |
| | | * 总参加人数 |
| | | */ |
| | | private Integer joinAllCount; |
| | | |
| | | /** |
| | | * 参加人数 |
| | | */ |
| | | private Integer joinCount; |
| | | |
| | | /** |
| | | * 图标类型(1.预设1 2.预设2 3.预设3 4.预设4 5.用户自定义图片) |
| | | */ |
| | | private Integer imgType; |
| | | |
| | | /** |
| | | * 图标url(当img_type为5时,此字段的值为图标url地址) |
| | | */ |
| | | private String imgUrl; |
| | | |
| | | /** |
| | | * 状态(1.待发布 2.进行中 3.已停止) |
| | | */ |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 发布时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date publishTime; |
| | | |
| | | /** |
| | | * 是否可重复提交(1.是 2.否) |
| | | */ |
| | | private Integer isRepeat; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String remark; |
| | | |
| | | /** |
| | | * 组件json数据 |
| | | */ |
| | | private String jsonObject; |
| | | |
| | | /** |
| | | * 是否是首页顶部(1.是 2.否) |
| | | */ |
| | | private Integer adverPositionTop; |
| | | |
| | | /** |
| | | * 是否是首页应用(1.是 2.否) |
| | | */ |
| | | private Integer adverPositionApplication; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | private Long createBy; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date updateAt; |
| | | |
| | | /** |
| | | * 修改人 |
| | | */ |
| | | private Long updateBy; |
| | | |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date endTime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date reserveTime; |
| | | |
| | | private Integer recordStatus; |
| | | |
| | | /** |
| | | * 是否已删除(1.是 2.否) |
| | | */ |
| | | private Integer isDel; |
| | | |
| | | private Integer isOk; |
| | | /** |
| | | * 是否重复(1.是 2.否) |
| | | */ |
| | | public interface isOk{ |
| | | int y=1; |
| | | int n=2; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.reserve; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ApiModel("预约登记返回参数") |
| | | public class ComActReserveListAdminVO { |
| | | |
| | | @ApiModelProperty("预约登记id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("社区id") |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty("类型(1.预约 2.登记)") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("主题") |
| | | private String title; |
| | | |
| | | @ApiModelProperty("浏览量") |
| | | private Integer viewNum; |
| | | |
| | | @ApiModelProperty("限定参加人总数") |
| | | private Integer joinAllCount; |
| | | |
| | | @ApiModelProperty("参加人数") |
| | | private Integer joinCount; |
| | | |
| | | @ApiModelProperty("广告位置") |
| | | private String advertPosition; |
| | | |
| | | @ApiModelProperty("状态(1.待发布 2.进行中 3.已停止)") |
| | | private Integer status; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @ApiModelProperty("发布时间") |
| | | private Date publishTime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @ApiModelProperty("创建时间") |
| | | private Date createAt; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @ApiModelProperty("结束时间") |
| | | private Date endTime; |
| | | |
| | | @ApiModelProperty("是否是首页顶部(1.是 2.否)") |
| | | private Integer adverPositionTop; |
| | | |
| | | @ApiModelProperty("是否是首页应用(1.是 2.否)") |
| | | private Integer adverPositionApplication; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.reserve; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel("预约明细列表返回参数") |
| | | public class ComActReserveMakeDetailAdminVO { |
| | | |
| | | @ApiModelProperty("用户昵称") |
| | | private String nickName; |
| | | |
| | | @ApiModelProperty("预约人") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("联系电话") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty("预约时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date reserveTime; |
| | | |
| | | @ApiModelProperty("预约内容") |
| | | private String content; |
| | | |
| | | @ApiModelProperty("备注") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty("社区备注") |
| | | private String actRemark; |
| | | |
| | | @ApiModelProperty("提交时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | @ApiModelProperty("操作记录") |
| | | private List<ComActReserveMakeOperationAdminVO> operationList; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.reserve; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 预约明细导出返回对象 |
| | | */ |
| | | @Data |
| | | public class ComActReserveMakeDetailedExcelAdminVO { |
| | | |
| | | @ExcelProperty(value = "用户昵称" ,index = 0) |
| | | private String nickName; |
| | | @ExcelProperty(value = "预约人" ,index = 1) |
| | | private String name; |
| | | @ExcelProperty(value = "联系电话" ,index = 2) |
| | | private String phone; |
| | | @ExcelProperty(value = "预约时间" ,index = 3) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date reserveTime; |
| | | @ExcelProperty(value = "预约内容" ,index = 4) |
| | | private String content; |
| | | @ExcelProperty(value = "备注" ,index = 5) |
| | | private String remark; |
| | | @ExcelProperty(value = "社区备注" ,index = 6) |
| | | private String actRemark; |
| | | @ExcelProperty(value = "提交时间" ,index = 7) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.reserve; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ApiModel("预约明细列表返回参数") |
| | | public class ComActReserveMakeHandleExcelAdminVO { |
| | | |
| | | @ExcelProperty(value = "用户昵称" ,index = 0) |
| | | private String nickName; |
| | | |
| | | @ExcelProperty(value = "预约登记主题" ,index = 1) |
| | | private String title; |
| | | |
| | | @ExcelProperty(value = "预约人" ,index = 2) |
| | | private String name; |
| | | |
| | | @ExcelProperty(value = "联系电话" ,index = 3) |
| | | private String phone; |
| | | |
| | | @ExcelProperty(value = "预约时间" ,index = 4) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date reserveTime; |
| | | |
| | | @ExcelProperty(value = "预约内容" ,index = 5) |
| | | private String content; |
| | | |
| | | @ExcelProperty(value = "备注" ,index = 6) |
| | | private String remark; |
| | | |
| | | @ExcelProperty(value = "社区备注" ,index = 7) |
| | | private String actRemark; |
| | | |
| | | @ExcelProperty(value = "提交时间" ,index = 8) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | @ExcelProperty(value = "状态" ,index = 9) |
| | | private String status; |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.reserve; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ApiModel("预约明细列表返回参数") |
| | | public class ComActReserveMakeHandleListAdminVO { |
| | | |
| | | @ApiModelProperty("预约记录id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("用户昵称") |
| | | private String nickName; |
| | | |
| | | @ApiModelProperty("预约人") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("联系电话") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty("预约时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date reserveTime; |
| | | |
| | | @ApiModelProperty("预约内容") |
| | | private String content; |
| | | |
| | | @ApiModelProperty("备注") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty("社区备注") |
| | | private String actRemark; |
| | | |
| | | @ApiModelProperty("提交时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | @ApiModelProperty("状态(1.待处理 2.预约成功 3.预约失败 4.已取消)") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty("预约登记主题") |
| | | private String title; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.reserve; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("预约统计左边返回参数") |
| | | public class ComActReserveMakeLeftStatisticsAdminVO { |
| | | |
| | | @ApiModelProperty("预约日期(格式:yyyy-MM-dd)") |
| | | private String reserveTime; |
| | | |
| | | @ApiModelProperty("预约数量") |
| | | private Integer count; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.reserve; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ApiModel("预约明细列表返回参数") |
| | | public class ComActReserveMakeListAdminVO { |
| | | |
| | | @ApiModelProperty("预约记录id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("用户昵称") |
| | | private String nickName; |
| | | |
| | | @ApiModelProperty("预约人") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("联系电话") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty("预约时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date reserveTime; |
| | | |
| | | @ApiModelProperty("预约内容") |
| | | private String content; |
| | | |
| | | @ApiModelProperty("备注") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty("社区备注") |
| | | private String actRemark; |
| | | |
| | | @ApiModelProperty("提交时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.reserve; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel("预约明细操作记录返回参数") |
| | | public class ComActReserveMakeOperationAdminVO { |
| | | |
| | | @ApiModelProperty("预约登记id") |
| | | private Long reserveId; |
| | | |
| | | @ApiModelProperty("预约登记记录id") |
| | | private Long reserveRecordId; |
| | | |
| | | @ApiModelProperty("用户id") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty("类型(1.本人操作 2.社区操作)") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("预约人手机号") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty("操作内容") |
| | | private String reserveContent; |
| | | |
| | | @ApiModelProperty("操作时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date reserveTime; |
| | | |
| | | @ApiModelProperty("备注") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty("状态(1.提交 2.预约成功 3.预约失败 4.取消)") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty("创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | @ApiModelProperty("操作人") |
| | | private String createByName; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.reserve; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 预约统计汇总导出返回对象 |
| | | */ |
| | | @Data |
| | | public class ComActReserveMakeRightExcelAdminVO { |
| | | |
| | | @ExcelProperty(value = "日期" ,index = 0) |
| | | private String reserveTime; |
| | | @ExcelProperty(value = "预约主题" ,index = 1) |
| | | private String title; |
| | | @ExcelProperty(value = "所占百分比" ,index = 2) |
| | | private BigDecimal tag; |
| | | @ExcelProperty(value = "预约量" ,index = 3) |
| | | private Integer count; |
| | | @ExcelProperty(value = "合计" ,index = 4) |
| | | private Integer allCount; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.reserve; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @ApiModel("预约统计右边返回参数") |
| | | public class ComActReserveMakeRightStatisticsAdminVO { |
| | | |
| | | @ApiModelProperty("日期(格式:yyyy-MM-dd)") |
| | | private String reserveTime; |
| | | |
| | | @ApiModelProperty("预约主题") |
| | | private String title; |
| | | |
| | | @ApiModelProperty("所占百分比") |
| | | private BigDecimal tag; |
| | | |
| | | @ApiModelProperty("预约数量") |
| | | private Integer count; |
| | | |
| | | @ApiModelProperty("预约量合计") |
| | | private Integer allCount; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.reserve; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel("预约登记返回参数") |
| | | public class ComActReserveMakeStatisticsAdminVO { |
| | | |
| | | @ApiModelProperty("预约日期数量统计数据") |
| | | private List<ComActReserveMakeLeftStatisticsAdminVO> leftStatisticsList; |
| | | |
| | | @ApiModelProperty("预约统计汇总-右边统计数据") |
| | | private List<ComActReserveMakeRightStatisticsAdminVO> rightStatisticsList; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.reserve; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class ComActReserveRecordListVO { |
| | | private Long id; |
| | | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 预约登记id |
| | | */ |
| | | private Long reserveId; |
| | | |
| | | /** |
| | | * 社区id |
| | | */ |
| | | private Long communityId; |
| | | |
| | | /** |
| | | * 类型(1.预约 2.登记) |
| | | */ |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 提交人名称 |
| | | */ |
| | | private String name; |
| | | |
| | | /** |
| | | * 提交人手机号 |
| | | */ |
| | | private String phone; |
| | | |
| | | /** |
| | | * 状态(1.待处理 2.预约成功 3.预约失败 4.已取消) |
| | | */ |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 内容 |
| | | */ |
| | | private String content; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String remark; |
| | | |
| | | /** |
| | | * 社区备注 |
| | | */ |
| | | private String actRemark; |
| | | |
| | | /** |
| | | * 预约时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date reserveTime; |
| | | |
| | | /** |
| | | * 用户填报json数据 |
| | | */ |
| | | private String jsonObject; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | private Long createBy; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | private Date updateAt; |
| | | |
| | | /** |
| | | * 修改人 |
| | | */ |
| | | private Long updateBy; |
| | | |
| | | /** |
| | | * 标题 |
| | | */ |
| | | private String title; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.reserve; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel("登记明细用户填写答案返回参数") |
| | | public class ComActReserveRegisterDetailedAnswerVO { |
| | | |
| | | @ApiModelProperty("题目id") |
| | | private Long reserveSubId; |
| | | |
| | | @ApiModelProperty("题目内容") |
| | | private String reserveSubContent; |
| | | |
| | | @ApiModelProperty("回答内容") |
| | | private String answerContent; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.reserve; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel("登记明细返回参数") |
| | | public class ComActReserveRegisterDetailedVO { |
| | | |
| | | @ApiModelProperty("流水号") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("用户昵称") |
| | | private String nickName; |
| | | |
| | | @ApiModelProperty("身份") |
| | | private String identity; |
| | | |
| | | @ApiModelProperty("提交时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | @ApiModelProperty("是否是党员(0.否 1.是)") |
| | | private Integer isPartymember; |
| | | |
| | | @ApiModelProperty("是否是志愿者(0.否 1.是)") |
| | | private Integer isVolunteer; |
| | | |
| | | @ApiModelProperty("答案列表") |
| | | private List<ComActReserveRegisterDetailedAnswerVO> answerList; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.reserve; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 登记统计汇总导出返回对象 |
| | | */ |
| | | @Data |
| | | public class ComActReserveRegisterExcelAdminVO { |
| | | |
| | | @ExcelProperty(value = "登记主题" ,index = 0) |
| | | private String title; |
| | | @ExcelProperty(value = "所占百分比" ,index = 1) |
| | | private BigDecimal tag; |
| | | @ExcelProperty(value = "登记量" ,index = 2) |
| | | private Integer count; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.reserve; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel("登记统计汇总返回参数") |
| | | public class ComActReserveRegisterStatisticsAdminVO { |
| | | |
| | | @ApiModelProperty("登记主题") |
| | | private String title; |
| | | |
| | | @ApiModelProperty("所占百分比") |
| | | private BigDecimal tag; |
| | | |
| | | @ApiModelProperty("登记量") |
| | | private Integer count; |
| | | |
| | | @ApiModelProperty("登记总量") |
| | | private Integer allCount; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.reserve; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("登记题目列表返回参数返回参数") |
| | | public class ComActReserveSubListVO { |
| | | |
| | | @ApiModelProperty("题目id") |
| | | private String id; |
| | | |
| | | @ApiModelProperty("题目内容") |
| | | private String content; |
| | | |
| | | public ComActReserveSubListVO() { |
| | | } |
| | | |
| | | public ComActReserveSubListVO(String id, String content){ |
| | | this.id = id; |
| | | this.content = content; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.reserve; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel |
| | | public class ComOperationDetailVO { |
| | | private List<ComOperationListVO> list; |
| | | @ApiModelProperty("1可以继续 2不能继续") |
| | | private Integer isContinue =2; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.reserve; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class ComOperationListVO { |
| | | private Long id; |
| | | |
| | | /** |
| | | * 预约登记id |
| | | */ |
| | | private Long reserveId; |
| | | |
| | | /** |
| | | * 预约登记记录id |
| | | */ |
| | | private Long reserveRecordId; |
| | | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 类型(1.本人操作 2.社区操作) |
| | | */ |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 操作人手机号 |
| | | */ |
| | | private String phone; |
| | | |
| | | /** |
| | | * 操作时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date reserveTime; |
| | | |
| | | /** |
| | | * 操作内容 |
| | | */ |
| | | private String reserveContent; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String remark; |
| | | |
| | | /** |
| | | * 状态(1.提交 2.预约成功 3.预约失败 4.取消) |
| | | */ |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | private Long createBy; |
| | | } |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.*; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import com.panzhihua.common.model.dtos.AppletesBackstageConfigDTO; |
| | | import com.panzhihua.common.model.dtos.PageDTO; |
| | | import com.panzhihua.common.model.dtos.advertisement.ComOpsAdvDTO; |
| | | import com.panzhihua.common.model.dtos.advertisement.PageComOpsAdvDTO; |
| | | import com.panzhihua.common.model.dtos.community.*; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.*; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.BigScreenEventDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.BigScreenEventDetailDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.BigScreenStatisticAgeGenderDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.BigScreenStatisticPartyActivityDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.PageBigScreenStatisticPartyOrg; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenActActivityListDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenActActivityPeopleListDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenDiscussListDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenMicroListDTO; |
| | | import com.panzhihua.common.model.dtos.community.easyPhoto.*; |
| | | import com.panzhihua.common.model.dtos.community.easyPhoto.AddEasyPhotoActivityDTO; |
| | | import com.panzhihua.common.model.dtos.community.easyPhoto.AddEasyPhotoClassifyDTO; |
| | | import com.panzhihua.common.model.dtos.community.easyPhoto.EditEasyPhotoActivityDTO; |
| | | import com.panzhihua.common.model.dtos.community.easyPhoto.ExportEasyPhotoDTO; |
| | | import com.panzhihua.common.model.dtos.community.easyPhoto.PageEasyPhotoActivityDTO; |
| | | import com.panzhihua.common.model.dtos.community.easyPhoto.PageEasyPhotoActivityUserDTO; |
| | | import com.panzhihua.common.model.dtos.community.integral.ComActIntegralCommunityRankDTO; |
| | | import com.panzhihua.common.model.dtos.community.integral.admin.AddComActIntegralUserDTO; |
| | | import com.panzhihua.common.model.dtos.community.integral.admin.EditComActIntegralRuleDTO; |
| | | import com.panzhihua.common.model.dtos.community.integral.admin.PageComActIntegralRuleDTO; |
| | | import com.panzhihua.common.model.dtos.community.integral.admin.PageComActIntegralTradeDTO; |
| | | import com.panzhihua.common.model.dtos.community.questnaire.StatisticsSummaryDTO; |
| | | import com.panzhihua.common.model.dtos.community.reserve.*; |
| | | import com.panzhihua.common.model.dtos.community.switchs.SearchCommunityDTO; |
| | | import com.panzhihua.common.model.dtos.community.wallet.*; |
| | | import com.panzhihua.common.model.dtos.community.wallet.ComActWalletDetailDTO; |
| | | import com.panzhihua.common.model.dtos.community.wallet.ComActWalletSettlementAdminDTO; |
| | | import com.panzhihua.common.model.dtos.community.wallet.PageComActWalletAdminDTO; |
| | | import com.panzhihua.common.model.dtos.community.wallet.PageComActWalletTradeAdminDTO; |
| | | import com.panzhihua.common.model.dtos.community.wallet.PageComActWalletTradeDTO; |
| | | import com.panzhihua.common.model.dtos.elders.ComEldersAuthGetResultDTO; |
| | | import com.panzhihua.common.model.dtos.elders.ComEldersAuthPageDTO; |
| | | import com.panzhihua.common.model.dtos.elders.ComEldersAuthUserAddAppDTO; |
| | | import com.panzhihua.common.model.dtos.grid.*; |
| | | import com.panzhihua.common.model.dtos.grid.admin.*; |
| | | import com.panzhihua.common.model.dtos.neighbor.*; |
| | | import com.panzhihua.common.model.dtos.shop.*; |
| | | import com.panzhihua.common.model.dtos.grid.AddComMngHousePopulationDTO; |
| | | import com.panzhihua.common.model.dtos.grid.ComMngVillageListAppDTO; |
| | | import com.panzhihua.common.model.dtos.grid.DelComMngHousePopulationDTO; |
| | | import com.panzhihua.common.model.dtos.grid.PageComMngPopulationDTO; |
| | | import com.panzhihua.common.model.dtos.grid.PageComMngVillageBuildHouseAppDTO; |
| | | import com.panzhihua.common.model.dtos.grid.PagePopulationListDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.ComMngPopulationExportDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.ComMngPopulationListDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.ComMngPopulationRelationHouseDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.ComMngPopulationSubordinateDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.ComMngVillageListExportAdminDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.PageComMngVillagePopulationDTO; |
| | | import com.panzhihua.common.model.dtos.grid.admin.PageComMngVillagePopulationHouseDTO; |
| | | import com.panzhihua.common.model.dtos.neighbor.AddComActNeighborCircleAppDTO; |
| | | import com.panzhihua.common.model.dtos.neighbor.AddNeighborCircleTopicAdminDTO; |
| | | import com.panzhihua.common.model.dtos.neighbor.ComActNeighborAddBrowseAppDTO; |
| | | import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleAdminDTO; |
| | | import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleAppDTO; |
| | | import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleDetailAppDTO; |
| | | import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleTopicAdminDTO; |
| | | import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCommentAppDTO; |
| | | import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCommentReplyAppDTO; |
| | | import com.panzhihua.common.model.dtos.neighbor.ComActNeighborFabulousAppDTO; |
| | | import com.panzhihua.common.model.dtos.neighbor.ComActNeighborForwardAppDTO; |
| | | import com.panzhihua.common.model.dtos.neighbor.ComActNeighborReplyAppDTO; |
| | | import com.panzhihua.common.model.dtos.neighbor.DetailNeighborAllCommentByAdminDTO; |
| | | import com.panzhihua.common.model.dtos.neighbor.DetailNeighborCommentReplyByAdminDTO; |
| | | import com.panzhihua.common.model.dtos.shop.ComShopAddressDTO; |
| | | import com.panzhihua.common.model.dtos.shop.ComShopCartDTO; |
| | | import com.panzhihua.common.model.dtos.shop.ComShopEditNubCartDTO; |
| | | import com.panzhihua.common.model.dtos.shop.ComShopFundsExportDTO; |
| | | import com.panzhihua.common.model.dtos.shop.ComShopGoodsDTO; |
| | | import com.panzhihua.common.model.dtos.shop.ComShopOrderCreateDTO; |
| | | import com.panzhihua.common.model.dtos.shop.ComShopOrderDeliverDTO; |
| | | import com.panzhihua.common.model.dtos.shop.ComShopOrderExportDTO; |
| | | import com.panzhihua.common.model.dtos.shop.ComShopOrderPreviewDTO; |
| | | import com.panzhihua.common.model.dtos.shop.ComShopOrderQueryDTO; |
| | | import com.panzhihua.common.model.dtos.shop.ComShopOrderShipDTO; |
| | | import com.panzhihua.common.model.dtos.shop.ComShopSysConfDTO; |
| | | import com.panzhihua.common.model.dtos.shop.OrderPayDTO; |
| | | import com.panzhihua.common.model.dtos.shop.PageComOrderListDTO; |
| | | import com.panzhihua.common.model.dtos.shop.PageComShopAddressDTO; |
| | | import com.panzhihua.common.model.dtos.shop.PageComShopFundsSearchDTO; |
| | | import com.panzhihua.common.model.dtos.shop.PageComShopGoodsDTO; |
| | | import com.panzhihua.common.model.dtos.shop.PageComShopOrderSearchDTO; |
| | | import com.panzhihua.common.model.dtos.shop.PageComShopStoreDTO; |
| | | import com.panzhihua.common.model.dtos.shop.PageComShopSysConfDTO; |
| | | import com.panzhihua.common.model.dtos.shop.WxPayNotifyOrderDTO; |
| | | import com.panzhihua.common.model.dtos.user.PageInputUserDTO; |
| | | import com.panzhihua.common.model.dtos.vaccines.*; |
| | | import com.panzhihua.common.model.vos.*; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.model.dtos.vaccines.VaccinesByAdminDTO; |
| | | import com.panzhihua.common.model.dtos.vaccines.VaccinesEnrollByAdminDTO; |
| | | import com.panzhihua.common.model.dtos.vaccines.VaccinesEnrollByAppDTO; |
| | | import com.panzhihua.common.model.dtos.vaccines.VaccinesEnrollUserByAppDTO; |
| | | import com.panzhihua.common.model.dtos.vaccines.VaccinesInoculationByAdminDTO; |
| | | import com.panzhihua.common.model.vos.BcDictionaryItemVO; |
| | | import com.panzhihua.common.model.vos.BcDictionaryVO; |
| | | import com.panzhihua.common.model.vos.DictionaryVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.SystemmanagementConfigVO; |
| | | import com.panzhihua.common.model.vos.community.bigscreen.BigScreenStatisticAgeGender; |
| | | import com.panzhihua.common.model.vos.community.bigscreen.BigScreenStatisticPartyActivity; |
| | | import com.panzhihua.common.model.vos.community.bigscreen.BigScreenStatisticPartyBuild; |
| | |
| | | import com.panzhihua.common.model.vos.community.questnaire.EditComActQuestnaireVo; |
| | | import com.panzhihua.common.model.vos.community.questnaire.QuestnaireVO; |
| | | import com.panzhihua.common.model.vos.community.questnaire.UsersAnswerQuestnaireVO; |
| | | import com.panzhihua.common.model.vos.community.reserve.*; |
| | | import com.panzhihua.common.model.vos.neighbor.AddNeighborCircleAdminVO; |
| | | import com.panzhihua.common.model.vos.neighbor.ChangeCommentReplyStatusByAdminVO; |
| | | import com.panzhihua.common.model.vos.neighbor.ChangeCommentStatusByAdminVO; |
| | |
| | | */ |
| | | @PostMapping("listactivitysign") |
| | | R listActivitySign(@RequestBody ActivitySignVO activitySignVO); |
| | | |
| | | /** |
| | | * description getSignLists 查询活动报名名单 |
| | | * @param activitySignVO 查询参数 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/8/24 14:03 |
| | | */ |
| | | @PostMapping("/activity/sign/getList") |
| | | R getSignLists(@RequestBody ActivitySignVO activitySignVO); |
| | | |
| | | /** |
| | | * description listActivityRegists 分页查询活动评价 |
| | | * @param comActActEvaluateVO 活动评价vo |
| | | * @return R 分页查询结果 |
| | | * @author txb |
| | | * @date 2021/8/24 14:03 |
| | | */ |
| | | @PostMapping("/activity/evaluate/page") |
| | | R pageActivityEvaluates(@RequestBody ComActActEvaluateVO comActActEvaluateVO); |
| | | |
| | | /** |
| | | * description getEvaluateLists 查询活动评价 |
| | | * @param comActActEvaluateVO 查询参数 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/8/24 14:03 |
| | | */ |
| | | @PostMapping("/activity/evaluate/getList") |
| | | R getEvaluateLists(@RequestBody ComActActEvaluateVO comActActEvaluateVO); |
| | | |
| | | /** |
| | | * description pageActivityRegists 分页查询活动签到 |
| | | * @param comActActRegistVO 活动签到vo |
| | | * @return R 分页查询结果 |
| | | * @author txb |
| | | * @date 2021/8/24 14:03 |
| | | */ |
| | | @PostMapping("/activity/regist/page") |
| | | R pageActivityRegists(@RequestBody ComActActRegistVO comActActRegistVO); |
| | | |
| | | /** |
| | | * description getRegistLists 查询活动签到 |
| | | * @param comActActRegistVO 查询参数 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/8/25 9:33 |
| | | */ |
| | | @PostMapping("/activity/regist/getList") |
| | | R getRegistLists(@RequestBody ComActActRegistVO comActActRegistVO); |
| | | |
| | | /** |
| | | * description getRegistLists 查询活动未签到 |
| | | * @param comActActRegistVO 查询参数 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/8/25 9:33 |
| | | */ |
| | | @PostMapping("/activity/noRegist/getList") |
| | | R getNoRegistLists(@RequestBody ComActActRegistVO comActActRegistVO); |
| | | |
| | | /** |
| | | * description activityStagistics 活动数据统计 |
| | | * @param activityId 活动id |
| | | * @return R 统计结果 |
| | | * @author txb |
| | | * @date 2021/8/25 13:33 |
| | | */ |
| | | @GetMapping("/activity/statistics") |
| | | R activityStatistics(@RequestParam("activityId") Long activityId); |
| | | |
| | | /** |
| | | * 获取活动历史封面 getPictureList |
| | | * @param userId 用户id |
| | | * @return R 统计结果 |
| | | * @author txb |
| | | * @date 2021/8/27 13:33 |
| | | */ |
| | | @GetMapping("/activity/picture/getList") |
| | | R getPictureList(@RequestParam("userId") Long userId); |
| | | |
| | | /** |
| | | * 活动报名名单 |
| | |
| | | */ |
| | | @GetMapping("/easyphoto/noHandle/list") |
| | | R easyPhotoNoHandleList(@RequestParam("communityId") Long communityId); |
| | | |
| | | @GetMapping("/reserve/detail") |
| | | R reserveDetail(@RequestParam("id") Long id,@RequestParam("userId") Long userId,@RequestParam("recordId") Long recordId,@RequestParam("isBack") Integer isBack); |
| | | |
| | | @PostMapping("/reserve/commit") |
| | | R reserveCommit(@RequestBody ComActReserveCommitVO comActReserveCommitVO); |
| | | |
| | | /** |
| | | * 我的预约/登记 |
| | | * @param pageUserReserveDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/reserve/userReserveList") |
| | | R userReserveList(@RequestBody PageUserReserveDTO pageUserReserveDTO); |
| | | |
| | | /** |
| | | * 取消预约/登记 |
| | | */ |
| | | @PostMapping("/reserve/cancelReserve") |
| | | R userCancelReserve(@RequestBody CancelRecordDTO comActReserveRecordDO); |
| | | |
| | | /** |
| | | * 预约详情操作记录 |
| | | */ |
| | | @PostMapping("/reserve/detailOperation") |
| | | R reserveOperation(@RequestBody OperationDetailDTO comActReserveOperationRecordDO); |
| | | |
| | | /** |
| | | * 社区后台-分页查询预约登记列表 |
| | | * @param pageReserveDTO 请求参数 |
| | | * @return 预约登记列表 |
| | | */ |
| | | @PostMapping("/reserve/admin/page") |
| | | R pageReserveAdmin(@RequestBody PageReserveAdminDTO pageReserveDTO); |
| | | |
| | | /** |
| | | * 社区后台-新增预约登记信息 |
| | | * @param addReserveDTO 请求参数 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/reserve/admin/add") |
| | | R addReserveAdmin(@RequestBody AddReserveAdminDTO addReserveDTO); |
| | | |
| | | /** |
| | | * 社区后台-编辑预约登记信息 |
| | | * @param editReserveDTO 请求参数 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/reserve/admin/edit") |
| | | R editReserveAdmin(@RequestBody EditReserveAdminDTO editReserveDTO); |
| | | |
| | | /** |
| | | * 社区后台-修改预约登记状态 |
| | | * @param editReserveDTO 请求参数 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("/reserve/admin/edit/status") |
| | | R editReserveStatusAdmin(@RequestBody EditComActReserveStatusDTO editReserveDTO); |
| | | |
| | | /** |
| | | * 社区后台-继续预约登记 |
| | | * @param editReserveDTO 请求参数 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("/reserve/admin/edit/info") |
| | | R editReserveInfoAdmin(@RequestBody EditComActReserveInfoDTO editReserveDTO); |
| | | |
| | | /** |
| | | * 社区后台-根据预约登记id查询详情 |
| | | * @param reserveId 预约登记id |
| | | * @return 预约登记详情 |
| | | */ |
| | | @GetMapping("/reserve/admin/detail") |
| | | R detailReserveAdmin(@RequestParam("reserveId") Long reserveId); |
| | | |
| | | /** |
| | | * 社区后台-根据社区id统计预约类数据 |
| | | * @param makeStatisticsDTO 请求参数 |
| | | * @return 统计预约类数据 |
| | | */ |
| | | @PostMapping("/reserve/admin/make/statistics") |
| | | R makeStatisticsAdmin(@RequestBody ComActReserveMakeStatisticsDTO makeStatisticsDTO); |
| | | |
| | | /** |
| | | * 社区后台-查询导出预约统计汇总数据 |
| | | * @param makeStatisticsDTO 请求参数 |
| | | * @return 统计预约类数据 |
| | | */ |
| | | @PostMapping("/reserve/admin/make/statistics/export") |
| | | R makeStatisticsExportAdmin(@RequestBody ComActReserveMakeStatisticsDTO makeStatisticsDTO); |
| | | |
| | | /** |
| | | * 社区后台-根据预约id查询预约明细 |
| | | * @param pageMakeDTO 请求参数 |
| | | * @return 预约明细 |
| | | */ |
| | | @PostMapping("/reserve/admin/make/page") |
| | | R pageMakeAdmin(@RequestBody PageReserveMakeAdminDTO pageMakeDTO); |
| | | |
| | | /** |
| | | * 根据预约记录id查询预约明细操作记录 |
| | | * @param reserveRecordId 预约记录id |
| | | * @return 预约明细操作记录 |
| | | */ |
| | | @GetMapping("/reserve/admin/make/detail") |
| | | R detailMakeAdmin(@RequestParam("reserveRecordId") Long reserveRecordId); |
| | | |
| | | /** |
| | | * 批量取消预约记录 |
| | | * @param reserveRecordDTO 请求参数 |
| | | * @return 取消结果 |
| | | */ |
| | | @PostMapping("/reserve/admin/make/cancel") |
| | | R makeCancelAdmin(@RequestBody CancelReserveRecordDTO reserveRecordDTO); |
| | | |
| | | /** |
| | | * 预约明细导出数据查询 |
| | | * @param pageMakeDTO 请求参数 |
| | | * @return 预约明细数据 |
| | | */ |
| | | @PostMapping("/reserve/admin/make/list/export") |
| | | R exportMakeAdmin(@RequestBody PageReserveMakeAdminDTO pageMakeDTO); |
| | | |
| | | /** |
| | | * 分页查询登记统计汇总 |
| | | * @param registerStatisticsDTO 请求参数 |
| | | * @return 登记统计汇总 |
| | | */ |
| | | @PostMapping("/reserve/admin/register/page") |
| | | R registerStatisticsAdmin(@RequestBody ComActReserveRegisterStatisticsDTO registerStatisticsDTO); |
| | | |
| | | /** |
| | | * 导出登记统计汇总 |
| | | * @param registerStatisticsDTO 请求参数 |
| | | * @return 登记统计汇总 |
| | | */ |
| | | @PostMapping("/reserve/admin/register/export") |
| | | R registerStatisticsExportAdmin(@RequestBody ComActReserveRegisterStatisticsDTO registerStatisticsDTO); |
| | | |
| | | /** |
| | | * 分页查询预约处理列表 |
| | | * @param pageMakeHandleDTO 请求参数 |
| | | * @return 预约处理列表 |
| | | */ |
| | | @PostMapping("/reserve/admin/make/handle/page") |
| | | R pageMakeHandleAdmin(@RequestBody PageReserveMakeHandleAdminDTO pageMakeHandleDTO); |
| | | |
| | | /** |
| | | * 批量处理预约记录 |
| | | * @param makeHandleDTO 请求参数 |
| | | * @return 处理结果 |
| | | */ |
| | | @PostMapping("/reserve/admin/make/handle") |
| | | R makeHandleAdmin(@RequestBody MakeHandleAdminDTO makeHandleDTO); |
| | | |
| | | /** |
| | | * 导出预约处理列表数据查询 |
| | | * @param pageMakeHandleDTO 请求参数 |
| | | * @return 预约处理列表 |
| | | */ |
| | | @PostMapping("/reserve/admin/make/handle/export") |
| | | R exportMakeHandleAdmin(@RequestBody PageReserveMakeHandleAdminDTO pageMakeHandleDTO); |
| | | |
| | | /** |
| | | * 删除预约登记信息 |
| | | * @param reserveId 预约登记id |
| | | * @return 删除结果 |
| | | */ |
| | | @GetMapping("/reserve/admin/delete") |
| | | R deleteReserveAdmin(@RequestParam("reserveId") Long reserveId); |
| | | |
| | | /** |
| | | * 查询社区所有预约信息列表 |
| | | * @param communityId 社区id |
| | | * @return 预约信息列表 |
| | | */ |
| | | @GetMapping("/reserve/admin/list") |
| | | R listReserveAdmin(@RequestParam("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 导出登记明细数据 |
| | | * @param reserveId 登记id |
| | | * @return 登记明细数据 |
| | | */ |
| | | @GetMapping("/reserve/admin/register/list/export") |
| | | R exportRegisterAdmin(@RequestParam("reserveId") Long reserveId); |
| | | |
| | | /** |
| | | * 查询预约登记题目列表 |
| | | * @param reserveId 预约登记id |
| | | * @return 约登记题目列表 |
| | | */ |
| | | @GetMapping("/reserve/admin/subject/list") |
| | | R subjectListAdmin(@RequestParam("reserveId") Long reserveId); |
| | | |
| | | /** |
| | | * 分页查询登记明细列表 |
| | | * @param detailedAdminDTO 请求参数 |
| | | * @return 登记明细列表 |
| | | */ |
| | | @PostMapping("/reserve/admin/register/detailed/list") |
| | | R registerDetailedListAdmin(@RequestBody PageReserveRegisterDetailedAdminDTO detailedAdminDTO); |
| | | |
| | | /** |
| | | * 查询登记详情记录 |
| | | * @param reserveRecordId 登记记录id |
| | | * @return 登记详情记录 |
| | | */ |
| | | @GetMapping("/reserve/admin/register/detailed/detail") |
| | | R registerDetailedDetailAdmin(@RequestParam("reserveRecordId") Long reserveRecordId); |
| | | /** |
| | | * 活动签到 |
| | | * |
| | | * @param comActActRegistVO 请求参数 |
| | | * @return 签到结果 |
| | | */ |
| | | @PostMapping("/activity/sign-in") |
| | | R activitySignIn(@RequestBody ComActActRegistVO comActActRegistVO); |
| | | |
| | | /** |
| | | * 用户签到列表 |
| | | * |
| | | * @param userId 用户id |
| | | * @return 用户签到记录列表 |
| | | */ |
| | | @GetMapping("/sign-in/user/list") |
| | | R listSignInActivity(@RequestParam("userId") Long userId); |
| | | |
| | | /** |
| | | * 社区活动评价 |
| | | * |
| | | * @param comActActEvaluateVO 社区评价VO |
| | | * @return 评价结果 |
| | | */ |
| | | @PostMapping("/activity/evaluate") |
| | | R activityEvaluate(@RequestBody ComActActEvaluateVO comActActEvaluateVO); |
| | | |
| | | /** |
| | | * 用户评价列表 |
| | | * |
| | | * @param userId 用户id |
| | | * @return 当前用户对所有活动的评价列表 |
| | | */ |
| | | @GetMapping("/evaluate/user/list") |
| | | R listEvaluate(@RequestParam("userId") Long userId); |
| | | |
| | | /** |
| | | * 定时任务针对活动结束后7天还未评价的用户默认好评 |
| | | */ |
| | | @PostMapping("/activity/default-praise") |
| | | R timedTaskActivityDefaultPraise(); |
| | | } |
| | |
| | | package com.panzhihua.common.utlis; |
| | | |
| | | import java.io.File; |
| | | import java.io.InputStream; |
| | | import java.io.*; |
| | | import java.util.zip.ZipEntry; |
| | | import java.util.zip.ZipOutputStream; |
| | | |
| | | public class FileUtil { |
| | | |
| | |
| | | public static File readUserHomeFile(String pathName) { |
| | | return new File(System.getProperty("user.home") + File.separator + pathName); |
| | | } |
| | | |
| | | /** |
| | | * 压缩文件 |
| | | * |
| | | * @param sourceFilePath 源文件路径 |
| | | * @param zipFilePath 压缩后文件存储路径 |
| | | * @param zipFilename 压缩文件名 |
| | | */ |
| | | public static void compressToZip(String sourceFilePath, String zipFilePath, String zipFilename) { |
| | | File sourceFile = new File(sourceFilePath); |
| | | File zipPath = new File(zipFilePath); |
| | | if (!zipPath.exists()) { |
| | | zipPath.mkdirs(); |
| | | } |
| | | File zipFile = new File(zipPath + File.separator + zipFilename); |
| | | try (ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zipFile))) { |
| | | writeZip(sourceFile, "", zos); |
| | | //文件压缩完成后,删除被压缩文件 |
| | | boolean flag = deleteDir(sourceFile); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | throw new RuntimeException(e.getMessage(), e.getCause()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 遍历所有文件,压缩 |
| | | * |
| | | * @param file 源文件目录 |
| | | * @param parentPath 压缩文件目录 |
| | | * @param zos 文件流 |
| | | */ |
| | | private static void writeZip(File file, String parentPath, ZipOutputStream zos) { |
| | | if (file.isDirectory()) { |
| | | //目录 |
| | | parentPath += file.getName() + File.separator; |
| | | File[] files = file.listFiles(); |
| | | for (File f : files) { |
| | | writeZip(f, parentPath, zos); |
| | | } |
| | | } else { |
| | | //文件 |
| | | try (BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file))) { |
| | | //指定zip文件夹 |
| | | ZipEntry zipEntry = new ZipEntry(parentPath + file.getName()); |
| | | zos.putNextEntry(zipEntry); |
| | | int len; |
| | | byte[] buffer = new byte[1024 * 10]; |
| | | while ((len = bis.read(buffer, 0, buffer.length)) != -1) { |
| | | zos.write(buffer, 0, len); |
| | | zos.flush(); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | throw new RuntimeException(e.getMessage(), e.getCause()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 删除文件夹 |
| | | * |
| | | * @param dir |
| | | * @return |
| | | */ |
| | | |
| | | } |
| | | private static boolean deleteDir (File dir){ |
| | | if (dir.isDirectory()) { |
| | | String[] children = dir.list(); |
| | | for (int i = 0; i < children.length; i++) { |
| | | boolean success = deleteDir(new File(dir, children[i])); |
| | | if (!success) { |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | //删除空文件夹 |
| | | return dir.delete(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.utlis; |
| | | |
| | | import java.awt.BasicStroke; |
| | | import java.awt.Graphics; |
| | | import java.awt.Graphics2D; |
| | | import java.awt.Image; |
| | | import java.awt.Shape; |
| | | import java.awt.geom.RoundRectangle2D; |
| | | import java.awt.image.BufferedImage; |
| | | import java.io.File; |
| | | import java.io.OutputStream; |
| | | import java.util.Hashtable; |
| | | import java.util.Random; |
| | | |
| | | import javax.imageio.ImageIO; |
| | | |
| | | import com.google.zxing.BarcodeFormat; |
| | | import com.google.zxing.BinaryBitmap; |
| | | import com.google.zxing.DecodeHintType; |
| | | import com.google.zxing.EncodeHintType; |
| | | import com.google.zxing.MultiFormatReader; |
| | | import com.google.zxing.MultiFormatWriter; |
| | | import com.google.zxing.Result; |
| | | import com.google.zxing.client.j2se.BufferedImageLuminanceSource; |
| | | import com.google.zxing.common.BitMatrix; |
| | | import com.google.zxing.common.HybridBinarizer; |
| | | import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; |
| | | |
| | | public class QRCodeUtils { |
| | | private static final String CHARSET = "utf-8"; |
| | | private static final String FORMAT_NAME = "JPG"; |
| | | // 二维码尺寸 |
| | | private static final int QRCODE_SIZE = 300; |
| | | // LOGO宽度 |
| | | private static final int WIDTH = 60; |
| | | // LOGO高度 |
| | | private static final int HEIGHT = 60; |
| | | |
| | | private static BufferedImage createImage(String content, String imgPath, |
| | | boolean needCompress) throws Exception { |
| | | Hashtable<EncodeHintType, Object> hints = new Hashtable<EncodeHintType, Object>(); |
| | | hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H); |
| | | hints.put(EncodeHintType.CHARACTER_SET, CHARSET); |
| | | hints.put(EncodeHintType.MARGIN, 1); |
| | | BitMatrix bitMatrix = new MultiFormatWriter().encode(content, |
| | | BarcodeFormat.QR_CODE, QRCODE_SIZE, QRCODE_SIZE, hints); |
| | | int width = bitMatrix.getWidth(); |
| | | int height = bitMatrix.getHeight(); |
| | | BufferedImage image = new BufferedImage(width, height, |
| | | BufferedImage.TYPE_INT_RGB); |
| | | for (int x = 0; x < width; x++) { |
| | | for (int y = 0; y < height; y++) { |
| | | image.setRGB(x, y, bitMatrix.get(x, y) ? 0xFF000000 |
| | | : 0xFFFFFFFF); |
| | | } |
| | | } |
| | | if (imgPath == null || "".equals(imgPath)) { |
| | | return image; |
| | | } |
| | | // 插入图片 |
| | | QRCodeUtils.insertImage(image, imgPath, needCompress); |
| | | return image; |
| | | } |
| | | |
| | | /** |
| | | * 插入LOGO |
| | | * |
| | | * @param source |
| | | * 二维码图片 |
| | | * @param imgPath |
| | | * LOGO图片地址 |
| | | * @param needCompress |
| | | * 是否压缩 |
| | | * @throws Exception |
| | | */ |
| | | private static void insertImage(BufferedImage source, String imgPath, |
| | | boolean needCompress) throws Exception { |
| | | File file = new File(imgPath); |
| | | if (!file.exists()) { |
| | | System.err.println(""+imgPath+" 该文件不存在!"); |
| | | return; |
| | | } |
| | | Image src = ImageIO.read(new File(imgPath)); |
| | | int width = src.getWidth(null); |
| | | int height = src.getHeight(null); |
| | | if (needCompress) { // 压缩LOGO |
| | | if (width > WIDTH) { |
| | | width = WIDTH; |
| | | } |
| | | if (height > HEIGHT) { |
| | | height = HEIGHT; |
| | | } |
| | | Image image = src.getScaledInstance(width, height, |
| | | Image.SCALE_SMOOTH); |
| | | BufferedImage tag = new BufferedImage(width, height, |
| | | BufferedImage.TYPE_INT_RGB); |
| | | Graphics g = tag.getGraphics(); |
| | | g.drawImage(image, 0, 0, null); // 绘制缩小后的图 |
| | | g.dispose(); |
| | | src = image; |
| | | } |
| | | // 插入LOGO |
| | | Graphics2D graph = source.createGraphics(); |
| | | int x = (QRCODE_SIZE - width) / 2; |
| | | int y = (QRCODE_SIZE - height) / 2; |
| | | graph.drawImage(src, x, y, width, height, null); |
| | | Shape shape = new RoundRectangle2D.Float(x, y, width, width, 6, 6); |
| | | graph.setStroke(new BasicStroke(3f)); |
| | | graph.draw(shape); |
| | | graph.dispose(); |
| | | } |
| | | |
| | | /** |
| | | * 生成二维码(内嵌LOGO) |
| | | * |
| | | * @param content |
| | | * 内容 |
| | | * @param imgPath |
| | | * LOGO地址 |
| | | * @param destPath |
| | | * 存放目录 |
| | | * @param needCompress |
| | | * 是否压缩LOGO |
| | | * @throws Exception |
| | | */ |
| | | public static String encode(String content, String imgPath, String destPath, |
| | | boolean needCompress) throws Exception { |
| | | BufferedImage image = QRCodeUtils.createImage(content, imgPath, |
| | | needCompress); |
| | | mkdirs(destPath); |
| | | String file = Snowflake.getId() + ".jpg"; |
| | | ImageIO.write(image, FORMAT_NAME, new File(destPath+"/"+file)); |
| | | return file; |
| | | } |
| | | |
| | | /** |
| | | * 当文件夹不存在时,mkdirs会自动创建多层目录,区别于mkdir.(mkdir如果父目录不存在则会抛出异常) |
| | | * @date 2013-12-11 上午10:16:36 |
| | | * @param destPath 存放目录 |
| | | */ |
| | | public static void mkdirs(String destPath) { |
| | | File file =new File(destPath); |
| | | //当文件夹不存在时,mkdirs会自动创建多层目录,区别于mkdir.(mkdir如果父目录不存在则会抛出异常) |
| | | if (!file.exists() && !file.isDirectory()) { |
| | | file.mkdirs(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 生成二维码(内嵌LOGO) |
| | | * |
| | | * @param content |
| | | * 内容 |
| | | * @param imgPath |
| | | * LOGO地址 |
| | | * @param destPath |
| | | * 存储地址 |
| | | * @throws Exception |
| | | */ |
| | | public static void encode(String content, String imgPath, String destPath) |
| | | throws Exception { |
| | | QRCodeUtils.encode(content, imgPath, destPath, false); |
| | | } |
| | | |
| | | /** |
| | | * 生成二维码 |
| | | * |
| | | * @param content |
| | | * 内容 |
| | | * @param destPath |
| | | * 存储地址 |
| | | * @param needCompress |
| | | * 是否压缩LOGO |
| | | * @throws Exception |
| | | */ |
| | | public static void encode(String content, String destPath, |
| | | boolean needCompress) throws Exception { |
| | | QRCodeUtils.encode(content, null, destPath, needCompress); |
| | | } |
| | | |
| | | /** |
| | | * 生成二维码 |
| | | * |
| | | * @param content |
| | | * 内容 |
| | | * @param destPath |
| | | * 存储地址 |
| | | * @throws Exception |
| | | */ |
| | | public static void encode(String content, String destPath) throws Exception { |
| | | QRCodeUtils.encode(content, null, destPath, false); |
| | | } |
| | | |
| | | /** |
| | | * 生成二维码(内嵌LOGO) |
| | | * |
| | | * @param content |
| | | * 内容 |
| | | * @param imgPath |
| | | * LOGO地址 |
| | | * @param output |
| | | * 输出流 |
| | | * @param needCompress |
| | | * 是否压缩LOGO |
| | | * @throws Exception |
| | | */ |
| | | public static void encode(String content, String imgPath, |
| | | OutputStream output, boolean needCompress) throws Exception { |
| | | BufferedImage image = QRCodeUtils.createImage(content, imgPath, |
| | | needCompress); |
| | | ImageIO.write(image, FORMAT_NAME, output); |
| | | } |
| | | |
| | | /** |
| | | * 生成二维码 |
| | | * |
| | | * @param content |
| | | * 内容 |
| | | * @param output |
| | | * 输出流 |
| | | * @throws Exception |
| | | */ |
| | | public static void encode(String content, OutputStream output) |
| | | throws Exception { |
| | | QRCodeUtils.encode(content, null, output, false); |
| | | } |
| | | |
| | | /** |
| | | * 解析二维码 |
| | | * |
| | | * @param file |
| | | * 二维码图片 |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static String decode(File file) throws Exception { |
| | | BufferedImage image; |
| | | image = ImageIO.read(file); |
| | | if (image == null) { |
| | | return null; |
| | | } |
| | | BufferedImageLuminanceSource source = new BufferedImageLuminanceSource( |
| | | image); |
| | | BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source)); |
| | | Result result; |
| | | Hashtable<DecodeHintType, Object> hints = new Hashtable<DecodeHintType, Object>(); |
| | | hints.put(DecodeHintType.CHARACTER_SET, CHARSET); |
| | | result = new MultiFormatReader().decode(bitmap, hints); |
| | | String resultStr = result.getText(); |
| | | return resultStr; |
| | | } |
| | | |
| | | /** |
| | | * 解析二维码 |
| | | * |
| | | * @param path |
| | | * 二维码图片地址 |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static String decode(String path) throws Exception { |
| | | return QRCodeUtils.decode(new File(path)); |
| | | } |
| | | } |
| | |
| | | <artifactId>minio</artifactId> |
| | | <version>6.0.8</version> |
| | | </dependency> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>org.jxls</groupId>--> |
| | | <!-- <artifactId>jxls</artifactId>--> |
| | | <!-- <version>2.6.0</version>--> |
| | | <!-- </dependency>--> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>org.jxls</groupId>--> |
| | | <!-- <artifactId>jxls-poi</artifactId>--> |
| | | <!-- <version>1.1.0</version>--> |
| | | <!-- </dependency>--> |
| | | </dependencies> |
| | | |
| | | <build> |
New file |
| | |
| | | package com.panzhihua.community_backstage.api; |
| | | |
| | | 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.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.enums.ReserveRecordStatusEnum; |
| | | import com.panzhihua.common.model.dtos.community.QuestnaireAnswersDTO; |
| | | import com.panzhihua.common.model.dtos.community.reserve.*; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActQuestnaireAnswerContentVO; |
| | | import com.panzhihua.common.model.vos.community.ComActQuestnaireSubVO; |
| | | import com.panzhihua.common.model.vos.community.ComCvtBusinessVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationExcelVo; |
| | | import com.panzhihua.common.model.vos.community.questnaire.QuestnaireStatisticsSummaryExcelAdminVO; |
| | | 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.DateUtils; |
| | | import com.panzhihua.common.utlis.SFTPUtil; |
| | | import com.panzhihua.community_backstage.config.SFTPConfig; |
| | | import com.panzhihua.community_backstage.excel.CustomSheetWriteHandler; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.InputStream; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @description: 预约登记接口 |
| | | * @author: lyq |
| | | * @date: 2021-8-23 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"预约登记"}) |
| | | @RestController |
| | | @RequestMapping("/reserve") |
| | | public class ComActReserveApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | @Resource |
| | | private UserService userService; |
| | | @Resource |
| | | private SFTPConfig sftpConfig; |
| | | |
| | | @ApiOperation(value = "分页查询预约登记列表", response = ComActReserveListAdminVO.class) |
| | | @PostMapping("/page") |
| | | public R page(@RequestBody PageReserveAdminDTO pageReserveDTO) { |
| | | Long communityId = this.getCommunityId(); |
| | | pageReserveDTO.setCommunityId(communityId); |
| | | return communityService.pageReserveAdmin(pageReserveDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增预约登记记录") |
| | | @PostMapping("/add") |
| | | public R add(@RequestBody AddReserveAdminDTO addReserveDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if (loginUserInfo == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | addReserveDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | addReserveDTO.setUserId(loginUserInfo.getUserId()); |
| | | return communityService.addReserveAdmin(addReserveDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除预约登记") |
| | | @PostMapping("/delete") |
| | | public R delete(@RequestParam("reserveId") Long reserveId) { |
| | | return communityService.deleteReserveAdmin(reserveId); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询社区所有预约登记列表") |
| | | @GetMapping("/list") |
| | | public R list() { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if (loginUserInfo == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | return communityService.listReserveAdmin(loginUserInfo.getCommunityId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "编辑预约登记记录") |
| | | @PostMapping("/edit") |
| | | public R edit(@RequestBody EditReserveAdminDTO editReserveDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if (loginUserInfo == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | editReserveDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | editReserveDTO.setUserId(loginUserInfo.getUserId()); |
| | | return communityService.editReserveAdmin(editReserveDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "修改预约登记状态") |
| | | @PostMapping("/edit/status") |
| | | public R editStatus(@RequestBody EditComActReserveStatusDTO editReserveDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if (loginUserInfo == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | editReserveDTO.setUserId(loginUserInfo.getUserId()); |
| | | return communityService.editReserveStatusAdmin(editReserveDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "点击继续预约登记") |
| | | @PostMapping("/edit/info") |
| | | public R editInfo(@RequestBody EditComActReserveInfoDTO editReserveDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if (loginUserInfo == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | editReserveDTO.setUserId(loginUserInfo.getUserId()); |
| | | return communityService.editReserveInfoAdmin(editReserveDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "预约登记详情") |
| | | @PostMapping("/detail") |
| | | public R detail(@RequestParam("reserveId") Long reserveId) { |
| | | return communityService.detailReserveAdmin(reserveId); |
| | | } |
| | | |
| | | @ApiOperation(value = "预约类统计汇总", response = ComActReserveMakeStatisticsAdminVO.class) |
| | | @PostMapping("/make/statistics") |
| | | public R makeStatistics(@RequestBody ComActReserveMakeStatisticsDTO makeStatisticsDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if (loginUserInfo == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | makeStatisticsDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | return communityService.makeStatisticsAdmin(makeStatisticsDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "预约登记统计汇总导出") |
| | | @PostMapping("/make/statistics/export") |
| | | public R makeStatisticsExport(@RequestBody ComActReserveMakeStatisticsDTO makeStatisticsDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if (loginUserInfo == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | makeStatisticsDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | String url = sftpConfig.getExcelUrl(); |
| | | String name = "预约登记统计汇总导出数据.xlsx"; |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | R r = communityService.makeStatisticsExportAdmin(makeStatisticsDTO); |
| | | if (R.isOk(r)) { |
| | | List<ComActReserveMakeRightExcelAdminVO> resultList = new ArrayList<>(); |
| | | List<ComActReserveMakeRightStatisticsAdminVO> rightStatisticsList = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ComActReserveMakeRightStatisticsAdminVO.class); |
| | | rightStatisticsList.forEach(rightStatistics -> { |
| | | ComActReserveMakeRightExcelAdminVO makeRightExcelAdminVO = new ComActReserveMakeRightExcelAdminVO(); |
| | | BeanUtils.copyProperties(rightStatistics,makeRightExcelAdminVO); |
| | | resultList.add(makeRightExcelAdminVO); |
| | | }); |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(sftpConfig.getUserName(), sftpConfig.getPassword(), sftpConfig.getHost(), sftpConfig.getPort()); |
| | | 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, ComActReserveMakeRightExcelAdminVO.class) |
| | | .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) |
| | | .registerWriteHandler(new CustomSheetWriteHandler()).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet("预约登记统计汇总导出数据").build(); |
| | | excelWriter.write(resultList, 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; |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询预约明细列表", response = ComActReserveMakeListAdminVO.class) |
| | | @PostMapping("/make/page") |
| | | public R pageMake(@RequestBody PageReserveMakeAdminDTO pageMakeDTO) { |
| | | return communityService.pageMakeAdmin(pageMakeDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询预约明细详情", response = ComActReserveMakeDetailAdminVO.class) |
| | | @GetMapping("/make/detail") |
| | | public R detailMake(@RequestParam("reserveRecordId") Long reserveRecordId) { |
| | | return communityService.detailMakeAdmin(reserveRecordId); |
| | | } |
| | | |
| | | @ApiOperation(value = "取消预约记录", response = ComActReserveMakeDetailAdminVO.class) |
| | | @PostMapping("/make/cancel") |
| | | public R makeCancel(@RequestBody CancelReserveRecordDTO reserveRecordDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if (loginUserInfo == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | reserveRecordDTO.setUserId(loginUserInfo.getUserId()); |
| | | return communityService.makeCancelAdmin(reserveRecordDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "预约明细导出") |
| | | @PostMapping("/make/list/export") |
| | | public R exportMake(@RequestBody PageReserveMakeAdminDTO pageMakeDTO) { |
| | | String url = sftpConfig.getExcelUrl(); |
| | | String name = "预约明细导出数据.xlsx"; |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | R r = communityService.exportMakeAdmin(pageMakeDTO); |
| | | if (R.isOk(r)) { |
| | | List<ComActReserveMakeDetailedExcelAdminVO> resultList = new ArrayList<>(); |
| | | List<ComActReserveMakeListAdminVO> rightStatisticsList = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ComActReserveMakeListAdminVO.class); |
| | | rightStatisticsList.forEach(rightStatistics -> { |
| | | ComActReserveMakeDetailedExcelAdminVO makeRightExcelAdminVO = new ComActReserveMakeDetailedExcelAdminVO(); |
| | | BeanUtils.copyProperties(rightStatistics,makeRightExcelAdminVO); |
| | | resultList.add(makeRightExcelAdminVO); |
| | | }); |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(sftpConfig.getUserName(), sftpConfig.getPassword(), sftpConfig.getHost(), sftpConfig.getPort()); |
| | | 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, ComActReserveMakeRightExcelAdminVO.class) |
| | | .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) |
| | | .registerWriteHandler(new CustomSheetWriteHandler()).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet("预约明细导出数据").build(); |
| | | excelWriter.write(resultList, 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; |
| | | } |
| | | |
| | | @ApiOperation(value = "登记类统计汇总", response = ComActReserveRegisterStatisticsAdminVO.class) |
| | | @PostMapping("/register/statistics") |
| | | public R registerStatistics(@RequestBody ComActReserveRegisterStatisticsDTO registerStatisticsDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if (loginUserInfo == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | registerStatisticsDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | return communityService.registerStatisticsAdmin(registerStatisticsDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "登记类统计导出", response = ComActReserveRegisterStatisticsAdminVO.class) |
| | | @PostMapping("/register/statistics/export") |
| | | public R registerStatisticsExport(@RequestBody ComActReserveRegisterStatisticsDTO registerStatisticsDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if (loginUserInfo == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | registerStatisticsDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | String url = sftpConfig.getExcelUrl(); |
| | | String name = "登记统计汇总导出数据.xlsx"; |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | R r = communityService.registerStatisticsExportAdmin(registerStatisticsDTO); |
| | | if (R.isOk(r)) { |
| | | List<ComActReserveRegisterExcelAdminVO> resultList = new ArrayList<>(); |
| | | List<ComActReserveRegisterStatisticsAdminVO> rightStatisticsList = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ComActReserveRegisterStatisticsAdminVO.class); |
| | | rightStatisticsList.forEach(rightStatistics -> { |
| | | ComActReserveRegisterExcelAdminVO makeRightExcelAdminVO = new ComActReserveRegisterExcelAdminVO(); |
| | | BeanUtils.copyProperties(rightStatistics,makeRightExcelAdminVO); |
| | | resultList.add(makeRightExcelAdminVO); |
| | | }); |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(sftpConfig.getUserName(), sftpConfig.getPassword(), sftpConfig.getHost(), sftpConfig.getPort()); |
| | | 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, ComActReserveRegisterExcelAdminVO.class) |
| | | .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) |
| | | .registerWriteHandler(new CustomSheetWriteHandler()).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet("登记统计汇总导出数据").build(); |
| | | excelWriter.write(resultList, 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; |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询预约处理列表", response = ComActReserveMakeHandleListAdminVO.class) |
| | | @PostMapping("/make/handle/page") |
| | | public R pageMakeHandle(@RequestBody PageReserveMakeHandleAdminDTO pageMakeHandleDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if (loginUserInfo == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | pageMakeHandleDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | return communityService.pageMakeHandleAdmin(pageMakeHandleDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "批量处理预约记录") |
| | | @PostMapping("/make/handle") |
| | | public R makeHandle(@RequestBody MakeHandleAdminDTO makeHandleDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if (loginUserInfo == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | makeHandleDTO.setUserId(loginUserInfo.getUserId()); |
| | | return communityService.makeHandleAdmin(makeHandleDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "预约处理列表导出") |
| | | @PostMapping("/make/handle/export") |
| | | public R exportMakeHandle(@RequestBody PageReserveMakeHandleAdminDTO pageMakeHandleDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if (loginUserInfo == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | pageMakeHandleDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | String url = sftpConfig.getExcelUrl(); |
| | | String name = "预约处理列表导出数据.xlsx"; |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | R r = communityService.exportMakeHandleAdmin(pageMakeHandleDTO); |
| | | if (R.isOk(r)) { |
| | | List<ComActReserveMakeHandleExcelAdminVO> resultList = new ArrayList<>(); |
| | | List<ComActReserveMakeHandleListAdminVO> rightStatisticsList = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ComActReserveMakeHandleListAdminVO.class); |
| | | rightStatisticsList.forEach(rightStatistics -> { |
| | | ComActReserveMakeHandleExcelAdminVO makeRightExcelAdminVO = new ComActReserveMakeHandleExcelAdminVO(); |
| | | BeanUtils.copyProperties(rightStatistics,makeRightExcelAdminVO); |
| | | makeRightExcelAdminVO.setStatus(ReserveRecordStatusEnum.getCnDescByName(rightStatistics.getStatus())); |
| | | resultList.add(makeRightExcelAdminVO); |
| | | }); |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(sftpConfig.getUserName(), sftpConfig.getPassword(), sftpConfig.getHost(), sftpConfig.getPort()); |
| | | 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, ComActReserveMakeHandleExcelAdminVO.class) |
| | | .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) |
| | | .registerWriteHandler(new CustomSheetWriteHandler()).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet("预约处理列表导出数据").build(); |
| | | excelWriter.write(resultList, 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; |
| | | } |
| | | |
| | | @ApiOperation(value = "导出登记明细") |
| | | @GetMapping("/register/list/export") |
| | | public R exportRegister(@RequestParam("reserveId") Long reserveId) { |
| | | |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | String name = "登记明细导出数据.xlsx"; |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(sftpConfig.getUserName(), sftpConfig.getPassword(), sftpConfig.getHost(), sftpConfig.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 { |
| | | /** |
| | | * 组合导出数据 |
| | | * 用户问卷答案 |
| | | */ |
| | | R QuestnaireAnswersDTOR = communityService.exportRegisterAdmin(reserveId); |
| | | QuestnaireAnswersDTO questnaireAnswersDTOS = JSON.parseObject(JSON.toJSONString(QuestnaireAnswersDTOR.getData()), QuestnaireAnswersDTO.class); |
| | | |
| | | List<ComActQuestnaireSubVO> subVOList = questnaireAnswersDTOS.getSubs(); |
| | | //构造表头 |
| | | List<List<String>> headList = new ArrayList<List<String>>(); |
| | | String firstRowContent = "调查结果"; |
| | | List<String> head0 = new ArrayList<>(); |
| | | head0.add(firstRowContent); |
| | | head0.add("姓名"); |
| | | headList.add(head0); |
| | | List<String> head1 = new ArrayList<>(); |
| | | head1.add(firstRowContent); |
| | | head1.add("提交时间"); |
| | | headList.add(head1); |
| | | subVOList.forEach(sub -> { |
| | | List<String> headn = new ArrayList<>(); |
| | | headn.add(firstRowContent); |
| | | headn.add(sub.getContent()); |
| | | headList.add(headn); |
| | | }); |
| | | List<List<Object>> datalist = new ArrayList<>(); |
| | | List<ComActQuestnaireAnswerContentVO> answerContentVOList = questnaireAnswersDTOS.getAnswers(); |
| | | if(answerContentVOList!=null && answerContentVOList.size()>0) { |
| | | List<Object> userData = new ArrayList<>(); |
| | | List<ComActQuestnaireAnswerContentVO> usersAnswers = questnaireAnswersDTOS.getAnswers(); |
| | | //查询用户回答的所有答案,并新增到答案列表中 |
| | | ComActReserveRegisterDetailedVO recordListVO = questnaireAnswersDTOS.getRecordListVO(); |
| | | userData.add(recordListVO.getNickName()); |
| | | userData.add(DateUtils.format(recordListVO.getCreateAt(),DateUtils.ymdhms_format)); |
| | | Long reserveRecordId = null; |
| | | for (ComActQuestnaireAnswerContentVO userAnswers:usersAnswers) { |
| | | if(reserveRecordId == null){ |
| | | reserveRecordId = userAnswers.getReserveRecordId(); |
| | | } |
| | | if(!reserveRecordId.equals(userAnswers.getReserveRecordId())){ |
| | | datalist.add(userData); |
| | | userData = new ArrayList<>(); |
| | | userData.add(recordListVO.getNickName()); |
| | | userData.add(DateUtils.format(recordListVO.getCreateAt(),DateUtils.ymdhms_format)); |
| | | reserveRecordId = userAnswers.getReserveRecordId(); |
| | | } |
| | | userData.add(userAnswers.getAnswerContent()); |
| | | } |
| | | } |
| | | |
| | | 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, ComMngPopulationExcelVo.class) |
| | | .registerWriteHandler(horizontalCellStyleStrategy) |
| | | .registerWriteHandler(longestMatchColumnWidthStyleStrategy) |
| | | .registerWriteHandler(new CustomSheetWriteHandler()).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet("登记明细导出数据").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 R.ok(sftpConfig.getExcelUrl() + name); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "查询题目列表",response = ComActReserveSubListVO.class) |
| | | @GetMapping("/subject/list") |
| | | public R subjectList(@RequestParam("reserveId") Long reserveId) { |
| | | return communityService.subjectListAdmin(reserveId); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询登记明细列表",response = ComActReserveRegisterDetailedVO.class) |
| | | @PostMapping("/register/detailed/list") |
| | | public R registerDetailedList(@RequestBody PageReserveRegisterDetailedAdminDTO detailedAdminDTO) { |
| | | return communityService.registerDetailedListAdmin(detailedAdminDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询登记明细详情",response = ComActReserveRegisterDetailedVO.class) |
| | | @PostMapping("/register/detailed/detail") |
| | | public R registerDetailedDetail(@RequestParam("reserveRecordId") Long reserveRecordId) { |
| | | return communityService.registerDetailedDetailAdmin(reserveRecordId); |
| | | } |
| | | |
| | | } |
| | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import com.jcraft.jsch.SftpException; |
| | | import com.panzhihua.common.utlis.*; |
| | | import org.apache.commons.io.FileUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.service.partybuilding.PartyBuildingService; |
| | | import com.panzhihua.common.utlis.HttpUtils; |
| | | import com.panzhihua.common.utlis.SFTPUtil; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.community_backstage.excel.CustomSheetWriteHandler; |
| | | |
| | | import freemarker.template.Configuration; |
| | |
| | | */ |
| | | @ApiOperation(value = "导出台账-隐患报告") |
| | | @PostMapping("/danger/export") |
| | | public R exportComMngCar(@RequestBody List<Long> dangerReportIds) { |
| | | public R exportDangerReportBook(@RequestBody List<Long> dangerReportIds) { |
| | | String url = excelUrl; |
| | | String name = "隐患报告台账导出数据.xlsx"; |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | |
| | | @PostMapping("/export/safetyWorkRecord") |
| | | public R exportSafetyWorkRecord(@RequestBody List<Long> ids) { |
| | | Long communityId = this.getLoginUserInfo().getCommunityId(); |
| | | List<String> downLoadUrl = new ArrayList<>(); |
| | | try { |
| | | for (Long id : ids) { |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | String property = System.getProperty("user.dir"); |
| | | String sourceFile =property+File.separator+"word"+File.separator+System.currentTimeMillis()+File.separator; |
| | | String zipFile=property+File.separator+"zip"+File.separator; |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | for (Long id : ids) { |
| | | try { |
| | | Map<String, Object> dataMap = new HashMap<String, Object>(); |
| | | ComSwSafetyWorkRecordVO comSwSafetyWorkRecordVO = JSONObject.parseObject( |
| | | JSONObject.toJSONString(communityService.detailSafetyWorkRecord(id, communityId).getData()), |
| | | ComSwSafetyWorkRecordVO.class); |
| | | // 生成动态模板excel通过ftp工具上传到主节点,然后返回模板下载地址 |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | String name = "安全工作记录_" + comSwSafetyWorkRecordVO.getId() + ".doc"; |
| | | 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; |
| | | File file0=new File("d:/safetyWork/file"); |
| | | if(!file0.isDirectory()&&!file0.exists()){ |
| | | file0.mkdirs(); |
| | | } |
| | | file0 = new File(sourceFile); |
| | | if(!file0.isDirectory()&&!file0.exists()){ |
| | | file0.mkdirs(); |
| | | } |
| | | sftp.download("/mnt/data/web/", "安全工作记录.ftl", "d:/safetyWork/file/安全工作记录.ftl"); |
| | | sftp.download("/mnt/data/web/", "blank.jpg", "d:/safetyWork/file/blank.jpg"); |
| | | try { |
| | | // 日期 |
| | | dataMap.put("date", |
| | | new SimpleDateFormat("yyyy-MM-dd").format(comSwSafetyWorkRecordVO.getPatrolTime())); |
| | | if (comSwSafetyWorkRecordVO.getPatrolTime() != null) { |
| | | dataMap.put("date", |
| | | new SimpleDateFormat("yyyy-MM-dd").format(comSwSafetyWorkRecordVO.getPatrolTime())); |
| | | }else { |
| | | dataMap.put("date", ""); |
| | | } |
| | | // 巡查类型 |
| | | dataMap.put("patrolType", comSwSafetyWorkRecordVO.getPatrolType()); |
| | | // 社区名称 |
| | | dataMap.put("communityName", comSwSafetyWorkRecordVO.getCommunityName()); |
| | | if (StringUtils.isNotEmpty(comSwSafetyWorkRecordVO.getCommunityName())) { |
| | | dataMap.put("communityName", comSwSafetyWorkRecordVO.getCommunityName()); |
| | | }else { |
| | | dataMap.put("communityName", ""); |
| | | } |
| | | // 地址 |
| | | dataMap.put("address", comSwSafetyWorkRecordVO.getAddress()); |
| | | if (StringUtils.isNotEmpty(comSwSafetyWorkRecordVO.getAddress())) { |
| | | dataMap.put("address", comSwSafetyWorkRecordVO.getAddress()); |
| | | }else { |
| | | dataMap.put("address", ""); |
| | | } |
| | | // 记录内容 |
| | | dataMap.put("recordContent", comSwSafetyWorkRecordVO.getRecordContent()); |
| | | if (StringUtils.isNotEmpty(comSwSafetyWorkRecordVO.getRecordContent())) { |
| | | dataMap.put("recordContent", comSwSafetyWorkRecordVO.getRecordContent()); |
| | | }else { |
| | | dataMap.put("recordContent", ""); |
| | | } |
| | | // 发现记录 |
| | | dataMap.put("findRecord", comSwSafetyWorkRecordVO.getFindRecord()); |
| | | if (StringUtils.isNotEmpty(comSwSafetyWorkRecordVO.getFindRecord())) { |
| | | dataMap.put("findRecord", comSwSafetyWorkRecordVO.getFindRecord()); |
| | | }else { |
| | | dataMap.put("findRecord", ""); |
| | | } |
| | | // 记录照片 |
| | | List<String> photo = new ArrayList<>(); |
| | | if (StringUtils.isNotEmpty(comSwSafetyWorkRecordVO.getRecordPhoto())) { |
| | |
| | | if (photo.size() == 1) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 1) { |
| | | downloadPicture(photo.get(i), comSwSafetyWorkRecordVO.getId() + "_" + i); |
| | | downloadPicture(photo.get(i), comSwSafetyWorkRecordVO.getId() + "_" + i, "d:/safetyWork/file/"); |
| | | dataMap.put("imgStr" + (i + 1), |
| | | getImageStr("d:/" + comSwSafetyWorkRecordVO.getId() + "_" + i + ".jpg")); |
| | | getImageStr("d:/safetyWork/file/" + comSwSafetyWorkRecordVO.getId() + "_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/blank.jpg")); |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/safetyWork/file/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (photo.size() == 2) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 2) { |
| | | downloadPicture(photo.get(i), comSwSafetyWorkRecordVO.getId() + "_" + i); |
| | | downloadPicture(photo.get(i), comSwSafetyWorkRecordVO.getId() + "_" + i, "d:/safetyWork/file/"); |
| | | dataMap.put("imgStr" + (i + 1), |
| | | getImageStr("d:/" + comSwSafetyWorkRecordVO.getId() + "_" + i + ".jpg")); |
| | | getImageStr("d:/safetyWork/file/" + comSwSafetyWorkRecordVO.getId() + "_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/blank.jpg")); |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/safetyWork/file/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (photo.size() == 3) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 3) { |
| | | downloadPicture(photo.get(i), comSwSafetyWorkRecordVO.getId() + "_" + i); |
| | | downloadPicture(photo.get(i), comSwSafetyWorkRecordVO.getId() + "_" + i, "d:/safetyWork/file/"); |
| | | dataMap.put("imgStr" + (i + 1), |
| | | getImageStr("d:/" + comSwSafetyWorkRecordVO.getId() + "_" + i + ".jpg")); |
| | | getImageStr("d:/safetyWork/file/" + comSwSafetyWorkRecordVO.getId() + "_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/blank.jpg")); |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/safetyWork/file/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (photo.size() == 4) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 4) { |
| | | downloadPicture(photo.get(i), comSwSafetyWorkRecordVO.getId() + "_" + i); |
| | | downloadPicture(photo.get(i), comSwSafetyWorkRecordVO.getId() + "_" + i, "d:/safetyWork/file/"); |
| | | dataMap.put("imgStr" + (i + 1), |
| | | getImageStr("d:/" + comSwSafetyWorkRecordVO.getId() + "_" + i + ".jpg")); |
| | | getImageStr("d:/safetyWork/file/" + comSwSafetyWorkRecordVO.getId() + "_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/blank.jpg")); |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/safetyWork/file/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (photo.size() == 5) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 5) { |
| | | downloadPicture(photo.get(i), comSwSafetyWorkRecordVO.getId() + "_" + i); |
| | | downloadPicture(photo.get(i), comSwSafetyWorkRecordVO.getId() + "_" + i, "d:/safetyWork/file/"); |
| | | dataMap.put("imgStr" + (i + 1), |
| | | getImageStr("d:/" + comSwSafetyWorkRecordVO.getId() + "_" + i + ".jpg")); |
| | | getImageStr("d:/safetyWork/file/" + comSwSafetyWorkRecordVO.getId() + "_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/blank.jpg")); |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/safetyWork/file/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (photo.size() == 6) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 6) { |
| | | downloadPicture(photo.get(i), comSwSafetyWorkRecordVO.getId() + "_" + i); |
| | | downloadPicture(photo.get(i), comSwSafetyWorkRecordVO.getId() + "_" + i, "d:/safetyWork/file/"); |
| | | dataMap.put("imgStr" + (i + 1), |
| | | getImageStr("d:/" + comSwSafetyWorkRecordVO.getId() + "_" + i + ".jpg")); |
| | | getImageStr("d:/safetyWork/file/" + comSwSafetyWorkRecordVO.getId() + "_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/blank.jpg")); |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/safetyWork/file/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (photo.size() == 7) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 7) { |
| | | downloadPicture(photo.get(i), comSwSafetyWorkRecordVO.getId() + "_" + i); |
| | | downloadPicture(photo.get(i), comSwSafetyWorkRecordVO.getId() + "_" + i, "d:/safetyWork/file/"); |
| | | dataMap.put("imgStr" + (i + 1), |
| | | getImageStr("d:/" + comSwSafetyWorkRecordVO.getId() + "_" + i + ".jpg")); |
| | | getImageStr("d:/safetyWork/file/" + comSwSafetyWorkRecordVO.getId() + "_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/blank.jpg")); |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/safetyWork/file/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (photo.size() == 8) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 8) { |
| | | downloadPicture(photo.get(i), comSwSafetyWorkRecordVO.getId() + "_" + i); |
| | | downloadPicture(photo.get(i), comSwSafetyWorkRecordVO.getId() + "_" + i, "d:/safetyWork/file/"); |
| | | dataMap.put("imgStr" + (i + 1), |
| | | getImageStr("d:/" + comSwSafetyWorkRecordVO.getId() + "_" + i + ".jpg")); |
| | | getImageStr("d:/safetyWork/file/" + comSwSafetyWorkRecordVO.getId() + "_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/blank.jpg")); |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/safetyWork/file/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (photo.size() == 9) { |
| | | for (int i = 0; i < 9; i++) { |
| | | downloadPicture(photo.get(i), comSwSafetyWorkRecordVO.getId() + "_" + i); |
| | | downloadPicture(photo.get(i), comSwSafetyWorkRecordVO.getId() + "_" + i, "d:/safetyWork/file/"); |
| | | dataMap.put("imgStr" + (i + 1), |
| | | getImageStr("d:/" + comSwSafetyWorkRecordVO.getId() + "_" + i + ".jpg")); |
| | | getImageStr("d:/safetyWork/file/" + comSwSafetyWorkRecordVO.getId() + "_" + i + ".jpg")); |
| | | } |
| | | } |
| | | } else { |
| | | for (int i = 0; i < 9; i++) { |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/blank.jpg")); |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/safetyWork/file/blank.jpg")); |
| | | } |
| | | } |
| | | // 备注 |
| | | dataMap.put("remark", comSwSafetyWorkRecordVO.getRemark()); |
| | | if (StringUtils.isNotEmpty(comSwSafetyWorkRecordVO.getRemark())) { |
| | | dataMap.put("remark", comSwSafetyWorkRecordVO.getRemark()); |
| | | }else { |
| | | dataMap.put("remark", ""); |
| | | } |
| | | // 巡查时间 |
| | | dataMap.put("patrolTime", |
| | | new SimpleDateFormat("yyyy-MM-dd").format(comSwSafetyWorkRecordVO.getPatrolTime())); |
| | | if (comSwSafetyWorkRecordVO.getPatrolTime() != null) { |
| | | dataMap.put("patrolTime", |
| | | new SimpleDateFormat("yyyy-MM-dd").format(comSwSafetyWorkRecordVO.getPatrolTime())); |
| | | }else { |
| | | dataMap.put("patrolTime", ""); |
| | | } |
| | | // 工作人员 |
| | | dataMap.put("personName", comSwSafetyWorkRecordVO.getPersonName()); |
| | | if (StringUtils.isNotEmpty(comSwSafetyWorkRecordVO.getPersonName())) { |
| | | dataMap.put("personName", comSwSafetyWorkRecordVO.getPersonName()); |
| | | }else { |
| | | dataMap.put("personName", ""); |
| | | } |
| | | // 填报人员 |
| | | dataMap.put("createName", comSwSafetyWorkRecordVO.getCreateName()); |
| | | if (StringUtils.isNotEmpty(comSwSafetyWorkRecordVO.getCreateName())) { |
| | | dataMap.put("createName", comSwSafetyWorkRecordVO.getCreateName()); |
| | | }else { |
| | | dataMap.put("createName", ""); |
| | | } |
| | | // 填报时间 |
| | | dataMap.put("createAt", |
| | | new SimpleDateFormat("yyyy-MM-dd").format(comSwSafetyWorkRecordVO.getCreateAt())); |
| | | new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(comSwSafetyWorkRecordVO.getCreateAt())); |
| | | // 获取请求url |
| | | String url = Constants.G_D_WEATHER_URL; |
| | | // 获取请求参数 |
| | |
| | | // configuration.setClassForTemplateLoading(this.getClass(), ""); |
| | | |
| | | // 指定路径的第二种方式,我的路径是C:/a.ftl |
| | | configuration.setDirectoryForTemplateLoading(new File("c:/")); |
| | | configuration.setDirectoryForTemplateLoading(new File("d:/safetyWork/file/")); |
| | | |
| | | // 输出文档路径及名称 |
| | | // File outFile = new File("mnt/data/web/excel/安全工作记录_" + comSwSafetyWorkRecordVO.getId() + |
| | | // ".doc"); |
| | | File file = new File(fileName); |
| | | File file = new File(sourceFile + name); |
| | | |
| | | // 以utf-8的编码读取ftl文件 |
| | | Template template = configuration.getTemplate("安全工作记录.ftl", "utf-8"); |
| | |
| | | new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8), 10240); |
| | | template.process(dataMap, out); |
| | | out.close(); |
| | | 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); |
| | | // 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) { |
| | |
| | | } |
| | | } |
| | | } |
| | | downLoadUrl.add(excelUrl + name); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | } |
| | | return R.ok(downLoadUrl); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | } |
| | | return R.fail(); |
| | | FileUtil.compressToZip(sourceFile,zipFile,"安全工作记录.zip"); |
| | | String currentDateString = String.valueOf(System.currentTimeMillis()); |
| | | String name = "安全工作记录_"+ currentDateString+".zip"; |
| | | try { |
| | | InputStream inputStream=new FileInputStream(zipFile+"安全工作记录.zip"); |
| | | sftp.uploadMore(ftpUrl, name , inputStream); |
| | | sftp.logout(); |
| | | inputStream.close(); |
| | | FileUtils.deleteDirectory(new File(property+File.separator+"word"+File.separator)); |
| | | FileUtils.deleteDirectory(new File(zipFile)); |
| | | } catch (FileNotFoundException e) { |
| | | e.printStackTrace(); |
| | | } catch (SftpException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return R.ok(excelUrl + name); |
| | | } |
| | | |
| | | @ApiOperation(value = "下载巡查记录报告") |
| | | @PostMapping("/export/patrolRecord") |
| | | public R exportPatrolRecord(@RequestBody List<Long> ids) { |
| | | Long communityId = this.getLoginUserInfo().getCommunityId(); |
| | | List<String> downLoadUrl = new ArrayList<>(); |
| | | try { |
| | | for (Long id : ids) { |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | String property = System.getProperty("user.dir"); |
| | | String sourceFile =property+File.separator+"word"+File.separator+System.currentTimeMillis()+File.separator; |
| | | String zipFile=property+File.separator+"zip"+File.separator; |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | for (Long id : ids) { |
| | | try { |
| | | Map<String, Object> dataMap = new HashMap<String, Object>(); |
| | | ComSwPatrolRecordVO comSwPatrolRecordVO = |
| | | JSONObject.parseObject(JSONObject.toJSONString(communityService.detailPatrolRecord(id).getData()), |
| | | ComSwPatrolRecordVO.class); |
| | | // 生成动态模板excel通过ftp工具上传到主节点,然后返回模板下载地址 |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | String name = "巡查记录_" + comSwPatrolRecordVO.getId() + ".doc"; |
| | | |
| | | 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; |
| | | File file0=new File("d:/patrolRecord/file"); |
| | | if(!file0.isDirectory()&&!file0.exists()){ |
| | | file0.mkdirs(); |
| | | } |
| | | file0 = new File(sourceFile); |
| | | if(!file0.isDirectory()&&!file0.exists()){ |
| | | file0.mkdirs(); |
| | | } |
| | | sftp.download("/mnt/data/web/", "巡查记录.ftl", "d:/patrolRecord/file/巡查记录.ftl"); |
| | | sftp.download("/mnt/data/web/", "blank.jpg", "d:/patrolRecord/file/blank.jpg"); |
| | | try { |
| | | // 日期 |
| | | dataMap.put("date", |
| | | new SimpleDateFormat("yyyy-MM-dd").format(comSwPatrolRecordVO.getPatrolTime())); |
| | | if (comSwPatrolRecordVO.getPatrolTime() != null) { |
| | | dataMap.put("date", |
| | | new SimpleDateFormat("yyyy-MM-dd").format(comSwPatrolRecordVO.getPatrolTime())); |
| | | }else { |
| | | dataMap.put("date", ""); |
| | | } |
| | | // 巡查类型 |
| | | dataMap.put("patrolType", comSwPatrolRecordVO.getPatrolType()); |
| | | if (StringUtils.isNotEmpty(comSwPatrolRecordVO.getPatrolType())) { |
| | | dataMap.put("patrolType", comSwPatrolRecordVO.getPatrolType()); |
| | | }else { |
| | | dataMap.put("patrolType", ""); |
| | | } |
| | | // 社区名称 |
| | | // dataMap.put("communityName", comSwPatrolRecordVO.getCommunityName()); |
| | | // 地址 |
| | | dataMap.put("address", comSwPatrolRecordVO.getAddress()); |
| | | if (StringUtils.isNotEmpty(comSwPatrolRecordVO.getAddress())) { |
| | | dataMap.put("address", comSwPatrolRecordVO.getAddress()); |
| | | }else { |
| | | dataMap.put("address", ""); |
| | | } |
| | | // 记录内容 |
| | | dataMap.put("recordContent", comSwPatrolRecordVO.getRecordContent()); |
| | | if (StringUtils.isNotEmpty(comSwPatrolRecordVO.getRecordContent())) { |
| | | dataMap.put("recordContent", comSwPatrolRecordVO.getRecordContent()); |
| | | }else { |
| | | dataMap.put("recordContent", ""); |
| | | } |
| | | // 发现记录 |
| | | dataMap.put("findRecord", comSwPatrolRecordVO.getFindRecord()); |
| | | if (StringUtils.isNotEmpty(comSwPatrolRecordVO.getFindRecord())) { |
| | | dataMap.put("findRecord", comSwPatrolRecordVO.getFindRecord()); |
| | | }else { |
| | | dataMap.put("findRecord", ""); |
| | | } |
| | | // 记录照片 |
| | | List<String> photo = new ArrayList<>(); |
| | | if (StringUtils.isNotEmpty(comSwPatrolRecordVO.getRecordPhoto())) { |
| | |
| | | if (photo.size() == 1) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 1) { |
| | | downloadPicture(photo.get(i), comSwPatrolRecordVO.getId() + "_" + i); |
| | | downloadPicture(photo.get(i), comSwPatrolRecordVO.getId() + "_" + i, "d:/patrolRecord/file/"); |
| | | dataMap.put("imgStr" + (i + 1), |
| | | getImageStr("d:/" + comSwPatrolRecordVO.getId() + "_" + i + ".jpg")); |
| | | getImageStr("d:/patrolRecord/file/" + comSwPatrolRecordVO.getId() + "_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/blank.jpg")); |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/patrolRecord/file/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (photo.size() == 2) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 2) { |
| | | downloadPicture(photo.get(i), comSwPatrolRecordVO.getId() + "_" + i); |
| | | downloadPicture(photo.get(i), comSwPatrolRecordVO.getId() + "_" + i, "d:/patrolRecord/file/"); |
| | | dataMap.put("imgStr" + (i + 1), |
| | | getImageStr("d:/" + comSwPatrolRecordVO.getId() + "_" + i + ".jpg")); |
| | | getImageStr("d:/patrolRecord/file/" + comSwPatrolRecordVO.getId() + "_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/blank.jpg")); |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/patrolRecord/file/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (photo.size() == 3) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 3) { |
| | | downloadPicture(photo.get(i), comSwPatrolRecordVO.getId() + "_" + i); |
| | | downloadPicture(photo.get(i), comSwPatrolRecordVO.getId() + "_" + i, "d:/patrolRecord/file/"); |
| | | dataMap.put("imgStr" + (i + 1), |
| | | getImageStr("d:/" + comSwPatrolRecordVO.getId() + "_" + i + ".jpg")); |
| | | getImageStr("d:/patrolRecord/file/" + comSwPatrolRecordVO.getId() + "_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/blank.jpg")); |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/patrolRecord/file/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (photo.size() == 4) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 4) { |
| | | downloadPicture(photo.get(i), comSwPatrolRecordVO.getId() + "_" + i); |
| | | downloadPicture(photo.get(i), comSwPatrolRecordVO.getId() + "_" + i, "d:/patrolRecord/file/"); |
| | | dataMap.put("imgStr" + (i + 1), |
| | | getImageStr("d:/" + comSwPatrolRecordVO.getId() + "_" + i + ".jpg")); |
| | | getImageStr("d:/patrolRecord/file/" + comSwPatrolRecordVO.getId() + "_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/blank.jpg")); |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/patrolRecord/file/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (photo.size() == 5) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 5) { |
| | | downloadPicture(photo.get(i), comSwPatrolRecordVO.getId() + "_" + i); |
| | | downloadPicture(photo.get(i), comSwPatrolRecordVO.getId() + "_" + i, "d:/patrolRecord/file/"); |
| | | dataMap.put("imgStr" + (i + 1), |
| | | getImageStr("d:/" + comSwPatrolRecordVO.getId() + "_" + i + ".jpg")); |
| | | getImageStr("d:/patrolRecord/file/" + comSwPatrolRecordVO.getId() + "_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/blank.jpg")); |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/patrolRecord/file/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (photo.size() == 6) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 6) { |
| | | downloadPicture(photo.get(i), comSwPatrolRecordVO.getId() + "_" + i); |
| | | downloadPicture(photo.get(i), comSwPatrolRecordVO.getId() + "_" + i, "d:/patrolRecord/file/"); |
| | | dataMap.put("imgStr" + (i + 1), |
| | | getImageStr("d:/" + comSwPatrolRecordVO.getId() + "_" + i + ".jpg")); |
| | | getImageStr("d:/patrolRecord/file/" + comSwPatrolRecordVO.getId() + "_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/blank.jpg")); |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/patrolRecord/file/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (photo.size() == 7) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 7) { |
| | | downloadPicture(photo.get(i), comSwPatrolRecordVO.getId() + "_" + i); |
| | | downloadPicture(photo.get(i), comSwPatrolRecordVO.getId() + "_" + i, "d:/patrolRecord/file/"); |
| | | dataMap.put("imgStr" + (i + 1), |
| | | getImageStr("d:/" + comSwPatrolRecordVO.getId() + "_" + i + ".jpg")); |
| | | getImageStr("d:/patrolRecord/file/" + comSwPatrolRecordVO.getId() + "_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/blank.jpg")); |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/patrolRecord/file/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (photo.size() == 8) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 8) { |
| | | downloadPicture(photo.get(i), comSwPatrolRecordVO.getId() + "_" + i); |
| | | downloadPicture(photo.get(i), comSwPatrolRecordVO.getId() + "_" + i, "d:/patrolRecord/file/"); |
| | | dataMap.put("imgStr" + (i + 1), |
| | | getImageStr("d:/" + comSwPatrolRecordVO.getId() + "_" + i + ".jpg")); |
| | | getImageStr("d:/patrolRecord/file/" + comSwPatrolRecordVO.getId() + "_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/blank.jpg")); |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/patrolRecord/file/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (photo.size() == 9) { |
| | | for (int i = 0; i < 9; i++) { |
| | | downloadPicture(photo.get(i), comSwPatrolRecordVO.getId() + "_" + i); |
| | | downloadPicture(photo.get(i), comSwPatrolRecordVO.getId() + "_" + i, "d:/patrolRecord/file/"); |
| | | dataMap.put("imgStr" + (i + 1), |
| | | getImageStr("d:/" + comSwPatrolRecordVO.getId() + "_" + i + ".jpg")); |
| | | getImageStr("d:/patrolRecord/file/" + comSwPatrolRecordVO.getId() + "_" + i + ".jpg")); |
| | | } |
| | | } |
| | | } else { |
| | | for (int i = 0; i < 9; i++) { |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/blank.jpg")); |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/patrolRecord/file/blank.jpg")); |
| | | } |
| | | } |
| | | // 备注 |
| | | dataMap.put("remark", comSwPatrolRecordVO.getRemark()); |
| | | if (StringUtils.isNotEmpty(comSwPatrolRecordVO.getRemark())) { |
| | | dataMap.put("remark", comSwPatrolRecordVO.getRemark()); |
| | | }else { |
| | | dataMap.put("remark", ""); |
| | | } |
| | | // 巡查时间 |
| | | // dataMap.put("patrolTime", new |
| | | // SimpleDateFormat("yyyy-MM-dd").format(comSwPatrolRecordVO.getPatrolTime())); |
| | | // 工作人员 |
| | | // dataMap.put("personName", comSwPatrolRecordVO.getPersonName()); |
| | | // 巡查人员 |
| | | dataMap.put("personName", comSwPatrolRecordVO.getPersonName()); |
| | | if (StringUtils.isNotEmpty(comSwPatrolRecordVO.getPersonName())) { |
| | | dataMap.put("personName", comSwPatrolRecordVO.getPersonName()); |
| | | }else { |
| | | dataMap.put("personName", ""); |
| | | } |
| | | // 接班时间 |
| | | dataMap.put("successionTime", |
| | | new SimpleDateFormat("yyyy-MM-dd").format(comSwPatrolRecordVO.getSuccessionTime())); |
| | | if (comSwPatrolRecordVO.getSuccessionTime() != null) { |
| | | dataMap.put("successionTime", |
| | | new SimpleDateFormat("yyyy-MM-dd").format(comSwPatrolRecordVO.getSuccessionTime())); |
| | | }else { |
| | | dataMap.put("successionTime", ""); |
| | | } |
| | | // 接班人员 |
| | | dataMap.put("successionPerson", comSwPatrolRecordVO.getSuccessionPerson()); |
| | | if (StringUtils.isNotEmpty(comSwPatrolRecordVO.getSuccessionPerson())) { |
| | | dataMap.put("successionPerson", comSwPatrolRecordVO.getSuccessionPerson()); |
| | | }else { |
| | | dataMap.put("successionPerson", ""); |
| | | } |
| | | // 填报人员 |
| | | dataMap.put("createName", comSwPatrolRecordVO.getCreateName()); |
| | | if (StringUtils.isNotEmpty(comSwPatrolRecordVO.getCreateName())) { |
| | | dataMap.put("createName", comSwPatrolRecordVO.getCreateName()); |
| | | }else { |
| | | dataMap.put("createName", ""); |
| | | } |
| | | // 填报时间 |
| | | dataMap.put("createAt", |
| | | new SimpleDateFormat("yyyy-MM-dd").format(comSwPatrolRecordVO.getCreateAt())); |
| | | new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(comSwPatrolRecordVO.getCreateAt())); |
| | | // 获取请求url |
| | | String url = Constants.G_D_WEATHER_URL; |
| | | // 获取请求参数 |
| | |
| | | // configuration.setClassForTemplateLoading(this.getClass(), ""); |
| | | |
| | | // 指定路径的第二种方式,我的路径是C:/a.ftl |
| | | configuration.setDirectoryForTemplateLoading(new File("c:/")); |
| | | configuration.setDirectoryForTemplateLoading(new File("d:/patrolRecord/file/")); |
| | | |
| | | // 输出文档路径及名称 |
| | | // File outFile = new File("mnt/data/web/excel/安全工作记录_" + comSwSafetyWorkRecordVO.getId() + |
| | | // ".doc"); |
| | | File file = new File(fileName); |
| | | File file = new File(sourceFile + name); |
| | | |
| | | // 以utf-8的编码读取ftl文件 |
| | | Template template = configuration.getTemplate("巡查记录.ftl", "utf-8"); |
| | |
| | | new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8), 10240); |
| | | template.process(dataMap, out); |
| | | out.close(); |
| | | 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); |
| | | // 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) { |
| | |
| | | } |
| | | } |
| | | } |
| | | downLoadUrl.add(excelUrl + name); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | } |
| | | return R.ok(downLoadUrl); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | } |
| | | return R.fail(); |
| | | FileUtil.compressToZip(sourceFile,zipFile,"巡查记录.zip"); |
| | | String currentDateString = String.valueOf(System.currentTimeMillis()); |
| | | String name = "巡查记录_"+ currentDateString+".zip"; |
| | | try { |
| | | InputStream inputStream=new FileInputStream(zipFile+"巡查记录.zip"); |
| | | sftp.uploadMore(ftpUrl, name , inputStream); |
| | | sftp.logout(); |
| | | inputStream.close(); |
| | | FileUtils.deleteDirectory(new File(property+File.separator+"word"+File.separator)); |
| | | FileUtils.deleteDirectory(new File(zipFile)); |
| | | } catch (FileNotFoundException e) { |
| | | e.printStackTrace(); |
| | | } catch (SftpException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return R.ok(excelUrl + name); |
| | | } |
| | | |
| | | @ApiOperation(value = "下载隐患报告") |
| | | @PostMapping("/export/DangerReport") |
| | | public R exportDangerReport(@RequestBody List<Long> ids) { |
| | | Long communityId = this.getLoginUserInfo().getCommunityId(); |
| | | List<String> downLoadUrl = new ArrayList<>(); |
| | | try { |
| | | for (Long id : ids) { |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | Map<String, Object> dataMap = new HashMap<String, Object>(); |
| | | ComSwDangerReportVO comSwDangerReportVO = |
| | | JSONObject.parseObject(JSONObject.toJSONString(communityService.detailDangerReport(id).getData()), |
| | | ComSwDangerReportVO.class); |
| | | // 生成动态模板excel通过ftp工具上传到主节点,然后返回模板下载地址 |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | String name = "隐患报告_" + comSwDangerReportVO.getId() + ".doc"; |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | String property = System.getProperty("user.dir"); |
| | | String sourceFile =property+File.separator+"word"+File.separator+System.currentTimeMillis()+File.separator; |
| | | String zipFile=property+File.separator+"zip"+File.separator; |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | for (Long id : ids) { |
| | | try { |
| | | Map<String, Object> dataMap = new HashMap<String, Object>(); |
| | | ComSwDangerReportVO comSwDangerReportVO = |
| | | JSONObject.parseObject(JSONObject.toJSONString(communityService.detailDangerReport(id).getData()), |
| | | ComSwDangerReportVO.class); |
| | | // 生成动态模板excel通过ftp工具上传到主节点,然后返回模板下载地址 |
| | | String name = "隐患报告_" + comSwDangerReportVO.getId() + ".doc"; |
| | | |
| | | 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 { |
| | | // 日期 |
| | | boolean existDir = sftp.isExistDir(ftpUrl + name); |
| | | if (!existDir) { |
| | | // 这里 需要指定写用哪个class去写 |
| | | ExcelWriter excelWriter = null; |
| | | InputStream inputStream = null; |
| | | File file0=new File("d:/dangerReport/file"); |
| | | if(!file0.isDirectory()&&!file0.exists()){ |
| | | file0.mkdirs(); |
| | | } |
| | | file0 = new File(sourceFile); |
| | | if(!file0.isDirectory()&&!file0.exists()){ |
| | | file0.mkdirs(); |
| | | } |
| | | sftp.download("/mnt/data/web/", "隐患报告.ftl", "d:/dangerReport/file/隐患报告.ftl"); |
| | | sftp.download("/mnt/data/web/", "blank.jpg", "d:/dangerReport/file/blank.jpg"); |
| | | try { |
| | | // 日期 |
| | | if (StringUtils.isNotEmpty(comSwDangerReportVO.getCheckTime())) { |
| | | dataMap.put("date", comSwDangerReportVO.getCheckTime()); |
| | | // 巡查类型 |
| | | } else { |
| | | dataMap.put("date", ""); |
| | | } |
| | | // 巡查类型 |
| | | if (StringUtils.isNotEmpty(comSwDangerReportVO.getPatrolType())) { |
| | | dataMap.put("patrolType", comSwDangerReportVO.getPatrolType()); |
| | | // 地址 |
| | | }else { |
| | | dataMap.put("patrolType", ""); |
| | | } |
| | | // 地址 |
| | | if (StringUtils.isNotEmpty(comSwDangerReportVO.getAddress())) { |
| | | dataMap.put("address", comSwDangerReportVO.getAddress()); |
| | | // 隐患名称 |
| | | }else { |
| | | dataMap.put("address", ""); |
| | | } |
| | | // 隐患名称 |
| | | if (StringUtils.isNotEmpty(comSwDangerReportVO.getDangerName())) { |
| | | dataMap.put("dangerName", comSwDangerReportVO.getDangerName()); |
| | | // 排查时间 |
| | | }else { |
| | | dataMap.put("dangerName", ""); |
| | | } |
| | | // 排查时间 |
| | | if (StringUtils.isNotEmpty(comSwDangerReportVO.getCheckTime())) { |
| | | dataMap.put("checkTime", comSwDangerReportVO.getCheckTime()); |
| | | // 排查人员 |
| | | }else { |
| | | dataMap.put("checkTime", ""); |
| | | } |
| | | // 排查人员 |
| | | if (StringUtils.isNotEmpty(comSwDangerReportVO.getPPersonName())) { |
| | | dataMap.put("ppersonName", comSwDangerReportVO.getPPersonName()); |
| | | // 填报人员 |
| | | }else { |
| | | dataMap.put("ppersonName", ""); |
| | | } |
| | | // 填报人员 |
| | | if (StringUtils.isNotEmpty(comSwDangerReportVO.getCreateName())) { |
| | | dataMap.put("createName", comSwDangerReportVO.getCreateName()); |
| | | // 填报时间 |
| | | dataMap.put("createAt", |
| | | new SimpleDateFormat("yyyy-MM-dd").format(comSwDangerReportVO.getCreateAt())); |
| | | // 隐患编号 |
| | | dataMap.put("dangerNo", comSwDangerReportVO.getDangerNo()); |
| | | // 主体部门、单位或个人全称 |
| | | if (StringUtils.isNotEmpty(comSwDangerReportVO.getUnitName())) { |
| | | dataMap.put("unitName", comSwDangerReportVO.getUnitName()); |
| | | } else { |
| | | dataMap.put("unitName", ""); |
| | | } |
| | | // 隐患简述 |
| | | if (StringUtils.isNotEmpty(comSwDangerReportVO.getDagerDescription())) { |
| | | dataMap.put("dagerDescription", comSwDangerReportVO.getDagerDescription()); |
| | | } else { |
| | | dataMap.put("dagerDescription", ""); |
| | | } |
| | | // 已采取的措施 |
| | | if (StringUtils.isNotEmpty(comSwDangerReportVO.getTakeSteps())) { |
| | | dataMap.put("takeSteps", comSwDangerReportVO.getTakeSteps()); |
| | | } else { |
| | | dataMap.put("takeSteps", ""); |
| | | } |
| | | // 措施照片 |
| | | List<String> stepsPhoto = new ArrayList<>(); |
| | | if (StringUtils.isNotEmpty(comSwDangerReportVO.getStepsPhoto())) { |
| | | stepsPhoto = Arrays.asList(comSwDangerReportVO.getStepsPhoto().split(",")); |
| | | } |
| | | if (stepsPhoto.size() != 0 && null != stepsPhoto) { |
| | | if (stepsPhoto.size() == 1) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 1) { |
| | | downloadPicture(stepsPhoto.get(i), comSwDangerReportVO.getId() + "_steps_" + i); |
| | | dataMap.put("imgStr" + (i + 1), |
| | | getImageStr("d:/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/blank.jpg")); |
| | | } |
| | | } |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 1) { |
| | | dataMap.put("imgStr" + (i + 19), |
| | | getImageStr("d:/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 19), getImageStr("d:/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (stepsPhoto.size() == 2) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 2) { |
| | | downloadPicture(stepsPhoto.get(i), comSwDangerReportVO.getId() + "_steps_" + i); |
| | | dataMap.put("imgStr" + (i + 1), |
| | | getImageStr("d:/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/blank.jpg")); |
| | | } |
| | | } |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 2) { |
| | | dataMap.put("imgStr" + (i + 19), |
| | | getImageStr("d:/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 19), getImageStr("d:/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (stepsPhoto.size() == 3) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 3) { |
| | | downloadPicture(stepsPhoto.get(i), comSwDangerReportVO.getId() + "_" + i); |
| | | dataMap.put("imgStr" + (i + 1), |
| | | getImageStr("d:/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/blank.jpg")); |
| | | } |
| | | } |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 3) { |
| | | dataMap.put("imgStr" + (i + 19), |
| | | getImageStr("d:/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 19), getImageStr("d:/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (stepsPhoto.size() == 4) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 4) { |
| | | downloadPicture(stepsPhoto.get(i), comSwDangerReportVO.getId() + "_steps_" + i); |
| | | dataMap.put("imgStr" + (i + 1), |
| | | getImageStr("d:/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/blank.jpg")); |
| | | } |
| | | } |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 4) { |
| | | dataMap.put("imgStr" + (i + 19), |
| | | getImageStr("d:/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 19), getImageStr("d:/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (stepsPhoto.size() == 5) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 5) { |
| | | downloadPicture(stepsPhoto.get(i), comSwDangerReportVO.getId() + "_steps_" + i); |
| | | dataMap.put("imgStr" + (i + 1), |
| | | getImageStr("d:/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/blank.jpg")); |
| | | } |
| | | } |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 5) { |
| | | dataMap.put("imgStr" + (i + 19), |
| | | getImageStr("d:/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 19), getImageStr("d:/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (stepsPhoto.size() == 6) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 6) { |
| | | downloadPicture(stepsPhoto.get(i), comSwDangerReportVO.getId() + "_steps_" + i); |
| | | dataMap.put("imgStr" + (i + 1), |
| | | getImageStr("d:/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/blank.jpg")); |
| | | } |
| | | } |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 6) { |
| | | dataMap.put("imgStr" + (i + 19), |
| | | getImageStr("d:/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 19), getImageStr("d:/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (stepsPhoto.size() == 7) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 7) { |
| | | downloadPicture(stepsPhoto.get(i), comSwDangerReportVO.getId() + "_steps_" + i); |
| | | dataMap.put("imgStr" + (i + 1), |
| | | getImageStr("d:/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/blank.jpg")); |
| | | } |
| | | } |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 7) { |
| | | dataMap.put("imgStr" + (i + 19), |
| | | getImageStr("d:/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 19), getImageStr("d:/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (stepsPhoto.size() == 8) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 8) { |
| | | downloadPicture(stepsPhoto.get(i), comSwDangerReportVO.getId() + "_steps_" + i); |
| | | dataMap.put("imgStr" + (i + 1), |
| | | getImageStr("d:/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/blank.jpg")); |
| | | } |
| | | } |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 8) { |
| | | dataMap.put("imgStr" + (i + 19), |
| | | getImageStr("d:/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 19), getImageStr("d:/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (stepsPhoto.size() == 9) { |
| | | for (int i = 0; i < 9; i++) { |
| | | downloadPicture(stepsPhoto.get(i), comSwDangerReportVO.getId() + "_steps_" + i); |
| | | dataMap.put("imgStr" + (i + 19), |
| | | getImageStr("d:/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); |
| | | } |
| | | for (int i = 0; i < 9; i++) { |
| | | downloadPicture(stepsPhoto.get(i), comSwDangerReportVO.getId() + "_steps_" + i); |
| | | }else { |
| | | dataMap.put("createName", ""); |
| | | } |
| | | // 填报时间 |
| | | dataMap.put("createAt", |
| | | new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(comSwDangerReportVO.getCreateAt())); |
| | | // 隐患编号 |
| | | dataMap.put("dangerNo", comSwDangerReportVO.getDangerNo()); |
| | | // 主体部门、单位或个人全称 |
| | | if (StringUtils.isNotEmpty(comSwDangerReportVO.getUnitName())) { |
| | | dataMap.put("unitName", comSwDangerReportVO.getUnitName()); |
| | | } else { |
| | | dataMap.put("unitName", ""); |
| | | } |
| | | // 隐患简述 |
| | | if (StringUtils.isNotEmpty(comSwDangerReportVO.getDagerDescription())) { |
| | | dataMap.put("dagerDescription", comSwDangerReportVO.getDagerDescription()); |
| | | } else { |
| | | dataMap.put("dagerDescription", ""); |
| | | } |
| | | // 已采取的措施 |
| | | if (StringUtils.isNotEmpty(comSwDangerReportVO.getTakeSteps())) { |
| | | dataMap.put("takeSteps", comSwDangerReportVO.getTakeSteps()); |
| | | } else { |
| | | dataMap.put("takeSteps", ""); |
| | | } |
| | | // 措施照片 |
| | | List<String> stepsPhoto = new ArrayList<>(); |
| | | if (StringUtils.isNotEmpty(comSwDangerReportVO.getStepsPhoto())) { |
| | | stepsPhoto = Arrays.asList(comSwDangerReportVO.getStepsPhoto().split(",")); |
| | | } |
| | | if (stepsPhoto.size() != 0 && null != stepsPhoto) { |
| | | if (stepsPhoto.size() == 1) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 1) { |
| | | downloadPicture(stepsPhoto.get(i), comSwDangerReportVO.getId() + "_steps_" + i, "d:/dangerReport/file/"); |
| | | dataMap.put("imgStr" + (i + 1), |
| | | getImageStr("d:/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); |
| | | getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/blank.jpg")); |
| | | } |
| | | } |
| | | } else { |
| | | for (int i = 0; i < 9; i++) { |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/blank.jpg")); |
| | | } |
| | | for (int i = 0; i < 9; i++) { |
| | | dataMap.put("imgStr" + (i + 19), getImageStr("d:/blank.jpg")); |
| | | if (i < 1) { |
| | | dataMap.put("imgStr" + (i + 19), |
| | | getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | // 社区处理建议 |
| | | if (StringUtils.isNotEmpty(comSwDangerReportVO.getCommunitySuggestion())) { |
| | | dataMap.put("communitySuggestion", comSwDangerReportVO.getCommunitySuggestion()); |
| | | } else { |
| | | dataMap.put("communitySuggestion", ""); |
| | | } |
| | | // 街道安全管理人员建议 |
| | | if (StringUtils.isNotEmpty(comSwDangerReportVO.getStreetSuggestion())) { |
| | | dataMap.put("streetSuggestion", comSwDangerReportVO.getStreetSuggestion()); |
| | | } else { |
| | | dataMap.put("streetSuggestion", ""); |
| | | } |
| | | // 领导意见 |
| | | if (StringUtils.isNotEmpty(comSwDangerReportVO.getLeaderSuggestion())) { |
| | | dataMap.put("leaderSuggestion", comSwDangerReportVO.getLeaderSuggestion()); |
| | | } else { |
| | | dataMap.put("leaderSuggestion", ""); |
| | | } |
| | | // 承办记录 |
| | | if (StringUtils.isNotEmpty(comSwDangerReportVO.getUndertakeRecord())) { |
| | | dataMap.put("undertakeRecord", comSwDangerReportVO.getUndertakeRecord()); |
| | | } else { |
| | | dataMap.put("undertakeRecord", ""); |
| | | } |
| | | // 巡查记录 |
| | | if (StringUtils.isNotEmpty(comSwDangerReportVO.getRecordContent())) { |
| | | dataMap.put("recordContent", comSwDangerReportVO.getRecordContent()); |
| | | } else { |
| | | dataMap.put("recordContent", ""); |
| | | } |
| | | // 发现记录 |
| | | if (StringUtils.isNotEmpty(comSwDangerReportVO.getFindRecord())) { |
| | | dataMap.put("findRecord", comSwDangerReportVO.getFindRecord()); |
| | | } else { |
| | | dataMap.put("findRecord", ""); |
| | | } |
| | | // 记录照片 |
| | | List<String> photo = new ArrayList<>(); |
| | | if (StringUtils.isNotEmpty(comSwDangerReportVO.getRecordPhoto())) { |
| | | photo = Arrays.asList(comSwDangerReportVO.getRecordPhoto().split(",")); |
| | | } |
| | | if (photo.size() != 0 && null != photo) { |
| | | if (photo.size() == 1) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 1) { |
| | | downloadPicture(photo.get(i), comSwDangerReportVO.getId() + "_find_" + i); |
| | | dataMap.put("imgStr" + (i + 10), |
| | | getImageStr("d:/" + comSwDangerReportVO.getId() + "_find_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 10), getImageStr("d:/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (photo.size() == 2) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 2) { |
| | | downloadPicture(photo.get(i), comSwDangerReportVO.getId() + "_find_" + i); |
| | | dataMap.put("imgStr" + (i + 10), |
| | | getImageStr("d:/" + comSwDangerReportVO.getId() + "_find_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 10), getImageStr("d:/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (photo.size() == 3) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 3) { |
| | | downloadPicture(photo.get(i), comSwDangerReportVO.getId() + "_find_" + i); |
| | | dataMap.put("imgStr" + (i + 10), |
| | | getImageStr("d:/" + comSwDangerReportVO.getId() + "_find_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 10), getImageStr("d:/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (photo.size() == 4) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 4) { |
| | | downloadPicture(photo.get(i), comSwDangerReportVO.getId() + "_find_" + i); |
| | | dataMap.put("imgStr" + (i + 10), |
| | | getImageStr("d:/" + comSwDangerReportVO.getId() + "_find_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 10), getImageStr("d:/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (photo.size() == 5) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 5) { |
| | | downloadPicture(photo.get(i), comSwDangerReportVO.getId() + "_find_" + i); |
| | | dataMap.put("imgStr" + (i + 10), |
| | | getImageStr("d:/" + comSwDangerReportVO.getId() + "_find_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 10), getImageStr("d:/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (photo.size() == 6) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 6) { |
| | | downloadPicture(photo.get(i), comSwDangerReportVO.getId() + "_find_" + i); |
| | | dataMap.put("imgStr" + (i + 10), |
| | | getImageStr("d:/" + comSwDangerReportVO.getId() + "_find_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 10), getImageStr("d:/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (photo.size() == 7) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 7) { |
| | | downloadPicture(photo.get(i), comSwDangerReportVO.getId() + "_find_" + i); |
| | | dataMap.put("imgStr" + (i + 10), |
| | | getImageStr("d:/" + comSwDangerReportVO.getId() + "_find_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 10), getImageStr("d:/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (photo.size() == 8) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 8) { |
| | | downloadPicture(photo.get(i), comSwDangerReportVO.getId() + "_find_" + i); |
| | | dataMap.put("imgStr" + (i + 10), |
| | | getImageStr("d:/" + comSwDangerReportVO.getId() + "_find_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 10), getImageStr("d:/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (photo.size() == 9) { |
| | | for (int i = 0; i < 9; i++) { |
| | | downloadPicture(photo.get(i), comSwDangerReportVO.getId() + "_find_" + i); |
| | | dataMap.put("imgStr" + (i + 10), |
| | | getImageStr("d:/" + comSwDangerReportVO.getId() + "_find_" + i + ".jpg")); |
| | | } |
| | | } |
| | | } else { |
| | | if (stepsPhoto.size() == 2) { |
| | | for (int i = 0; i < 9; i++) { |
| | | dataMap.put("imgStr" + (i + 10), getImageStr("d:/blank.jpg")); |
| | | if (i < 2) { |
| | | downloadPicture(stepsPhoto.get(i), comSwDangerReportVO.getId() + "_steps_" + i, "d:/dangerReport/file/"); |
| | | dataMap.put("imgStr" + (i + 1), |
| | | getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/blank.jpg")); |
| | | } |
| | | } |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 2) { |
| | | dataMap.put("imgStr" + (i + 19), |
| | | getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | // 备注 |
| | | if (StringUtils.isNotEmpty(comSwDangerReportVO.getRemark())) { |
| | | dataMap.put("remark", comSwDangerReportVO.getRemark()); |
| | | } else { |
| | | dataMap.put("remark", ""); |
| | | if (stepsPhoto.size() == 3) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 3) { |
| | | downloadPicture(stepsPhoto.get(i), comSwDangerReportVO.getId() + "_steps_" + i, "d:/dangerReport/file/"); |
| | | dataMap.put("imgStr" + (i + 1), |
| | | getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/blank.jpg")); |
| | | } |
| | | } |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 3) { |
| | | dataMap.put("imgStr" + (i + 19), |
| | | getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | // 整改时间 |
| | | if (StringUtils.isNotEmpty(comSwDangerReportVO.getRectifyTime())) { |
| | | dataMap.put("rectifyTime", comSwDangerReportVO.getRectifyTime()); |
| | | } else { |
| | | dataMap.put("rectifyTime", ""); |
| | | if (stepsPhoto.size() == 4) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 4) { |
| | | downloadPicture(stepsPhoto.get(i), comSwDangerReportVO.getId() + "_steps_" + i, "d:/dangerReport/file/"); |
| | | dataMap.put("imgStr" + (i + 1), |
| | | getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/blank.jpg")); |
| | | } |
| | | } |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 4) { |
| | | dataMap.put("imgStr" + (i + 19), |
| | | getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | // 整改人员 |
| | | if (StringUtils.isNotEmpty(comSwDangerReportVO.getDPersonName())) { |
| | | dataMap.put("dpersonName", comSwDangerReportVO.getDPersonName()); |
| | | } else { |
| | | dataMap.put("dpersonName", ""); |
| | | if (stepsPhoto.size() == 5) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 5) { |
| | | downloadPicture(stepsPhoto.get(i), comSwDangerReportVO.getId() + "_steps_" + i, "d:/dangerReport/file/"); |
| | | dataMap.put("imgStr" + (i + 1), |
| | | getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/blank.jpg")); |
| | | } |
| | | } |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 5) { |
| | | dataMap.put("imgStr" + (i + 19), |
| | | getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 获取请求url |
| | | String url = Constants.G_D_WEATHER_URL; |
| | | // 获取请求参数 |
| | | String param = "key=" + Constants.G_D_WEATHER_KEY + "&city=510400"; |
| | | String result = HttpUtils.sendGet(url, param); |
| | | R r = R.ok(JSON.parseObject(result)); |
| | | WeatherVO weatherVO = |
| | | JSONObject.parseObject(JSONObject.toJSONString(r.getData()), WeatherVO.class); |
| | | if (null != weatherVO) { |
| | | LiveVO liveVO = weatherVO.getLives().get(0); |
| | | // 城市 |
| | | dataMap.put("city", liveVO.getCity()); |
| | | // 天气 |
| | | dataMap.put("weather", liveVO.getWeather()); |
| | | // 温度 |
| | | dataMap.put("temperature", liveVO.getTemperature()); |
| | | // 风向 |
| | | dataMap.put("winddirection", liveVO.getWinddirection()); |
| | | // 风力 |
| | | dataMap.put("windpower", liveVO.getWindpower()); |
| | | if (stepsPhoto.size() == 6) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 6) { |
| | | downloadPicture(stepsPhoto.get(i), comSwDangerReportVO.getId() + "_steps_" + i, "d:/dangerReport/file/"); |
| | | dataMap.put("imgStr" + (i + 1), |
| | | getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/blank.jpg")); |
| | | } |
| | | } |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 6) { |
| | | dataMap.put("imgStr" + (i + 19), |
| | | getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | Configuration configuration = new Configuration(new Version("2.3.0")); |
| | | |
| | | configuration.setDefaultEncoding("utf-8"); |
| | | /** |
| | | * 以下是两种指定ftl文件所在目录路径的方式,注意这两种方式都是 指定ftl文件所在目录的路径,而不是ftl文件的路径 |
| | | */ |
| | | // 指定路径的第一种方式(根据某个类的相对路径指定) |
| | | // configuration.setClassForTemplateLoading(this.getClass(), ""); |
| | | |
| | | // 指定路径的第二种方式,我的路径是C:/a.ftl |
| | | configuration.setDirectoryForTemplateLoading(new File("c:/")); |
| | | |
| | | // 输出文档路径及名称 |
| | | // File outFile = new File("mnt/data/web/excel/安全工作记录_" + comSwSafetyWorkRecordVO.getId() + |
| | | // ".doc"); |
| | | File file = new File(fileName); |
| | | |
| | | // 以utf-8的编码读取ftl文件 |
| | | Template template = configuration.getTemplate("隐患报告.ftl", "utf-8"); |
| | | Writer out = new BufferedWriter( |
| | | new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8), 10240); |
| | | template.process(dataMap, out); |
| | | out.close(); |
| | | 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 (stepsPhoto.size() == 7) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 7) { |
| | | downloadPicture(stepsPhoto.get(i), comSwDangerReportVO.getId() + "_steps_" + i, "d:/dangerReport/file/"); |
| | | dataMap.put("imgStr" + (i + 1), |
| | | getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/blank.jpg")); |
| | | } |
| | | } |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 7) { |
| | | dataMap.put("imgStr" + (i + 19), |
| | | getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (stepsPhoto.size() == 8) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 8) { |
| | | downloadPicture(stepsPhoto.get(i), comSwDangerReportVO.getId() + "_steps_" + i, "d:/dangerReport/file/"); |
| | | dataMap.put("imgStr" + (i + 1), |
| | | getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/blank.jpg")); |
| | | } |
| | | } |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 8) { |
| | | dataMap.put("imgStr" + (i + 19), |
| | | getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (stepsPhoto.size() == 9) { |
| | | for (int i = 0; i < 9; i++) { |
| | | downloadPicture(stepsPhoto.get(i), comSwDangerReportVO.getId() + "_steps_" + i, "d:/dangerReport/file/"); |
| | | dataMap.put("imgStr" + (i + 19), |
| | | getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); |
| | | } |
| | | for (int i = 0; i < 9; i++) { |
| | | downloadPicture(stepsPhoto.get(i), comSwDangerReportVO.getId() + "_steps_" + i, "d:/dangerReport/file/"); |
| | | dataMap.put("imgStr" + (i + 1), |
| | | getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); |
| | | } |
| | | } |
| | | } else { |
| | | for (int i = 0; i < 9; i++) { |
| | | dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/blank.jpg")); |
| | | } |
| | | for (int i = 0; i < 9; i++) { |
| | | dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/blank.jpg")); |
| | | } |
| | | } |
| | | // 社区处理建议 |
| | | if (StringUtils.isNotEmpty(comSwDangerReportVO.getCommunitySuggestion())) { |
| | | dataMap.put("communitySuggestion", comSwDangerReportVO.getCommunitySuggestion()); |
| | | } else { |
| | | dataMap.put("communitySuggestion", ""); |
| | | } |
| | | // 街道安全管理人员建议 |
| | | if (StringUtils.isNotEmpty(comSwDangerReportVO.getStreetSuggestion())) { |
| | | dataMap.put("streetSuggestion", comSwDangerReportVO.getStreetSuggestion()); |
| | | } else { |
| | | dataMap.put("streetSuggestion", ""); |
| | | } |
| | | // 领导意见 |
| | | if (StringUtils.isNotEmpty(comSwDangerReportVO.getLeaderSuggestion())) { |
| | | dataMap.put("leaderSuggestion", comSwDangerReportVO.getLeaderSuggestion()); |
| | | } else { |
| | | dataMap.put("leaderSuggestion", ""); |
| | | } |
| | | // 承办记录 |
| | | if (StringUtils.isNotEmpty(comSwDangerReportVO.getUndertakeRecord())) { |
| | | dataMap.put("undertakeRecord", comSwDangerReportVO.getUndertakeRecord()); |
| | | } else { |
| | | dataMap.put("undertakeRecord", ""); |
| | | } |
| | | // 巡查记录 |
| | | if (StringUtils.isNotEmpty(comSwDangerReportVO.getRecordContent())) { |
| | | dataMap.put("recordContent", comSwDangerReportVO.getRecordContent()); |
| | | } else { |
| | | dataMap.put("recordContent", ""); |
| | | } |
| | | // 发现记录 |
| | | if (StringUtils.isNotEmpty(comSwDangerReportVO.getFindRecord())) { |
| | | dataMap.put("findRecord", comSwDangerReportVO.getFindRecord()); |
| | | } else { |
| | | dataMap.put("findRecord", ""); |
| | | } |
| | | // 记录照片 |
| | | List<String> photo = new ArrayList<>(); |
| | | if (StringUtils.isNotEmpty(comSwDangerReportVO.getRecordPhoto())) { |
| | | photo = Arrays.asList(comSwDangerReportVO.getRecordPhoto().split(",")); |
| | | } |
| | | if (photo.size() != 0 && null != photo) { |
| | | if (photo.size() == 1) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 1) { |
| | | downloadPicture(photo.get(i), comSwDangerReportVO.getId() + "_find_" + i, "d:/dangerReport/file/"); |
| | | dataMap.put("imgStr" + (i + 10), |
| | | getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_find_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (photo.size() == 2) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 2) { |
| | | downloadPicture(photo.get(i), comSwDangerReportVO.getId() + "_find_" + i, "d:/dangerReport/file/"); |
| | | dataMap.put("imgStr" + (i + 10), |
| | | getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_find_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (photo.size() == 3) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 3) { |
| | | downloadPicture(photo.get(i), comSwDangerReportVO.getId() + "_find_" + i, "d:/dangerReport/file/"); |
| | | dataMap.put("imgStr" + (i + 10), |
| | | getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_find_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (photo.size() == 4) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 4) { |
| | | downloadPicture(photo.get(i), comSwDangerReportVO.getId() + "_find_" + i, "d:/dangerReport/file/"); |
| | | dataMap.put("imgStr" + (i + 10), |
| | | getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_find_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (photo.size() == 5) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 5) { |
| | | downloadPicture(photo.get(i), comSwDangerReportVO.getId() + "_find_" + i, "d:/dangerReport/file/"); |
| | | dataMap.put("imgStr" + (i + 10), |
| | | getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_find_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (photo.size() == 6) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 6) { |
| | | downloadPicture(photo.get(i), comSwDangerReportVO.getId() + "_find_" + i, "d:/dangerReport/file/"); |
| | | dataMap.put("imgStr" + (i + 10), |
| | | getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_find_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (photo.size() == 7) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 7) { |
| | | downloadPicture(photo.get(i), comSwDangerReportVO.getId() + "_find_" + i, "d:/dangerReport/file/"); |
| | | dataMap.put("imgStr" + (i + 10), |
| | | getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_find_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (photo.size() == 8) { |
| | | for (int i = 0; i < 9; i++) { |
| | | if (i < 8) { |
| | | downloadPicture(photo.get(i), comSwDangerReportVO.getId() + "_find_" + i, "d:/dangerReport/file/"); |
| | | dataMap.put("imgStr" + (i + 10), |
| | | getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_find_" + i + ".jpg")); |
| | | } else { |
| | | dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/blank.jpg")); |
| | | } |
| | | } |
| | | } |
| | | if (photo.size() == 9) { |
| | | for (int i = 0; i < 9; i++) { |
| | | downloadPicture(photo.get(i), comSwDangerReportVO.getId() + "_find_" + i, "d:/dangerReport/file/"); |
| | | dataMap.put("imgStr" + (i + 10), |
| | | getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_find_" + i + ".jpg")); |
| | | } |
| | | } |
| | | } else { |
| | | for (int i = 0; i < 9; i++) { |
| | | dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/blank.jpg")); |
| | | } |
| | | } |
| | | // 备注 |
| | | if (StringUtils.isNotEmpty(comSwDangerReportVO.getRemark())) { |
| | | dataMap.put("remark", comSwDangerReportVO.getRemark()); |
| | | } else { |
| | | dataMap.put("remark", ""); |
| | | } |
| | | // 整改时间 |
| | | if (StringUtils.isNotEmpty(comSwDangerReportVO.getRectifyTime())) { |
| | | dataMap.put("rectifyTime", comSwDangerReportVO.getRectifyTime()); |
| | | } else { |
| | | dataMap.put("rectifyTime", ""); |
| | | } |
| | | // 整改人员 |
| | | if (StringUtils.isNotEmpty(comSwDangerReportVO.getDPersonName())) { |
| | | dataMap.put("dpersonName", comSwDangerReportVO.getDPersonName()); |
| | | } else { |
| | | dataMap.put("dpersonName", ""); |
| | | } |
| | | |
| | | // 获取请求url |
| | | String url = Constants.G_D_WEATHER_URL; |
| | | // 获取请求参数 |
| | | String param = "key=" + Constants.G_D_WEATHER_KEY + "&city=510400"; |
| | | String result = HttpUtils.sendGet(url, param); |
| | | R r = R.ok(JSON.parseObject(result)); |
| | | WeatherVO weatherVO = |
| | | JSONObject.parseObject(JSONObject.toJSONString(r.getData()), WeatherVO.class); |
| | | if (null != weatherVO) { |
| | | LiveVO liveVO = weatherVO.getLives().get(0); |
| | | // 城市 |
| | | dataMap.put("city", liveVO.getCity()); |
| | | // 天气 |
| | | dataMap.put("weather", liveVO.getWeather()); |
| | | // 温度 |
| | | dataMap.put("temperature", liveVO.getTemperature()); |
| | | // 风向 |
| | | dataMap.put("winddirection", liveVO.getWinddirection()); |
| | | // 风力 |
| | | dataMap.put("windpower", liveVO.getWindpower()); |
| | | } |
| | | Configuration configuration = new Configuration(new Version("2.3.0")); |
| | | |
| | | configuration.setDefaultEncoding("utf-8"); |
| | | /** |
| | | * 以下是两种指定ftl文件所在目录路径的方式,注意这两种方式都是 指定ftl文件所在目录的路径,而不是ftl文件的路径 |
| | | */ |
| | | // 指定路径的第一种方式(根据某个类的相对路径指定) |
| | | // configuration.setClassForTemplateLoading(this.getClass(), ""); |
| | | |
| | | // 指定路径的第二种方式,我的路径是C:/a.ftl |
| | | configuration.setDirectoryForTemplateLoading(new File("d:/dangerReport/file/")); |
| | | |
| | | // 输出文档路径及名称 |
| | | // File outFile = new File("mnt/data/web/excel/安全工作记录_" + comSwSafetyWorkRecordVO.getId() + |
| | | // ".doc"); |
| | | File file = new File(sourceFile+name); |
| | | |
| | | // 以utf-8的编码读取ftl文件 |
| | | Template template = configuration.getTemplate("隐患报告.ftl", "utf-8"); |
| | | Writer out = new BufferedWriter( |
| | | new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8), 10240); |
| | | template.process(dataMap, out); |
| | | out.close(); |
| | | // 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(); |
| | | } |
| | | } |
| | | downLoadUrl.add(excelUrl + name); |
| | | } |
| | | return R.ok(downLoadUrl); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | } |
| | | } |
| | | return R.fail(); |
| | | FileUtil.compressToZip(sourceFile,zipFile,"隐患报告.zip"); |
| | | String currentDateString = String.valueOf(System.currentTimeMillis()); |
| | | String name = "隐患报告_"+ currentDateString+".zip"; |
| | | try { |
| | | InputStream inputStream=new FileInputStream(zipFile+"隐患报告.zip"); |
| | | sftp.uploadMore(ftpUrl, name , inputStream); |
| | | sftp.logout(); |
| | | inputStream.close(); |
| | | FileUtils.deleteDirectory(new File(property+File.separator+"word"+File.separator)); |
| | | FileUtils.deleteDirectory(new File(zipFile)); |
| | | } catch (FileNotFoundException e) { |
| | | e.printStackTrace(); |
| | | } catch (SftpException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return R.ok(excelUrl + name); |
| | | } |
| | | |
| | | private List<List<String>> headDataFilling() { |
| | |
| | | return encoder.encode(data); |
| | | } |
| | | |
| | | public String downloadPicture(String urlString, String fileName) throws Exception { |
| | | public String downloadPicture(String urlString, String fileName,String dir) throws Exception { |
| | | // 构造URL |
| | | URL url = new URL(urlString); |
| | | // 打开连接 |
| | |
| | | // 读取到的数据长度 |
| | | int len; |
| | | // 输出的文件流 |
| | | String filename = "d:/" + fileName + ".jpg"; // 下载路径及下载图片名称 |
| | | String filename = dir + fileName + ".jpg"; // 下载路径及下载图片名称 |
| | | File file = new File(filename); |
| | | FileOutputStream os = new FileOutputStream(file, true); |
| | | // 开始读取 |
| | |
| | | package com.panzhihua.community_backstage.api; |
| | | |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.InputStream; |
| | | import java.io.*; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | |
| | | import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.panzhihua.common.constants.Constants; |
| | | import com.panzhihua.common.model.vos.LiveVO; |
| | | import com.panzhihua.common.model.vos.WeatherVO; |
| | | import com.panzhihua.community_backstage.excel.CustomSheetWriteHandler; |
| | | import freemarker.template.Configuration; |
| | | import freemarker.template.Template; |
| | | import freemarker.template.Version; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import sun.misc.BASE64Encoder; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | |
| | | |
| | | @ApiOperation(value = "新增社区活动") |
| | | @PostMapping("activity") |
| | | public R addActivity(@RequestBody ComActActivityVO ComActActivityVO) { |
| | | public R addActivity(@RequestBody ComActActivityVO comActActivityVO) { |
| | | Long communityId = this.getCommunityId(); |
| | | ComActActivityVO.setCommunityId(communityId); |
| | | return communityService.addActivity(ComActActivityVO); |
| | | comActActivityVO.setCommunityId(communityId); |
| | | comActActivityVO.setUserId(this.getLoginUserInfo().getUserId()); |
| | | return communityService.addActivity(comActActivityVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "编辑社区活动") |
| | |
| | | return R.fail("活动id主键不能为空"); |
| | | } |
| | | return communityService.listActivitySign(activitySignVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "excel导出-活动报名名单") |
| | | @PostMapping("sign/export") |
| | | public R activityExportSign(@RequestBody ActivitySignVO activitySignVO) { |
| | | String name = "活动报名名单导出数据.xlsx"; |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | R r = communityService.getSignLists(activitySignVO); |
| | | if (R.isOk(r)) { |
| | | List<ComActActSignExcelVO> excelVOS = |
| | | JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ComActActSignExcelVO.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, ComActActSignExcelVO.class) |
| | | .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) |
| | | .registerWriteHandler(new CustomSheetWriteHandler()).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet("活动报名名单导出数据").build(); |
| | | excelWriter.write(excelVOS, 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(excelUrl + name); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | return R.fail("未查询到用户"); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询活动评价记录", response = ComActActEvaluateVO.class) |
| | | @PostMapping("evaluate/page") |
| | | public R pageActivityEvaluates(@RequestBody ComActActEvaluateVO comActActEvaluateVO) { |
| | | if (ObjectUtils.isEmpty(comActActEvaluateVO.getActivityId())) { |
| | | return R.fail("活动id主键不能为空"); |
| | | } |
| | | return communityService.pageActivityEvaluates(comActActEvaluateVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "excel导出-活动评价") |
| | | @PostMapping("evaluate/export") |
| | | public R activityExportEvaluate(@RequestBody ComActActEvaluateVO comActActEvaluateVO) { |
| | | String name = "活动评价导出数据.xlsx"; |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | R r = communityService.getEvaluateLists(comActActEvaluateVO); |
| | | if (R.isOk(r)) { |
| | | List<ComActActEvaluateExcelVO> excelVOS = |
| | | JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ComActActEvaluateExcelVO.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, ComActActEvaluateExcelVO.class) |
| | | .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) |
| | | .registerWriteHandler(new CustomSheetWriteHandler()).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet("活动评价导出数据").build(); |
| | | excelWriter.write(excelVOS, 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(excelUrl + name); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | return R.fail("未查询到用户"); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询活动签到记录", response = ComActActRegistVO.class) |
| | | @PostMapping("regist/page") |
| | | public R pageActivityRegists(@RequestBody ComActActRegistVO comActActRegistVO) { |
| | | if (ObjectUtils.isEmpty(comActActRegistVO.getActivityId())) { |
| | | return R.fail("活动id主键不能为空"); |
| | | } |
| | | return communityService.pageActivityRegists(comActActRegistVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "excel导出-活动签到") |
| | | @PostMapping("regist/export") |
| | | public R activityExportRegist(@RequestBody ComActActRegistVO comActActRegistVO) { |
| | | String name = "活动签到导出数据.xlsx"; |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | R r = communityService.getRegistLists(comActActRegistVO); |
| | | if (R.isOk(r)) { |
| | | List<ComActActRegistExcelVO> excelVOS = |
| | | JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ComActActRegistExcelVO.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, ComActActRegistExcelVO.class) |
| | | .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) |
| | | .registerWriteHandler(new CustomSheetWriteHandler()).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet("活动签到导出数据").build(); |
| | | excelWriter.write(excelVOS, 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(excelUrl + name); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | return R.fail("未查询到用户"); |
| | | } |
| | | |
| | | @ApiOperation(value = "社区活动数据统计", response = ComActActivityStatisticsVO.class) |
| | | @GetMapping("statistics") |
| | | public R activityStatistics(@RequestParam("activityId") Long activityId){ |
| | | return communityService.activityStatistics(activityId); |
| | | } |
| | | |
| | | @ApiOperation(value = "excel导出活动签到统计") |
| | | @GetMapping("statistics/export") |
| | | public R activityStatisticsExport(@RequestBody ComActActRegistVO comActActRegistVO){ |
| | | String name = "活动签到统计导出数据.xlsx"; |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | //活动签到人员 |
| | | R r = communityService.getRegistLists(comActActRegistVO); |
| | | //活动未签到人员 |
| | | R r1 = communityService.getNoRegistLists(comActActRegistVO); |
| | | if (R.isOk(r)) { |
| | | List<ComActActRegistExcelVO> excelVOS = |
| | | JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ComActActRegistExcelVO.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, ComActActRegistExcelVO.class) |
| | | .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) |
| | | .registerWriteHandler(new CustomSheetWriteHandler()).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet("活动签到导出数据").build(); |
| | | excelWriter.write(excelVOS, 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(excelUrl + name); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | return R.fail("未查询到用户"); |
| | | } |
| | | |
| | | @ApiOperation(value = "社区活动签到二维码下载") |
| | | @GetMapping("qrCode/export") |
| | | public R activityRegistQRCodeExport(@RequestParam("activityId") Long activityId){ |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | Map<String, Object> dataMap = new HashMap<String, Object>(); |
| | | // 生成动态模板excel通过ftp工具上传到主节点,然后返回模板下载地址 |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | String name = "社区活动签到二维码_" + activityId + ".doc"; |
| | | 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; |
| | | File file0=new File("d:/comActivity/file"); |
| | | if(!file0.isDirectory()&&!file0.exists()){ |
| | | file0.mkdirs(); |
| | | } |
| | | sftp.download("/mnt/data/web/", "社区活动二维码.ftl", "d:/comActivity/file/社区活动二维码.ftl"); |
| | | try { |
| | | String text = String.valueOf(activityId); |
| | | String destPath = "d:/comActivity/file/"; |
| | | String downFile = QRCodeUtils.encode(text, null, destPath, false); |
| | | dataMap.put("imgStr", getImageStr("d:/comActivity/file/" + downFile)); |
| | | Configuration configuration = new Configuration(new Version("2.3.0")); |
| | | |
| | | configuration.setDefaultEncoding("utf-8"); |
| | | /** |
| | | * 以下是两种指定ftl文件所在目录路径的方式,注意这两种方式都是 指定ftl文件所在目录的路径,而不是ftl文件的路径 |
| | | */ |
| | | // 指定路径的第一种方式(根据某个类的相对路径指定) |
| | | // configuration.setClassForTemplateLoading(this.getClass(), ""); |
| | | |
| | | // 指定路径的第二种方式,我的路径是C:/a.ftl |
| | | configuration.setDirectoryForTemplateLoading(new File("d:/comActivity/file/")); |
| | | |
| | | // 输出文档路径及名称 |
| | | // File outFile = new File("mnt/data/web/excel/安全工作记录_" + comSwSafetyWorkRecordVO.getId() + |
| | | // ".doc"); |
| | | File file = new File(fileName); |
| | | |
| | | // 以utf-8的编码读取ftl文件 |
| | | Template template = configuration.getTemplate("社区活动二维码.ftl", "utf-8"); |
| | | Writer out = new BufferedWriter( |
| | | new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8), 10240); |
| | | template.process(dataMap, out); |
| | | out.close(); |
| | | 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(); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(excelUrl + name); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "社区活动查询历史封面", response = ComActActPictureVO.class) |
| | | @GetMapping("picture/getList") |
| | | public R getPictureList() { |
| | | Long userId = this.getLoginUserInfo().getUserId(); |
| | | return communityService.getPictureList(userId); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询当前社区标签列表") |
| | | @GetMapping("userTags/getList") |
| | | public R getUserTagsList() { |
| | | Long communityId = this.getLoginUserInfo().getCommunityId(); |
| | | return userService.listTags(communityId); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增社区动态") |
| | |
| | | } |
| | | return communityService.easyPhotoNoHandleList(loginUserInfo.getCommunityId()); |
| | | } |
| | | |
| | | public String getImageStr(String fileName) { |
| | | String imgFile = fileName; |
| | | InputStream in = null; |
| | | byte[] data = null; |
| | | try { |
| | | in = new FileInputStream(imgFile); |
| | | data = new byte[in.available()]; |
| | | in.read(data); |
| | | in.close(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | BASE64Encoder encoder = new BASE64Encoder(); |
| | | return encoder.encode(data); |
| | | } |
| | | } |
| | |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | boolean existDir = sftp.isExistDir(ftpUrl + name); |
| | | boolean existDir = sftp.isExistDir(ftpUrl + _name); |
| | | if (!existDir) { |
| | | String property = System.getProperty("user.dir"); |
| | | String fileName = property + File.separator + name; |
| | | String fileName = property + File.separator + _name; |
| | | // 这里 需要指定写用哪个class去写 |
| | | ExcelWriter excelWriter = null; |
| | | InputStream inputStream = null; |
| | |
| | | excelWriter.finish(); |
| | | File file = new File(fileName); |
| | | inputStream = new FileInputStream(file); |
| | | sftp.uploadMore(ftpUrl, name, inputStream); |
| | | sftp.uploadMore(ftpUrl, _name, inputStream); |
| | | sftp.logout(); |
| | | inputStream.close(); |
| | | String absolutePath = file.getAbsolutePath(); |
| | |
| | | } |
| | | } |
| | | } |
| | | return R.ok(url + name); |
| | | return R.ok(url + _name); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
New file |
| | |
| | | package com.panzhihua.service_community.api; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.community.CancelRecordDTO; |
| | | import com.panzhihua.common.model.dtos.community.OperationDetailDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageUserReserveDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActReserveCommitVO; |
| | | import com.panzhihua.service_community.dao.ComActReserveOperationRecordMapper; |
| | | import com.panzhihua.service_community.model.dos.ComActReserveOperationRecordDO; |
| | | import com.panzhihua.service_community.model.dos.ComActReserveRecordDO; |
| | | import com.panzhihua.service_community.service.*; |
| | | import com.panzhihua.common.model.dtos.community.reserve.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 预约登记 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/reserve/") |
| | | public class ComActReserveApi { |
| | | |
| | | @Resource |
| | | private ComActReserveService comActReserveService; |
| | | @Resource |
| | | private ComActReserveRecordService comActReserveRecordService; |
| | | @Resource |
| | | private ComActReserveAnswerContentService comActReserveAnswerContentService; |
| | | @Resource |
| | | private ComActReserveOperationRecordService comActReserveOperationRecordService; |
| | | @Resource |
| | | private ComActReserveSubService comActReserveSubService; |
| | | |
| | | /** |
| | | * 社区后台-分页查询预约登记列表 |
| | | * @param pageReserveDTO 请求参数 |
| | | * @return 预约登记列表 |
| | | */ |
| | | @PostMapping("/admin/page") |
| | | public R pageReserveAdmin(@RequestBody PageReserveAdminDTO pageReserveDTO){ |
| | | return comActReserveService.pageReserveAdmin(pageReserveDTO); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台-新增预约登记信息 |
| | | * @param addReserveDTO 请求参数 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/admin/add") |
| | | public R addReserveAdmin(@RequestBody AddReserveAdminDTO addReserveDTO){ |
| | | return comActReserveService.addReserveAdmin(addReserveDTO); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台-编辑预约登记信息 |
| | | * @param editReserveDTO 请求参数 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/admin/edit") |
| | | public R editReserveAdmin(@RequestBody EditReserveAdminDTO editReserveDTO){ |
| | | return comActReserveService.editReserveAdmin(editReserveDTO); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台-修改预约登记状态 |
| | | * @param editReserveDTO 请求参数 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("/admin/edit/status") |
| | | public R editReserveStatusAdmin(@RequestBody EditComActReserveStatusDTO editReserveDTO){ |
| | | return comActReserveService.editReserveStatusAdmin(editReserveDTO); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台-继续预约登记 |
| | | * @param editReserveDTO 请求参数 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("/admin/edit/info") |
| | | public R editReserveInfoAdmin(@RequestBody EditComActReserveInfoDTO editReserveDTO){ |
| | | return comActReserveService.editReserveInfoAdmin(editReserveDTO); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台-根据预约登记id查询详情 |
| | | * @param reserveId 预约登记id |
| | | * @return 预约登记详情 |
| | | */ |
| | | @GetMapping("/admin/detail") |
| | | public R detailReserveAdmin(@RequestParam("reserveId") Long reserveId){ |
| | | return comActReserveService.detailReserveAdmin(reserveId); |
| | | } |
| | | |
| | | /** |
| | | * 预约登记详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/detail") |
| | | public R detail(@RequestParam("id") Long id,@RequestParam("userId") Long userId,@RequestParam("recordId") Long recordId,@RequestParam("isBack") Integer isBack){ |
| | | if(id!=null){ |
| | | return comActReserveService.getById(id,userId,recordId,isBack); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | |
| | | /** |
| | | * 小程序提交预约/登记 |
| | | * @param comActReserveCommitVO |
| | | * @return |
| | | */ |
| | | @PostMapping("/commit") |
| | | public R commit(@RequestBody ComActReserveCommitVO comActReserveCommitVO){ |
| | | return comActReserveService.commit(comActReserveCommitVO); |
| | | } |
| | | /** |
| | | * 社区后台-根据社区id统计预约类数据 |
| | | * @param makeStatisticsDTO 请求参数 |
| | | * @return 统计预约类数据 |
| | | */ |
| | | @PostMapping("/admin/make/statistics") |
| | | public R makeStatisticsAdmin(@RequestBody ComActReserveMakeStatisticsDTO makeStatisticsDTO){ |
| | | return comActReserveService.makeStatisticsAdmin(makeStatisticsDTO); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台-查询导出预约统计汇总数据 |
| | | * @param makeStatisticsDTO 请求参数 |
| | | * @return 统计预约类数据 |
| | | */ |
| | | @PostMapping("/admin/make/statistics/export") |
| | | public R makeStatisticsExportAdmin(@RequestBody ComActReserveMakeStatisticsDTO makeStatisticsDTO){ |
| | | return comActReserveService.makeStatisticsExportAdmin(makeStatisticsDTO); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台-根据预约id查询预约明细 |
| | | * @param pageMakeDTO 请求参数 |
| | | * @return 预约明细 |
| | | */ |
| | | @PostMapping("/admin/make/page") |
| | | public R pageMakeAdmin(@RequestBody PageReserveMakeAdminDTO pageMakeDTO){ |
| | | return comActReserveRecordService.pageMakeAdmin(pageMakeDTO); |
| | | } |
| | | |
| | | /** |
| | | * 根据预约记录id查询预约明细操作记录 |
| | | * @param reserveRecordId 预约记录id |
| | | * @return 预约明细操作记录 |
| | | */ |
| | | @GetMapping("/admin/make/detail") |
| | | public R detailMakeAdmin(@RequestParam("reserveRecordId") Long reserveRecordId){ |
| | | return comActReserveRecordService.detailMakeAdmin(reserveRecordId); |
| | | } |
| | | |
| | | /** |
| | | * 批量取消预约记录 |
| | | * @param reserveRecordDTO 请求参数 |
| | | * @return 取消结果 |
| | | */ |
| | | @PostMapping("/admin/make/cancel") |
| | | public R makeCancelAdmin(@RequestBody CancelReserveRecordDTO reserveRecordDTO){ |
| | | return comActReserveRecordService.makeCancelAdmin(reserveRecordDTO); |
| | | } |
| | | |
| | | /** |
| | | * 预约明细导出数据查询 |
| | | * @param pageMakeDTO 请求参数 |
| | | * @return 预约明细数据 |
| | | */ |
| | | @PostMapping("/admin/make/list/export") |
| | | public R exportMakeAdmin(@RequestBody PageReserveMakeAdminDTO pageMakeDTO){ |
| | | return comActReserveRecordService.exportMakeAdmin(pageMakeDTO); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询登记统计汇总 |
| | | * @param registerStatisticsDTO 请求参数 |
| | | * @return 登记统计汇总 |
| | | */ |
| | | @PostMapping("/admin/register/page") |
| | | public R registerStatisticsAdmin(@RequestBody ComActReserveRegisterStatisticsDTO registerStatisticsDTO){ |
| | | return comActReserveRecordService.registerStatisticsAdmin(registerStatisticsDTO); |
| | | } |
| | | |
| | | /** |
| | | * 导出登记统计汇总 |
| | | * @param registerStatisticsDTO 请求参数 |
| | | * @return 登记统计汇总 |
| | | */ |
| | | @PostMapping("/admin/register/export") |
| | | public R registerStatisticsExportAdmin(@RequestBody ComActReserveRegisterStatisticsDTO registerStatisticsDTO){ |
| | | return comActReserveRecordService.registerStatisticsExportAdmin(registerStatisticsDTO); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询预约处理列表 |
| | | * @param pageMakeHandleDTO 请求参数 |
| | | * @return 预约处理列表 |
| | | */ |
| | | @PostMapping("/admin/make/handle/page") |
| | | public R pageMakeHandleAdmin(@RequestBody PageReserveMakeHandleAdminDTO pageMakeHandleDTO){ |
| | | return comActReserveRecordService.pageMakeHandleAdmin(pageMakeHandleDTO); |
| | | } |
| | | |
| | | /** |
| | | * 批量处理预约记录 |
| | | * @param makeHandleDTO 请求参数 |
| | | * @return 处理结果 |
| | | */ |
| | | @PostMapping("/admin/make/handle") |
| | | public R makeHandleAdmin(@RequestBody MakeHandleAdminDTO makeHandleDTO){ |
| | | return comActReserveRecordService.makeHandleAdmin(makeHandleDTO); |
| | | } |
| | | |
| | | /** |
| | | * 导出预约处理列表数据查询 |
| | | * @param pageMakeHandleDTO 请求参数 |
| | | * @return 预约处理列表 |
| | | */ |
| | | @PostMapping("/admin/make/handle/export") |
| | | public R exportMakeHandleAdmin(@RequestBody PageReserveMakeHandleAdminDTO pageMakeHandleDTO){ |
| | | return comActReserveRecordService.exportMakeHandleAdmin(pageMakeHandleDTO); |
| | | } |
| | | |
| | | /** |
| | | * 删除预约登记信息 |
| | | * @param reserveId 预约登记id |
| | | * @return 删除结果 |
| | | */ |
| | | @GetMapping("/admin/delete") |
| | | public R deleteReserveAdmin(@RequestParam("reserveId") Long reserveId){ |
| | | return comActReserveService.deleteReserveAdmin(reserveId); |
| | | } |
| | | |
| | | /** |
| | | * 查询社区所有预约信息列表 |
| | | * @param communityId 社区id |
| | | * @return 预约信息列表 |
| | | */ |
| | | @GetMapping("/admin/list") |
| | | public R listReserveAdmin(@RequestParam("communityId") Long communityId){ |
| | | return comActReserveService.listReserveAdmin(communityId); |
| | | } |
| | | |
| | | /** |
| | | * 导出登记明细数据 |
| | | * @param reserveId 登记id |
| | | * @return 登记明细数据 |
| | | */ |
| | | @GetMapping("/admin/register/list/export") |
| | | public R exportRegisterAdmin(@RequestParam("reserveId") Long reserveId){ |
| | | return comActReserveAnswerContentService.exportRegisterAdmin(reserveId); |
| | | } |
| | | |
| | | /** |
| | | * 我的预约/登记 |
| | | * @param pageUserReserveDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/userReserveList") |
| | | public R userReserveList(@RequestBody PageUserReserveDTO pageUserReserveDTO){ |
| | | return comActReserveService.pageReserveList(pageUserReserveDTO); |
| | | } |
| | | /** |
| | | * 取消预约/登记 |
| | | */ |
| | | @PostMapping("/cancelReserve") |
| | | public R userCancelReserve(@RequestBody CancelRecordDTO cancelRecordDTO){ |
| | | return comActReserveRecordService.cancel(cancelRecordDTO); |
| | | } |
| | | |
| | | /** |
| | | * 预约详情操作记录 |
| | | */ |
| | | @PostMapping("/detailOperation") |
| | | public R reserveOperation(@RequestBody OperationDetailDTO comActReserveOperationRecordDO){ |
| | | return comActReserveOperationRecordService.detailOperationRecord(comActReserveOperationRecordDO); |
| | | } |
| | | |
| | | /** |
| | | * 查询预约登记题目列表 |
| | | * @param reserveId 预约登记id |
| | | * @return 约登记题目列表 |
| | | */ |
| | | @GetMapping("/admin/subject/list") |
| | | public R subjectListAdmin(@RequestParam("reserveId") Long reserveId){ |
| | | return comActReserveSubService.subjectListAdmin(reserveId); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询登记明细列表 |
| | | * @param detailedAdminDTO 请求参数 |
| | | * @return 登记明细列表 |
| | | */ |
| | | @PostMapping("/admin/register/detailed/list") |
| | | public R registerDetailedListAdmin(@RequestBody PageReserveRegisterDetailedAdminDTO detailedAdminDTO){ |
| | | return comActReserveAnswerContentService.registerDetailedListAdmin(detailedAdminDTO); |
| | | } |
| | | |
| | | @GetMapping("/admin/register/detailed/detail") |
| | | public R registerDetailedDetailAdmin(@RequestParam("reserveRecordId") Long reserveRecordId){ |
| | | return comActReserveRecordService.registerDetailedDetailAdmin(reserveRecordId); |
| | | } |
| | | } |
| | |
| | | public R villageStatistics(@RequestParam("communityId") Long communityId) { |
| | | return comMngVillageService.villageStatistics(communityId); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.panzhihua.service_community.api; |
| | | |
| | | import java.util.*; |
| | | import java.util.ArrayList; |
| | | import java.util.Comparator; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Optional; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.exceptions.ServiceException; |
| | | import com.panzhihua.common.model.dtos.community.*; |
| | | import com.panzhihua.common.model.dtos.community.ComActEasyPhotoCommentDTO; |
| | | import com.panzhihua.common.model.dtos.community.ComActEasyPhotoCommentUserDTO; |
| | | import com.panzhihua.common.model.dtos.community.EldersAuthAddByFamilyDTO; |
| | | import com.panzhihua.common.model.dtos.community.EldersAuthAddDTO; |
| | | import com.panzhihua.common.model.dtos.community.EldersAuthDeleteDTO; |
| | | import com.panzhihua.common.model.dtos.community.EldersAuthEditDTO; |
| | | import com.panzhihua.common.model.dtos.community.EldersAuthFeedbackAddDTO; |
| | | import com.panzhihua.common.model.dtos.community.GrantRewardDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageComActDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageComActEasyPhotoCommentDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageEldersAuthDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageQuestnaireAnswerDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageQuestnaireDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageQuestnaireSubDetailsDTO; |
| | | import com.panzhihua.common.model.dtos.community.easyPhoto.ExportEasyPhotoDTO; |
| | | import com.panzhihua.common.model.dtos.community.questnaire.StatisticsSummaryDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.SystemmanagementConfigVO; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.model.vos.community.ComActActRegistVO; |
| | | import com.panzhihua.common.model.vos.community.ActivitySignVO; |
| | | import com.panzhihua.common.model.vos.community.BatchhouseVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActEvaluateVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActPrizeVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActivityVO; |
| | | import com.panzhihua.common.model.vos.community.ComActDynVO; |
| | | import com.panzhihua.common.model.vos.community.ComActEasyPhotoVO; |
| | | import com.panzhihua.common.model.vos.community.ComActMessageBackVO; |
| | | import com.panzhihua.common.model.vos.community.ComActMessageVO; |
| | | import com.panzhihua.common.model.vos.community.ComActMicroWishVO; |
| | | import com.panzhihua.common.model.vos.community.ComActVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngStructAreaVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngStructHouseVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngStructOtherBuildVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVolunteerMngAppletsVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVolunteerMngVO; |
| | | import com.panzhihua.common.model.vos.community.EldersAuthDetailsVO; |
| | | import com.panzhihua.common.model.vos.community.EldersAuthVO; |
| | | import com.panzhihua.common.model.vos.community.ResetComActMessageVO; |
| | | import com.panzhihua.common.model.vos.community.SignactivityVO; |
| | | import com.panzhihua.common.model.vos.community.TodoEventsVO; |
| | | import com.panzhihua.common.model.vos.community.questnaire.EditComActQuestnaireVo; |
| | | import com.panzhihua.common.model.vos.community.questnaire.QuestnaireVO; |
| | | import com.panzhihua.common.model.vos.community.questnaire.UsersAnswerQuestnaireVO; |
| | |
| | | import com.panzhihua.common.model.vos.user.SysUserNoticeVO; |
| | | import com.panzhihua.common.model.vos.user.UserPhoneVO; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.utlis.*; |
| | | import com.panzhihua.common.utlis.AgeUtils; |
| | | import com.panzhihua.common.utlis.ClazzUtils; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.common.utlis.IdCard; |
| | | import com.panzhihua.common.utlis.WxUtil; |
| | | import com.panzhihua.common.utlis.WxXCXTempSend; |
| | | import com.panzhihua.service_community.dao.ComActActSignDAO; |
| | | import com.panzhihua.service_community.dao.ComEldersAuthHistoryRecordMapper; |
| | | import com.panzhihua.service_community.dao.ComMngPopulationDAO; |
| | | import com.panzhihua.service_community.model.dos.*; |
| | | import com.panzhihua.service_community.service.*; |
| | | import com.panzhihua.service_community.model.dos.ComActActEvaluateDO; |
| | | import com.panzhihua.service_community.model.dos.ComActActPrizeDO; |
| | | import com.panzhihua.service_community.model.dos.ComActDynDO; |
| | | import com.panzhihua.service_community.model.dos.ComActEasyPhotoDO; |
| | | import com.panzhihua.service_community.model.dos.ComActMicroWishDO; |
| | | import com.panzhihua.service_community.model.dos.ComEldersAuthHistoryRecordDO; |
| | | import com.panzhihua.service_community.model.dos.ComEldersAuthUserDO; |
| | | import com.panzhihua.service_community.model.dos.ComMngStructAreaDO; |
| | | import com.panzhihua.service_community.model.dos.EldersAuthDO; |
| | | import com.panzhihua.service_community.service.ComActActEvaluateService; |
| | | import com.panzhihua.service_community.service.ComActActPrizeService; |
| | | import com.panzhihua.service_community.service.ComActActivityService; |
| | | import com.panzhihua.service_community.service.ComActDynService; |
| | | import com.panzhihua.service_community.service.ComActEasyPhotoActivityService; |
| | | import com.panzhihua.service_community.service.ComActEasyPhotoService; |
| | | import com.panzhihua.service_community.service.ComActMessageService; |
| | | import com.panzhihua.service_community.service.ComActMicroWishService; |
| | | import com.panzhihua.service_community.service.ComActQuestnaireService; |
| | | import com.panzhihua.service_community.service.ComActService; |
| | | import com.panzhihua.service_community.service.ComEldersAuthUserService; |
| | | import com.panzhihua.service_community.service.ComMngStructAreaDistrictService; |
| | | import com.panzhihua.service_community.service.ComMngStructAreaService; |
| | | import com.panzhihua.service_community.service.ComMngStructHouseService; |
| | | import com.panzhihua.service_community.service.ComMngStructOtherBuildService; |
| | | import com.panzhihua.service_community.service.ComMngVolunteerMngService; |
| | | import com.panzhihua.service_community.service.EldersAuthService; |
| | | |
| | | import cn.hutool.core.util.IdcardUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | private ComEldersAuthHistoryRecordMapper comEldersAuthHistoryRecordMapper; |
| | | @Resource |
| | | private ComActEasyPhotoActivityService comActEasyPhotoActivityService; |
| | | @Resource |
| | | private ComActActEvaluateService comActActEvaluateService; |
| | | |
| | | /** |
| | | * 新增社区活动 |
| | |
| | | if (ObjectUtils.isEmpty(comActActivityVO)) { |
| | | return R.fail("活动不存在"); |
| | | } |
| | | //活动奖品 |
| | | List<ComActActPrizeDO> comActActPrizeDOS = comActActPrizeService |
| | | .list(new QueryWrapper<ComActActPrizeDO>().lambda().eq(ComActActPrizeDO::getActivityId, id)); |
| | | if (!ObjectUtils.isEmpty(comActActPrizeDOS)) { |
| | |
| | | }); |
| | | comActActivityVO.setComActActPrizeVOList(comActActPrizeVOS); |
| | | } |
| | | //活动评价 |
| | | List<ComActActEvaluateDO> comActActEvaluateDOList = comActActEvaluateService |
| | | .list(new QueryWrapper<ComActActEvaluateDO>().lambda().eq(ComActActEvaluateDO::getActivityId, id)); |
| | | if (!ObjectUtils.isEmpty(comActActEvaluateDOList)) { |
| | | List<ComActActEvaluateVO> comActActEvaluateVOList = new ArrayList<>(); |
| | | comActActEvaluateDOList.forEach(comActActEvaluateDO -> { |
| | | ComActActEvaluateVO comActActEvaluateVO = new ComActActEvaluateVO(); |
| | | BeanUtils.copyProperties(comActActEvaluateDO, comActActEvaluateVO); |
| | | comActActEvaluateVOList.add(comActActEvaluateVO); |
| | | }); |
| | | comActActivityVO.setComActActEvaluateVOList(comActActEvaluateVOList); |
| | | //活动评价总数 |
| | | comActActivityVO.setEvaluateAmount(comActActEvaluateDOList.size()); |
| | | //当前用户对活动的评分 |
| | | Optional.ofNullable(userId).ifPresent(currentUserId -> { |
| | | Optional<ComActActEvaluateDO> optional = comActActEvaluateDOList.stream() |
| | | .filter(comActActEvaluateDO -> comActActEvaluateDO.getUserId().equals(currentUserId)).findFirst(); |
| | | if (optional.isPresent()) { |
| | | comActActivityVO.setMyRating(optional.get().getStarLevel()); |
| | | } |
| | | }); |
| | | } |
| | | //签到时间 |
| | | Optional.ofNullable(userId).ifPresent(currentUserId -> { |
| | | R listSignInResult = comActActivityService.listSignInActivity(currentUserId); |
| | | if (R.isOk(listSignInResult) && !ObjectUtils.isEmpty(listSignInResult.getData())) { |
| | | Optional<ComActActRegistVO> optional = JSONArray.parseArray(JSONArray.toJSONString(listSignInResult.getData()), ComActActRegistVO.class).stream() |
| | | .filter(activitySignInVO -> activitySignInVO.getActivityId().equals(id)) |
| | | .sorted(Comparator.comparing(ComActActRegistVO::getCreateAt).reversed()).findFirst(); |
| | | if (optional.isPresent()) { |
| | | comActActivityVO.setActivitySignInDate(optional.get().getCreateAt()); |
| | | } |
| | | } |
| | | }); |
| | | //活动报名名单 |
| | | ActivitySignVO activitySignVO = new ActivitySignVO(); |
| | | activitySignVO.setActivityId(id); |
| | | R r = comActActivityService.listActivitySigns(activitySignVO); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 活动签到 |
| | | * |
| | | * @param comActActRegistVO 请求参数 |
| | | * @return 签到结果 |
| | | */ |
| | | @PostMapping("activity/sign-in") |
| | | public R activitySignIn(@RequestBody ComActActRegistVO comActActRegistVO) { |
| | | return comActActivityService.activitySignIn(comActActRegistVO); |
| | | } |
| | | |
| | | /** |
| | | * 用户签到列表 |
| | | * |
| | | * @param userId 用户id |
| | | * @return 用户签到记录列表 |
| | | */ |
| | | @GetMapping("/sign-in/user/list") |
| | | public R listSignInActivity(@RequestParam("userId") Long userId) { |
| | | return comActActivityService.listSignInActivity(userId); |
| | | } |
| | | |
| | | /** |
| | | * 社区活动评价 |
| | | * |
| | | * @param comActActEvaluateVO 社区评价VO |
| | | * @return 评价结果 |
| | | */ |
| | | @PostMapping("activity/evaluate") |
| | | public R activityEvaluate(@RequestBody ComActActEvaluateVO comActActEvaluateVO) { |
| | | return comActActEvaluateService.activityEvaluate(comActActEvaluateVO); |
| | | } |
| | | |
| | | /** |
| | | * 用户评价列表 |
| | | * |
| | | * @param userId 用户id |
| | | * @return 当前用户对所有活动的评价列表 |
| | | */ |
| | | @GetMapping("/evaluate/user/list") |
| | | public R listEvaluate(@RequestParam("userId") Long userId) { |
| | | return comActActEvaluateService.listEvaluate(userId); |
| | | } |
| | | |
| | | /** |
| | | * 分页活动报名名单 |
| | | * |
| | | * @param activitySignVO |
| | |
| | | @PostMapping("listactivitysigns") |
| | | public R listActivitySigns(@RequestBody ActivitySignVO activitySignVO) { |
| | | return comActActivityService.listActivitySigns(activitySignVO); |
| | | } |
| | | |
| | | /** |
| | | * description getSignLists 查询活动报名名单 |
| | | * @param activitySignVO 查询参数 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/8/24 14:03 |
| | | */ |
| | | @PostMapping("activity/sign/getList") |
| | | public R getSignLists(@RequestBody ActivitySignVO activitySignVO){ |
| | | return comActActivityService.getSignLists(activitySignVO); |
| | | } |
| | | |
| | | /** |
| | | * description listActivityRegists 分页查询活动评价 |
| | | * @param comActActEvaluateVO 活动评价vo |
| | | * @return R 分页查询结果 |
| | | * @author txb |
| | | * @date 2021/8/24 14:03 |
| | | */ |
| | | @PostMapping("activity/evaluate/page") |
| | | public R pageActivityEvaluates(@RequestBody ComActActEvaluateVO comActActEvaluateVO) { |
| | | return comActActivityService.pageActivityEvaluates(comActActEvaluateVO); |
| | | } |
| | | |
| | | /** |
| | | * description getEvaluateLists 查询活动评价 |
| | | * @param comActActEvaluateVO 查询参数 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/8/24 14:03 |
| | | */ |
| | | @PostMapping("activity/evaluate/getList") |
| | | public R getEvaluateLists(@RequestBody ComActActEvaluateVO comActActEvaluateVO){ |
| | | return comActActivityService.getEvaluateLists(comActActEvaluateVO); |
| | | } |
| | | |
| | | /** |
| | | * description pageActivityRegists 分页查询活动签到 |
| | | * @param comActActRegistVO 活动签到vo |
| | | * @return R 分页查询结果 |
| | | * @author txb |
| | | * @date 2021/8/24 14:03 |
| | | */ |
| | | @PostMapping("activity/regist/page") |
| | | public R pageActivityRegists(@RequestBody ComActActRegistVO comActActRegistVO) { |
| | | return comActActivityService.pageActivityRegists(comActActRegistVO); |
| | | } |
| | | |
| | | /** |
| | | * description getRegistLists 查询活动签到 |
| | | * @param comActActRegistVO 查询参数 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/8/25 9:33 |
| | | */ |
| | | @PostMapping("activity/regist/getList") |
| | | public R getRegistLists(@RequestBody ComActActRegistVO comActActRegistVO){ |
| | | return comActActivityService.getRegistLists(comActActRegistVO); |
| | | } |
| | | |
| | | /** |
| | | * description getRegistLists 查询活动未签到 |
| | | * @param comActActRegistVO 查询参数 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/8/25 9:33 |
| | | */ |
| | | @PostMapping("activity/noRegist/getList") |
| | | public R getNoRegistLists(@RequestBody ComActActRegistVO comActActRegistVO){ |
| | | return comActActivityService.getNoRegistLists(comActActRegistVO); |
| | | } |
| | | |
| | | /** |
| | | * description activityStagistics 活动数据统计 |
| | | * @param activityId 活动id |
| | | * @return R 统计结果 |
| | | * @author txb |
| | | * @date 2021/8/25 13:33 |
| | | */ |
| | | @GetMapping("activity/statistics") |
| | | public R activityStatistics(@RequestParam("activityId") Long activityId){ |
| | | return comActActivityService.activityStatistics(activityId); |
| | | } |
| | | |
| | | /** |
| | | * 获取活动历史封面 getPictureList |
| | | * @param userId 用户id |
| | | * @return R 统计结果 |
| | | * @author txb |
| | | * @date 2021/8/27 13:33 |
| | | */ |
| | | @GetMapping("/activity/picture/getList") |
| | | public R getPictureList(@RequestParam("userId") Long userId){ |
| | | return comActActivityService.getPictureList(userId); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * 定时任务针对活动结束后7天还未评价的用户默认好评 |
| | | */ |
| | | @PostMapping("activity/default-praise") |
| | | public R timedTaskActivityDefaultPraise() { |
| | | return comActActEvaluateService.timedTaskActivityDefaultPraise(); |
| | | } |
| | | |
| | | /** |
| | | * 小程序-新增问卷调查浏览数量 |
| | | * |
| | | * @param questId |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.vos.community.ActivitySignVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActEvaluateExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActEvaluateVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActRegistVO; |
| | | import com.panzhihua.service_community.model.dos.ComActActEvaluateDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * title: ComActActEvaluateDAO 社区》活动》活动评价表mapper类 |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * description: 社区》活动》活动评价表mapper类 |
| | | * |
| | | * @author txb |
| | | * @date 2021/8/24 10:21 |
| | | */ |
| | | @Mapper |
| | | public interface ComActActEvaluateDAO extends BaseMapper<ComActActEvaluateDO> { |
| | | |
| | | IPage<ComActActEvaluateVO> pageActivityEvaluates(Page page, @Param("comActActEvaluateVO") ComActActEvaluateVO comActActEvaluateVO); |
| | | |
| | | List<ComActActEvaluateExcelVO> getEvaluateLists(@Param("comActActEvaluateVO") ComActActEvaluateVO comActActEvaluateVO); |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.panzhihua.service_community.model.dos.ComActActPictureDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * title: ComActActPictureDAO 社区》活动》历史上传图片mapper类 |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * description: 社区》活动》历史上传图片mapper类 |
| | | * |
| | | * @author txb |
| | | * @date 2021/8/24 10:21 |
| | | */ |
| | | @Mapper |
| | | public interface ComActActPictureDAO extends BaseMapper<ComActActPictureDO> { |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.vos.community.ComActActEvaluateExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActRegistExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActRegistVO; |
| | | import com.panzhihua.service_community.model.dos.ComActActRegistDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * title: ComActActRegistDAO 社区》活动》活动签到表mapper类 |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * description: 社区》活动》活动签到表mapper类 |
| | | * |
| | | * @author txb |
| | | * @date 2021/8/24 10:21 |
| | | */ |
| | | @Mapper |
| | | public interface ComActActRegistDAO extends BaseMapper<ComActActRegistDO> { |
| | | |
| | | |
| | | IPage<ComActActRegistVO> pageActivityRegists(Page page, @Param("comActActRegistVO") ComActActRegistVO comActActRegistVO); |
| | | |
| | | List<ComActActRegistExcelVO> getRegistLists(@Param("comActActRegistVO") ComActActRegistVO comActActRegistVO); |
| | | |
| | | List<ComActActRegistExcelVO> getNoRegistLists(@Param("comActActRegistVO") ComActActRegistVO comActActRegistVO); |
| | | } |
| | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.panzhihua.common.model.vos.community.ComActActSignExcelVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | |
| | | // 居民 党员 志愿者 1 2 3 |
| | | @Select("<script> " + "SELECT " + "u.user_id id, " + "u.image_url, " + "u.name, " + "u.nick_name, " |
| | | + "case WHEN u.is_partymember = 1 THEN '党员' WHEN a.is_volunteer = 1 THEN '志愿者' ELSE '居民' END identity, " |
| | | + "u.phone, " + "a.create_at, " + "a.is_volunteer " + "FROM " + "com_act_act_sign a " |
| | | + "u.phone, " + "u.tags, " + "a.create_at, " + "a.is_volunteer " + "FROM " + "com_act_act_sign a " |
| | | + "JOIN sys_user u ON a.user_id = u.user_id " + "WHERE " + "a.activity_id = #{activitySignVO.activityId} " |
| | | + "<if test='activitySignVO.phone != null and activitySignVO.phone != ""'>" |
| | | + "AND u.phone = #{activitySignVO.phone} " + " </if> " |
| | | + "<if test='activitySignVO.tags != null and activitySignVO.tags != ""'>" |
| | | + "AND u.tags like concat('%',#{activitySignVO.tags},'%') " + " </if> " |
| | | + "<if test='activitySignVO.name != null and activitySignVO.name != ""'>" |
| | | + "AND u.`name` = #{activitySignVO.name} " + " </if> " |
| | | + "<if test='activitySignVO.identity != null and activitySignVO.identity != "" and activitySignVO.identity==1'>" |
| | |
| | | + "AND a.is_volunteer=#{activitySignVO.type}-1 " + " </if> " + " order by a.create_at desc " + "</script>") |
| | | List<ActivitySignVO> listActivitySigns(@Param("activitySignVO") ActivitySignVO activitySignVO); |
| | | |
| | | List<ComActActSignExcelVO> getSignLists (@Param("activitySignVO") ActivitySignVO activitySignVO); |
| | | |
| | | @Select("<script> " + "SELECT " + " caas.user_id, " + " su.NAME, " + "CASE " + " WHEN su.is_volunteer = 1 THEN " |
| | | + " '志愿者' ELSE '居民' " + " END identity, " + " su.phone, " + " caas.create_at " + "FROM " |
| | | + " com_act_act_sign AS caas " |
| | |
| | | |
| | | @Select("select openid from sys_user where user_id = #{userId}") |
| | | Map<String, String> getUserOpenId(@Param("userId") Long userId); |
| | | |
| | | /** |
| | | * 获取需要默认好评的记录 |
| | | * @param activityIds 活动id list |
| | | * @return 需要默认好评的记录列表 |
| | | */ |
| | | List<ComActActSignDO> selectNeedEvaluateSignRecords(@Param("activityIds") List<Long> activityIds); |
| | | } |
| | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.panzhihua.common.model.vos.community.ComActActivityStatisticsVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | |
| | | + "FROM " + " com_act_act_sign AS caas " + " LEFT JOIN sys_user AS su ON su.user_id = caas.user_id " + "WHERE " |
| | | + " su.is_volunteer = 1 " + " AND activity_id = #{activityId} ") |
| | | ActActivityListVO getScreenActActivityPeopleCount(@Param("activityId") Long activityId); |
| | | |
| | | ComActActivityStatisticsVO activityStatistics (@Param("activityId") Long activityId); |
| | | |
| | | /** |
| | | * 查询置于顶部的进行中活动 |
| | | * @param communityId 社区id |
| | | * @return 活动列表 |
| | | */ |
| | | List<ComActActivityVO> getIndexTopActivityList(@Param("communityId") Long communityId); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.community.reserve.PageReserveRegisterDetailedAdminDTO; |
| | | import com.panzhihua.common.model.vos.community.reserve.ComActReserveRegisterDetailedAnswerVO; |
| | | import com.panzhihua.common.model.vos.community.reserve.ComActReserveRegisterDetailedVO; |
| | | import com.panzhihua.service_community.model.dos.ComActReserveAnswerContentDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-08-23 10:33:32 |
| | | * @describe 预约登记回答记录内容 mapper类 |
| | | */ |
| | | @Mapper |
| | | public interface ComActReserveAnswerContentMapper extends BaseMapper<ComActReserveAnswerContentDO> { |
| | | |
| | | /** |
| | | * 查询用户填写登记类答案记录列表 |
| | | * @param reserveId 预约登记id |
| | | * @return 登记类答案记录列表 |
| | | */ |
| | | List<ComActReserveAnswerContentDO> selectListByReserve(@Param("reserveId")Long reserveId); |
| | | |
| | | /** |
| | | * 分页查询用户填写某预约登记记录列表 |
| | | * @param page 分页参数 |
| | | * @param detailedAdminDTO 请求参数 |
| | | * @return 某预约登记记录列表 |
| | | */ |
| | | IPage<ComActReserveRegisterDetailedVO> pageRegisterDetailedListAdmin(Page page, @Param("detailedAdminDTO") PageReserveRegisterDetailedAdminDTO detailedAdminDTO); |
| | | |
| | | /** |
| | | * 查询登记记录填写的内容列表 |
| | | * @param reserveRecordId 预约登记记录id |
| | | * @return 登记记录填写的内容列表 |
| | | */ |
| | | List<ComActReserveRegisterDetailedAnswerVO> getRegisterDetailedAnswerList(@Param("reserveRecordId")Long reserveRecordId); |
| | | |
| | | ComActReserveRegisterDetailedVO getRegisterDetailedById(@Param("reserveRecordId") Long reserveRecordId); |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.community.reserve.ComActReserveMakeStatisticsDTO; |
| | | import com.panzhihua.common.model.dtos.community.reserve.PageReserveAdminDTO; |
| | | import com.panzhihua.common.model.vos.community.reserve.ComActReserveListAdminVO; |
| | | import com.panzhihua.common.model.vos.community.reserve.ComActReserveMakeLeftStatisticsAdminVO; |
| | | import com.panzhihua.common.model.vos.community.reserve.ComActReserveMakeRightStatisticsAdminVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.community.PageUserReserveDTO; |
| | | import com.panzhihua.common.model.vos.community.ComActReserveIndexVo; |
| | | import com.panzhihua.service_community.model.dos.ComActReserveDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-08-23 10:33:11 |
| | | * @describe 预约登记表mapper类 |
| | | */ |
| | | @Mapper |
| | | public interface ComActReserveMapper extends BaseMapper<ComActReserveDO> { |
| | | /** |
| | | * 查询预约登记首页banner |
| | | * @param communityId |
| | | * @return 预约登记首页banner列表 |
| | | */ |
| | | List<ComActReserveIndexVo> indexBanner(Long communityId); |
| | | /** |
| | | * 查询预约登记应用列表 |
| | | * @param communityId |
| | | * @return 预约登记应用列表 |
| | | */ |
| | | List<ComActReserveIndexVo> indexApplication(Long communityId); |
| | | |
| | | /** |
| | | * 社区后台-分页查询预约登记列表 |
| | | * @param pageReserveDTO 请求参数 |
| | | * @return 预约登记列表 |
| | | */ |
| | | IPage<ComActReserveListAdminVO> pageReserveAdmin(Page page, @Param("pageReserveDTO") PageReserveAdminDTO pageReserveDTO); |
| | | |
| | | /** |
| | | * 根据预约登记id删除预约登记原有题目以及题目选项 |
| | | * @param reserveId 预约登记id |
| | | */ |
| | | void deleteReserveSubAll(@Param("reserveId") Long reserveId); |
| | | |
| | | /** |
| | | * 社区后台-根据社区id查询预约统计汇总左边数据 |
| | | * @param communityId 社区id |
| | | * @return 预约统计汇总左边数据 |
| | | */ |
| | | List<ComActReserveMakeLeftStatisticsAdminVO> getReserveMakeLeftStatistics(@Param("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 社区后台-查询预约统计汇总右边数据 |
| | | * @param makeStatisticsDTO 请求参数 |
| | | * @return 预约统计汇总右边数据 |
| | | */ |
| | | List<ComActReserveMakeRightStatisticsAdminVO> getReserveMakeRightStatistics(@Param("makeStatisticsDTO") ComActReserveMakeStatisticsDTO makeStatisticsDTO); |
| | | |
| | | /** |
| | | * 社区后台-根据社区id 查询开始时间到结束时间预约成功数量 |
| | | * @param communityId 社区id |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return 预约成功数量 |
| | | */ |
| | | Integer getReserveRecordCount(@Param("communityId") Long communityId,@Param("startTime") String startTime,@Param("endTime") String endTime); |
| | | |
| | | /** |
| | | * 查询社区所有预约信息列表 |
| | | * @param communityId 社区id |
| | | * @return 预约信息列表 |
| | | */ |
| | | List<ComActReserveListAdminVO> listReserveAdmin(@Param("communityId") Long communityId); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.panzhihua.common.model.vos.community.reserve.ComActReserveMakeOperationAdminVO; |
| | | import com.panzhihua.service_community.model.dos.ComActReserveOperationRecordDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-08-23 10:33:42 |
| | | * @describe 预约登记操作记录表mapper类 |
| | | */ |
| | | @Mapper |
| | | public interface ComActReserveOperationRecordMapper extends BaseMapper<ComActReserveOperationRecordDO> { |
| | | |
| | | /** |
| | | * 根据预约记录id查询预约明细操作记录 |
| | | * @param reserveRecordId 预约记录id |
| | | * @return 预约明细操作记录 |
| | | */ |
| | | List<ComActReserveMakeOperationAdminVO> getMakeOperationList(@Param("reserveRecordId") Long reserveRecordId); |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.community.OperationDetailDTO; |
| | | import com.panzhihua.common.model.dtos.community.reserve.ComActReserveRegisterStatisticsDTO; |
| | | import com.panzhihua.common.model.dtos.community.reserve.PageReserveMakeAdminDTO; |
| | | import com.panzhihua.common.model.dtos.community.reserve.PageReserveMakeHandleAdminDTO; |
| | | import com.panzhihua.common.model.vos.community.reserve.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.community.PageUserReserveDTO; |
| | | import com.panzhihua.service_community.model.dos.ComActReserveDO; |
| | | import com.panzhihua.service_community.model.dos.ComActReserveRecordDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-08-23 10:33:53 |
| | | * @describe 预约登记记录表mapper类 |
| | | */ |
| | | @Mapper |
| | | public interface ComActReserveRecordMapper extends BaseMapper<ComActReserveRecordDO> { |
| | | IPage<ComActReserveRecordDO> pageReserveList(Page page, @Param("pageUserReserveDTO") PageUserReserveDTO pageUserReserveDTO); |
| | | |
| | | /** |
| | | * 社区后台-根据预约id查询预约明细 |
| | | * @param pageMakeDTO 请求参数 |
| | | * @return 预约明细 |
| | | */ |
| | | IPage<ComActReserveMakeListAdminVO> pageMakeAdmin(Page page, @Param("pageMakeDTO") PageReserveMakeAdminDTO pageMakeDTO); |
| | | |
| | | /** |
| | | * 根据预约记录id查询预约记录详细信息 |
| | | * @param reserveRecordId 预约记录id |
| | | * @return 预约记录详细信息 |
| | | */ |
| | | ComActReserveMakeDetailAdminVO getMakeDetailAdmin(@Param("reserveRecordId") Long reserveRecordId); |
| | | |
| | | /** |
| | | * 查询预约记录id集合中是否存在未预约成功的记录 |
| | | * @param ids 预约记录id集合 |
| | | * @return 未预约成功记录的数量 |
| | | */ |
| | | Integer getReserveStatusById(@Param("ids") List<Long> ids); |
| | | |
| | | /** |
| | | * 修改预约记录id集合的预约状态为已取消 |
| | | * @param ids 预约记录id集合 |
| | | * @return 修改结果 |
| | | */ |
| | | Integer editReserveStatusById(@Param("ids") List<Long> ids); |
| | | |
| | | /** |
| | | * 预约明细导出数据查询 |
| | | * @param pageMakeDTO 请求参数 |
| | | * @return 预约明细数据 |
| | | */ |
| | | List<ComActReserveMakeListAdminVO> exportMakeAdmin(@Param("pageMakeDTO") PageReserveMakeAdminDTO pageMakeDTO); |
| | | |
| | | /** |
| | | * 分页查询登记统计汇总 |
| | | * @param registerStatisticsDTO 请求参数 |
| | | * @return 登记统计汇总 |
| | | */ |
| | | IPage<ComActReserveRegisterStatisticsAdminVO> registerStatisticsAdmin(Page page, @Param("registerStatisticsDTO") ComActReserveRegisterStatisticsDTO registerStatisticsDTO); |
| | | |
| | | /** |
| | | * 导出登记统计汇总 |
| | | * @param registerStatisticsDTO 请求参数 |
| | | * @return 登记统计汇总 |
| | | */ |
| | | List<ComActReserveRegisterStatisticsAdminVO> registerStatisticsExportAdmin(@Param("registerStatisticsDTO") ComActReserveRegisterStatisticsDTO registerStatisticsDTO); |
| | | |
| | | /** |
| | | * 分页查询预约处理列表 |
| | | * @param pageMakeHandleDTO 请求参数 |
| | | * @return 预约处理列表 |
| | | */ |
| | | IPage<ComActReserveMakeHandleListAdminVO> pageMakeHandleAdmin(Page page, @Param("pageMakeHandleDTO") PageReserveMakeHandleAdminDTO pageMakeHandleDTO); |
| | | |
| | | /** |
| | | * 查询指定预约记录是否存在不是待处理状态的数据 |
| | | * @param ids 预约记录id集合 |
| | | * @return 不是待处理状态数据条数 |
| | | */ |
| | | Integer getReserveListCountByIds(@Param("ids")List<Long> ids); |
| | | |
| | | /** |
| | | * 导出预约处理列表数据查询 |
| | | * @param pageMakeHandleDTO 请求参数 |
| | | * @return 预约处理列表 |
| | | */ |
| | | List<ComActReserveMakeHandleListAdminVO> exportMakeHandleAdmin(@Param("pageMakeHandleDTO") PageReserveMakeHandleAdminDTO pageMakeHandleDTO); |
| | | |
| | | ComActReserveRegisterDetailedVO getRegisterDetailedByRecordId(@Param("reserveRecordId") Long reserveRecordId); |
| | | |
| | | /** |
| | | * 根据reserveRecordId查询操作记录 |
| | | * @param operationDetailDTO |
| | | * @return |
| | | */ |
| | | List<ComOperationListVO> queryAll(OperationDetailDTO operationDetailDTO); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.panzhihua.common.model.vos.community.reserve.ComActReserveSubListVO; |
| | | import com.panzhihua.service_community.model.dos.ComActReserveAnswerContentDO; |
| | | import com.panzhihua.service_community.model.dos.ComActReserveSubDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-08-23 10:34:03 |
| | | * @describe 预约登记题目选项mapper类 |
| | | */ |
| | | @Mapper |
| | | public interface ComActReserveSubMapper extends BaseMapper<ComActReserveSubDO> { |
| | | |
| | | /** |
| | | * 根据预约登记id查询题目列表 |
| | | * @param reserveId 预约登记id |
| | | * @return 题目列表 |
| | | */ |
| | | List<ComActReserveSubListVO> getReserveSubjectList(@Param("reserveId") Long reserveId); |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.panzhihua.service_community.model.dos.ComActReserveSubSelectionDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-08-23 10:34:13 |
| | | * @describe 预约登记题目选项 mapper类 |
| | | */ |
| | | @Mapper |
| | | public interface ComActReserveSubSelectionMapper extends BaseMapper<ComActReserveSubSelectionDO> { |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.model.dos; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * title: ComActActEvaluateDO 社区活动评价表 |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * description: 记录和展示社区活动评价内容 |
| | | * |
| | | * @author txb |
| | | * @date 2021/8/24 10:21 |
| | | */ |
| | | |
| | | @Data |
| | | @TableName("com_act_act_evaluate") |
| | | public class ComActActEvaluateDO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 自增id |
| | | */ |
| | | @TableId(type = IdType.INPUT) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 所属活动id |
| | | */ |
| | | private Long activityId; |
| | | |
| | | /** |
| | | * 用户id, 和用户信息表的相关id关联 |
| | | */ |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 评价时间 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Date createAt; |
| | | |
| | | /** |
| | | * 是否是志愿者 0 否 1 是 |
| | | */ |
| | | private Integer isVolunteer; |
| | | |
| | | /** |
| | | * 评分星级1.差 2.一般 3.还不错 4.很满意 5.强烈推荐 |
| | | */ |
| | | private Integer starLevel; |
| | | |
| | | /** |
| | | * 评价内容 |
| | | */ |
| | | private String evaluateContent; |
| | | |
| | | /** |
| | | * 照片(多张以逗号隔开) |
| | | */ |
| | | private String photo; |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ComActActEvaluateDO{" + |
| | | "id=" + id + |
| | | ", activityId=" + activityId + |
| | | ", userId=" + userId + |
| | | ", createAt=" + createAt + |
| | | ", isVolunteer=" + isVolunteer + |
| | | ", starLevel=" + starLevel + |
| | | ", evaluateContent=" + evaluateContent + |
| | | ", photo=" + photo + |
| | | "}"; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.model.dos; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * title: ComActActPictureDO 社区》活动》历史上传图片实体类 |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * description: 社区》活动》历史上传图片实体类 |
| | | * |
| | | * @author txb |
| | | * @date 2021/8/27 14:21 |
| | | */ |
| | | |
| | | @Data |
| | | @TableName("com_act_act_picture") |
| | | public class ComActActPictureDO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 所属活动id |
| | | */ |
| | | private Long activityId; |
| | | |
| | | /** |
| | | * 用户id, 和用户信息表的相关id关联 |
| | | */ |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 上传时间 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Date createAt; |
| | | |
| | | /** |
| | | * 上传图片 |
| | | */ |
| | | private String uploadPicture; |
| | | |
| | | /** |
| | | * 图片名称 |
| | | */ |
| | | private String pictureName; |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ComActActPictureDO{" + |
| | | "id=" + id + |
| | | ", activityId=" + activityId + |
| | | ", userId=" + userId + |
| | | ", createAt=" + createAt + |
| | | ", uploadPicture=" + uploadPicture + |
| | | ", pictureName=" + pictureName + |
| | | "}"; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.model.dos; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * title: ComActActRegistDO 社区》活动》活动签到表实体类 |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * description: 社区》活动》活动签到表实体类 |
| | | * |
| | | * @author txb |
| | | * @date 2021/8/24 10:21 |
| | | */ |
| | | |
| | | @Data |
| | | @TableName("com_act_act_regist") |
| | | public class ComActActRegistDO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 自增id |
| | | */ |
| | | @TableId(type = IdType.INPUT) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 所属活动id |
| | | */ |
| | | private Long activityId; |
| | | |
| | | /** |
| | | * 用户id, 和用户信息表的相关id关联 |
| | | */ |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 签到时间 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Date createAt; |
| | | |
| | | /** |
| | | * 是否是志愿者 0 否 1 是 |
| | | */ |
| | | private Integer isVolunteer; |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ComActActRegistDO{" + |
| | | "id=" + id + |
| | | ", activityId=" + activityId + |
| | | ", userId=" + userId + |
| | | ", createAt=" + createAt + |
| | | ", isVolunteer=" + isVolunteer + |
| | | "}"; |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | |
| | | private String activityAddr; |
| | | |
| | | /** |
| | | * 纬度 |
| | | */ |
| | | private String lat; |
| | | |
| | | /** |
| | | * 经度 |
| | | */ |
| | | private String lng; |
| | | |
| | | /** |
| | | * 活动状态 |
| | | */ |
| | | private Integer status; |
| | |
| | | * 报名结束时间 |
| | | */ |
| | | private Date signUpEnd; |
| | | |
| | | /** |
| | | * 参加人群 |
| | | */ |
| | | private String aattendPeople; |
| | | |
| | | |
| | | /** |
| | | * 志愿者人数下线 |
| | |
| | | private Integer hasPrize; |
| | | |
| | | /** |
| | | * 是否二维码签到 1 是 0否 |
| | | */ |
| | | private Integer isQrCode; |
| | | |
| | | /** |
| | | * 联系人姓名 |
| | | */ |
| | | private String contactName; |
| | | |
| | | /** |
| | | * 联系人电话 |
| | | */ |
| | | private String contactPhone; |
| | | |
| | | /** |
| | | * 是否签到 1 是 0否 |
| | | */ |
| | | private Integer isRegist; |
| | | |
| | | /** |
| | | * 是否顶部 1 是 0否 |
| | | */ |
| | | private Integer isTop; |
| | | |
| | | /** |
| | | * 奖品备注 |
| | | */ |
| | | private String prizeRemark; |
| | |
| | | * 社区id |
| | | */ |
| | | private Long communityId; |
| | | /** |
| | | * 活动是否已默认好评 |
| | | */ |
| | | private Integer isDefaultPraise; |
| | | } |
| | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | /** |
| | | * 类型 0单选1多选2问答题 |
| | | * 类型 0 单选 1 多选 2 输入框 2姓名输入框 3 手机号 4 身份证 5 文字描述 6 日期选择 |
| | | */ |
| | | private int type; |
| | | /** |
New file |
| | |
| | | package com.panzhihua.service_community.model.dos; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-08-23 10:33:32 |
| | | * @describe 预约登记回答记录内容 实体类 |
| | | */ |
| | | |
| | | @Data |
| | | @TableName("com_act_reserve_answer_content") |
| | | public class ComActReserveAnswerContentDO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * id |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 预约登记题目id |
| | | */ |
| | | private Long reserveSubId; |
| | | |
| | | /** |
| | | * 预约登记记录id |
| | | */ |
| | | private Long reserveRecordId; |
| | | |
| | | /** |
| | | * 预约登记题目选项id |
| | | */ |
| | | private Long reserveSelectionId; |
| | | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 题目类型(1.选项题 2.问答题) |
| | | */ |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 问卷回答选项 |
| | | */ |
| | | private String choice; |
| | | |
| | | /** |
| | | * 问卷回答内容 |
| | | */ |
| | | private String answerContent; |
| | | |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | private Long createBy; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private Date createAt; |
| | | |
| | | /** |
| | | * 更新人 |
| | | */ |
| | | private String updateBy; |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | private Date updateAt; |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ComActReserveAnswerContentDO{" + |
| | | "id=" + id + |
| | | ", reserveSubId=" + reserveSubId + |
| | | ", reserveSelectionId=" + reserveSelectionId + |
| | | ", userId=" + userId + |
| | | ", type=" + type + |
| | | ", choice=" + choice + |
| | | ", answerContent=" + answerContent + |
| | | ", createBy=" + createBy + |
| | | ", createAt=" + createAt + |
| | | ", updateBy=" + updateBy + |
| | | ", updateAt=" + updateAt + |
| | | "}"; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.model.dos; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-08-23 10:33:11 |
| | | * @describe 预约登记表实体类 |
| | | */ |
| | | |
| | | @Data |
| | | @TableName("com_act_reserve") |
| | | public class ComActReserveDO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 社区id |
| | | */ |
| | | private Long communityId; |
| | | |
| | | /** |
| | | * 类型(1.预约 2.登记) |
| | | */ |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 主题 |
| | | */ |
| | | private String title; |
| | | |
| | | /** |
| | | * 浏览量 |
| | | */ |
| | | private Integer viewNum; |
| | | |
| | | /** |
| | | * 总参加人数 |
| | | */ |
| | | private Integer joinAllCount; |
| | | |
| | | /** |
| | | * 参加人数 |
| | | */ |
| | | private Integer joinCount; |
| | | |
| | | /** |
| | | * 图标类型(1.预设1 2.预设2 3.预设3 4.预设4 5.用户自定义图片) |
| | | */ |
| | | private Integer imgType; |
| | | |
| | | /** |
| | | * 图标url(当img_type为5时,此字段的值为图标url地址) |
| | | */ |
| | | private String imgUrl; |
| | | |
| | | /** |
| | | * 状态(1.待发布 2.进行中 3.已停止) |
| | | */ |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 发布时间 |
| | | */ |
| | | private Date publishTime; |
| | | |
| | | /** |
| | | * 是否可重复提交(1.是 2.否) |
| | | */ |
| | | private Integer isRepeat; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String remark; |
| | | |
| | | /** |
| | | * 组件json数据 |
| | | */ |
| | | private String jsonObject; |
| | | |
| | | /** |
| | | * 是否是首页顶部(1.是 2.否) |
| | | */ |
| | | private Integer adverPositionTop; |
| | | |
| | | /** |
| | | * 是否是首页应用(1.是 2.否) |
| | | */ |
| | | private Integer adverPositionApplication; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private Date createAt; |
| | | |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | private Long createBy; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | private Date updateAt; |
| | | |
| | | /** |
| | | * 修改人 |
| | | */ |
| | | private Long updateBy; |
| | | |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | @TableField(value = "end_time", updateStrategy = FieldStrategy.IGNORED) |
| | | private Date endTime; |
| | | |
| | | /** |
| | | * 是否已删除(1.是 2.否) |
| | | */ |
| | | private Integer isDel; |
| | | |
| | | /** |
| | | * 默认是否枚举(1.是 2.否) |
| | | */ |
| | | public interface isOk{ |
| | | int yes = 1; |
| | | int no = 2; |
| | | } |
| | | |
| | | /** |
| | | * 预约登记状态枚举(1.待发布 2.进行中 3.已停止) |
| | | */ |
| | | public interface status{ |
| | | int dfb = 1; |
| | | int jxz = 2; |
| | | int ytz = 3; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ComActReserveDO{" + |
| | | "id=" + id + |
| | | ", communityId=" + communityId + |
| | | ", type=" + type + |
| | | ", title=" + title + |
| | | ", viewNum=" + viewNum + |
| | | ", joinAllCount=" + joinAllCount + |
| | | ", joinCount=" + joinCount + |
| | | ", imgType=" + imgType + |
| | | ", imgUrl=" + imgUrl + |
| | | ", status=" + status + |
| | | ", publishTime=" + publishTime + |
| | | ", isRepeat=" + isRepeat + |
| | | ", remark=" + remark + |
| | | ", jsonObject=" + jsonObject + |
| | | ", adverPositionTop=" + adverPositionTop + |
| | | ", adverPositionApplication=" + adverPositionApplication + |
| | | ", createAt=" + createAt + |
| | | ", createBy=" + createBy + |
| | | ", updateAt=" + updateAt + |
| | | ", updateBy=" + updateBy + |
| | | "}"; |
| | | } |
| | | public interface isRepeat{ |
| | | int yes=1; |
| | | int no=2; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.model.dos; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-08-23 10:33:42 |
| | | * @describe 预约登记操作记录表实体类 |
| | | */ |
| | | |
| | | @Data |
| | | @TableName("com_act_reserve_operation_record") |
| | | public class ComActReserveOperationRecordDO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 预约登记id |
| | | */ |
| | | private Long reserveId; |
| | | |
| | | /** |
| | | * 预约登记记录id |
| | | */ |
| | | private Long reserveRecordId; |
| | | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 类型(1.本人操作 2.社区操作) |
| | | */ |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 操作人手机号 |
| | | */ |
| | | private String phone; |
| | | |
| | | /** |
| | | * 操作时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date reserveTime; |
| | | |
| | | /** |
| | | * 操作内容 |
| | | */ |
| | | private String reserveContent; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String remark; |
| | | |
| | | /** |
| | | * 状态(1.提交 2.预约成功 3.预约失败 4.取消) |
| | | */ |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | private Long createBy; |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ComActReserveOperationRecordDO{" + |
| | | "id=" + id + |
| | | ", reserveId=" + reserveId + |
| | | ", reserveRecordId=" + reserveRecordId + |
| | | ", userId=" + userId + |
| | | ", type=" + type + |
| | | ", phone=" + phone + |
| | | ", reserveTime=" + reserveTime + |
| | | ", reserveContent=" + reserveContent + |
| | | ", remark=" + remark + |
| | | ", status=" + status + |
| | | ", createAt=" + createAt + |
| | | ", createBy=" + createBy + |
| | | "}"; |
| | | } |
| | | |
| | | /** |
| | | * 1本人 2社区 |
| | | */ |
| | | public interface type{ |
| | | int br=1; |
| | | int sq=2; |
| | | } |
| | | /** |
| | | * 状态(1.提交 2.预约成功 3.预约失败 4.取消) |
| | | */ |
| | | public interface status{ |
| | | int ytj=1; |
| | | int cg=2; |
| | | int sb=3; |
| | | int qx=4; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.model.dos; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-08-23 10:33:53 |
| | | * @describe 预约登记记录表实体类 |
| | | */ |
| | | |
| | | @Data |
| | | @TableName("com_act_reserve_record") |
| | | public class ComActReserveRecordDO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 预约登记id |
| | | */ |
| | | private Long reserveId; |
| | | |
| | | /** |
| | | * 社区id |
| | | */ |
| | | private Long communityId; |
| | | |
| | | /** |
| | | * 类型(1.预约 2.登记) |
| | | */ |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 提交人名称 |
| | | */ |
| | | private String name; |
| | | |
| | | /** |
| | | * 提交人手机号 |
| | | */ |
| | | private String phone; |
| | | |
| | | /** |
| | | * 状态(1.待处理 2.预约成功 3.预约失败 4.已取消) |
| | | */ |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 内容 |
| | | */ |
| | | private String content; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String remark; |
| | | |
| | | /** |
| | | * 社区备注 |
| | | */ |
| | | private String actRemark; |
| | | |
| | | /** |
| | | * 预约时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date reserveTime; |
| | | |
| | | /** |
| | | * 用户填报json数据 |
| | | */ |
| | | private String jsonObject; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | private Long createBy; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | private Date updateAt; |
| | | |
| | | /** |
| | | * 修改人 |
| | | */ |
| | | private Long updateBy; |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ComActReserveRecordDO{" + |
| | | "id=" + id + |
| | | ", userId=" + userId + |
| | | ", reserveId=" + reserveId + |
| | | ", communityId=" + communityId + |
| | | ", type=" + type + |
| | | ", name=" + name + |
| | | ", phone=" + phone + |
| | | ", status=" + status + |
| | | ", content=" + content + |
| | | ", remark=" + remark + |
| | | ", actRemark=" + actRemark + |
| | | ", reserveTime=" + reserveTime + |
| | | ", jsonObject=" + jsonObject + |
| | | ", createAt=" + createAt + |
| | | ", createBy=" + createBy + |
| | | ", updateAt=" + updateAt + |
| | | ", updateBy=" + updateBy + |
| | | "}"; |
| | | } |
| | | |
| | | /** |
| | | * 状态(1.待处理 2.预约成功 3.预约失败 4.已取消) |
| | | */ |
| | | public interface status{ |
| | | int dcl = 1; |
| | | int cg = 2; |
| | | int sb = 3; |
| | | int yqx = 4; |
| | | } |
| | | /** |
| | | * 类型(1.预约 2.登记) |
| | | */ |
| | | public interface type{ |
| | | int yy=1; |
| | | int dj=2; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.model.dos; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-08-23 10:34:03 |
| | | * @describe 预约登记题目选项实体类 |
| | | */ |
| | | |
| | | @Data |
| | | @TableName("com_act_reserve_sub") |
| | | public class ComActReserveSubDO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * id |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 预约登记id |
| | | */ |
| | | private Long reserveId; |
| | | |
| | | /** |
| | | * 序号 |
| | | */ |
| | | private Integer sort; |
| | | |
| | | /** |
| | | * 类型 0 单选 1 多选 2 输入框 2姓名输入框 3 手机号 4 身份证 5 文字描述 6 日期选择 |
| | | */ |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 问卷调查题目key |
| | | */ |
| | | @TableField("`key`") |
| | | private String key; |
| | | |
| | | /** |
| | | * 题目内容 |
| | | */ |
| | | private String content; |
| | | |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | private Long createBy; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private Date createAt; |
| | | |
| | | /** |
| | | * 更新人 |
| | | */ |
| | | private Long updateBy; |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | private Date updateAt; |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ComActReserveSubDO{" + |
| | | "id=" + id + |
| | | ", reserveId=" + reserveId + |
| | | ", sort=" + sort + |
| | | ", type=" + type + |
| | | ", key=" + key + |
| | | ", content=" + content + |
| | | ", createBy=" + createBy + |
| | | ", createAt=" + createAt + |
| | | ", updateBy=" + updateBy + |
| | | ", updateAt=" + updateAt + |
| | | "}"; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.model.dos; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-08-23 10:34:13 |
| | | * @describe 预约登记题目选项 实体类 |
| | | */ |
| | | |
| | | @Data |
| | | @TableName("com_act_reserve_sub_selection") |
| | | public class ComActReserveSubSelectionDO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * id |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 预约登记id |
| | | */ |
| | | private Long reserveId; |
| | | |
| | | /** |
| | | * 预约登记题目id |
| | | */ |
| | | private Long reserveSubId; |
| | | |
| | | /** |
| | | * 预约登记选项key |
| | | */ |
| | | @TableField("`key`") |
| | | private String key; |
| | | |
| | | /** |
| | | * 选项类型 0 固定选项 1 自定义选项 |
| | | */ |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 排序 |
| | | */ |
| | | private Integer sort; |
| | | |
| | | /** |
| | | * 选项名 |
| | | */ |
| | | private String optionName; |
| | | |
| | | /** |
| | | * 选项内容 |
| | | */ |
| | | private String content; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private Date createAt; |
| | | |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | private Long createBy; |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | private Date updateAt; |
| | | |
| | | /** |
| | | * 更新人 |
| | | */ |
| | | private Long updateBy; |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ComActReserveSubSelectionDO{" + |
| | | "id=" + id + |
| | | ", reserveId=" + reserveId + |
| | | ", reserveSubId=" + reserveSubId + |
| | | ", key=" + key + |
| | | ", type=" + type + |
| | | ", sort=" + sort + |
| | | ", optionName=" + optionName + |
| | | ", content=" + content + |
| | | ", createAt=" + createAt + |
| | | ", createBy=" + createBy + |
| | | ", updateAt=" + updateAt + |
| | | ", updateBy=" + updateBy + |
| | | "}"; |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @TableId(type = IdType.INPUT) |
| | | @TableId(value = "id",type = IdType.INPUT) |
| | | private Long id; |
| | | |
| | | /** |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActActEvaluateVO; |
| | | import com.panzhihua.service_community.model.dos.ComActActEvaluateDO; |
| | | /** |
| | | * title: ComActActEvaluateService 社区》活动》活动评价表服务类 |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * description: 社区》活动》活动评价表服务类 |
| | | * |
| | | * @author txb |
| | | * @date 2021/8/24 10:21 |
| | | */ |
| | | public interface ComActActEvaluateService extends IService<ComActActEvaluateDO> { |
| | | |
| | | /** |
| | | * 社区活动评价功能 |
| | | * |
| | | * @param comActActEvaluateVO 社区评价VO |
| | | * @return 评价结果 |
| | | */ |
| | | R activityEvaluate(ComActActEvaluateVO comActActEvaluateVO); |
| | | |
| | | /** |
| | | * 定时任务针对活动结束后7天还未评价的用户默认好评 |
| | | * @return 执行结果 |
| | | */ |
| | | R timedTaskActivityDefaultPraise(); |
| | | |
| | | /** |
| | | * 用户评价列表 |
| | | * |
| | | * @param userId 用户id |
| | | * @return 当前用户对所有活动的评价列表 |
| | | */ |
| | | R listEvaluate(Long userId); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.service_community.model.dos.ComActActPictureDO; |
| | | |
| | | /** |
| | | * title: ComActActPictureService 社区》活动》历史上传图片服务类 |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * description: 社区》活动》历史上传图片服务类 |
| | | * |
| | | * @author txb |
| | | * @date 2021/8/24 10:21 |
| | | */ |
| | | public interface ComActActPictureService extends IService<ComActActPictureDO> { |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.service_community.model.dos.ComActActRegistDO; |
| | | |
| | | /** |
| | | * title: ComActActRegistService 社区》活动》活动签到表服务类 |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * description: 社区》活动》活动签到表服务类 |
| | | * |
| | | * @author txb |
| | | * @date 2021/8/24 10:21 |
| | | */ |
| | | public interface ComActActRegistService extends IService<ComActActRegistDO> { |
| | | |
| | | } |
| | |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenActActivityListDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenActActivityPeopleListDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ActivitySignVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActivityVO; |
| | | import com.panzhihua.common.model.vos.community.SignactivityVO; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.service_community.model.dos.ComActActivityDO; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | |
| | | R listActivitySigns(ActivitySignVO activitySignVO); |
| | | |
| | | /** |
| | | * description getSignLists 查询活动报名名单 |
| | | * @param activitySignVO 查询参数 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/8/24 14:03 |
| | | */ |
| | | R getSignLists(ActivitySignVO activitySignVO); |
| | | |
| | | /** |
| | | * description listActivityRegists 分页查询活动评价 |
| | | * @param comActActEvaluateVO 活动评价vo |
| | | * @return R 分页查询结果 |
| | | * @author txb |
| | | * @date 2021/8/24 14:03 |
| | | */ |
| | | R pageActivityEvaluates(ComActActEvaluateVO comActActEvaluateVO); |
| | | |
| | | /** |
| | | * description getEvaluateLists 查询活动评价 |
| | | * @param comActActEvaluateVO 查询参数 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/8/24 14:03 |
| | | */ |
| | | R getEvaluateLists(ComActActEvaluateVO comActActEvaluateVO); |
| | | |
| | | /** |
| | | * description pageActivityRegists 分页查询活动签到 |
| | | * @param comActActRegistVO 活动签到vo |
| | | * @return R 分页查询结果 |
| | | * @author txb |
| | | * @date 2021/8/24 14:03 |
| | | */ |
| | | R pageActivityRegists(ComActActRegistVO comActActRegistVO); |
| | | |
| | | /** |
| | | * description getRegistLists 查询活动签到 |
| | | * @param comActActRegistVO 查询参数 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/8/25 9:33 |
| | | */ |
| | | R getRegistLists(ComActActRegistVO comActActRegistVO); |
| | | |
| | | /** |
| | | * description getRegistLists 查询活动未签到 |
| | | * @param comActActRegistVO 查询参数 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/8/25 9:33 |
| | | */ |
| | | R getNoRegistLists(ComActActRegistVO comActActRegistVO); |
| | | |
| | | /** |
| | | * description activityStagistics 活动数据统计 |
| | | * @param activityId 活动id |
| | | * @return R 统计结果 |
| | | * @author txb |
| | | * @date 2021/8/25 13:33 |
| | | */ |
| | | R activityStatistics(Long activityId); |
| | | |
| | | /** |
| | | * 获取活动历史封面 getPictureList |
| | | * @param userId 用户id |
| | | * @return R 统计结果 |
| | | * @author txb |
| | | * @date 2021/8/27 13:33 |
| | | */ |
| | | R getPictureList(Long userId); |
| | | |
| | | /** |
| | | * 分页展示我的所有活动 时间倒序排列 |
| | | * |
| | | * @param comActActivityVO |
| | |
| | | */ |
| | | R timedTaskActivityNotice(); |
| | | |
| | | /** |
| | | * 用户签到 |
| | | * |
| | | * @param comActActRegistVO 签到参数 |
| | | * @return 签到结果 |
| | | */ |
| | | R activitySignIn(ComActActRegistVO comActActRegistVO); |
| | | |
| | | /** |
| | | *用户签到记录列表 |
| | | * |
| | | * @param userId 用id |
| | | * @return 用户签到列表 |
| | | */ |
| | | R listSignInActivity(Long userId); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.community.reserve.PageReserveRegisterDetailedAdminDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.model.dos.ComActReserveAnswerContentDO; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-08-23 10:33:32 |
| | | * @describe 预约登记回答记录内容 服务类 |
| | | */ |
| | | public interface ComActReserveAnswerContentService extends IService<ComActReserveAnswerContentDO> { |
| | | |
| | | /** |
| | | * 导出登记明细数据 |
| | | * @param reserveId 登记id |
| | | * @return 登记明细数据 |
| | | */ |
| | | R exportRegisterAdmin(Long reserveId); |
| | | |
| | | /** |
| | | * 分页查询登记明细列表 |
| | | * @param detailedAdminDTO 请求参数 |
| | | * @return 登记明细列表 |
| | | */ |
| | | R registerDetailedListAdmin(PageReserveRegisterDetailedAdminDTO detailedAdminDTO); |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.community.OperationDetailDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.model.dos.ComActReserveOperationRecordDO; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-08-23 10:33:42 |
| | | * @describe 预约登记操作记录表服务类 |
| | | */ |
| | | public interface ComActReserveOperationRecordService extends IService<ComActReserveOperationRecordDO> { |
| | | |
| | | /** |
| | | * 添加预约登记操作记录 |
| | | * @param reserveId 预约登记id |
| | | * @param reserveRecordId 预约登记记录id |
| | | * @param userId 用户id |
| | | * @param type 类型(1.本人操作 2.社区操作) |
| | | * @param phone 操作人手机号 |
| | | * @param reserveContent 操作内容 |
| | | * @param remark 备注 |
| | | * @param status 状态(1.提交 2.预约成功 3.预约失败 4.取消) |
| | | * @param createBy 创建人 |
| | | * @param reserveTime 成功预约时间 |
| | | */ |
| | | void addReserveOperationRecord(Long reserveId, Long reserveRecordId, Long userId, Integer type |
| | | , String phone, String reserveContent,String remark,Integer status,Long createBy,Date reserveTime); |
| | | |
| | | |
| | | /** |
| | | * 多条件查询操作记录 |
| | | * @param operationDetailDTO |
| | | * @return |
| | | */ |
| | | R detailOperationRecord(OperationDetailDTO operationDetailDTO); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.community.reserve.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.dtos.community.CancelRecordDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.model.dos.ComActReserveRecordDO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-08-23 10:33:53 |
| | | * @describe 预约登记记录表服务类 |
| | | */ |
| | | public interface ComActReserveRecordService extends IService<ComActReserveRecordDO> { |
| | | R cancel(CancelRecordDTO comActReserveRecordDO); |
| | | |
| | | /** |
| | | * 社区后台-根据预约id查询预约明细 |
| | | * @param pageMakeDTO 请求参数 |
| | | * @return 预约明细 |
| | | */ |
| | | R pageMakeAdmin(PageReserveMakeAdminDTO pageMakeDTO); |
| | | |
| | | /** |
| | | * 根据预约记录id查询预约明细操作记录 |
| | | * @param reserveRecordId 预约记录id |
| | | * @return 预约明细操作记录 |
| | | */ |
| | | R detailMakeAdmin(Long reserveRecordId); |
| | | |
| | | /** |
| | | * 批量取消预约记录 |
| | | * @param reserveRecordDTO 请求参数 |
| | | * @return 取消结果 |
| | | */ |
| | | R makeCancelAdmin(CancelReserveRecordDTO reserveRecordDTO); |
| | | |
| | | /** |
| | | * 预约明细导出数据查询 |
| | | * @param pageMakeDTO 请求参数 |
| | | * @return 预约明细数据 |
| | | */ |
| | | R exportMakeAdmin(PageReserveMakeAdminDTO pageMakeDTO); |
| | | |
| | | /** |
| | | * 分页查询登记统计汇总 |
| | | * @param registerStatisticsDTO 请求参数 |
| | | * @return 登记统计汇总 |
| | | */ |
| | | R registerStatisticsAdmin(ComActReserveRegisterStatisticsDTO registerStatisticsDTO); |
| | | |
| | | /** |
| | | * 导出登记统计汇总 |
| | | * @param registerStatisticsDTO 请求参数 |
| | | * @return 登记统计汇总 |
| | | */ |
| | | R registerStatisticsExportAdmin(ComActReserveRegisterStatisticsDTO registerStatisticsDTO); |
| | | |
| | | /** |
| | | * 分页查询预约处理列表 |
| | | * @param pageMakeHandleDTO 请求参数 |
| | | * @return 预约处理列表 |
| | | */ |
| | | R pageMakeHandleAdmin(PageReserveMakeHandleAdminDTO pageMakeHandleDTO); |
| | | |
| | | /** |
| | | * 批量处理预约记录 |
| | | * @param makeHandleDTO 请求参数 |
| | | * @return 处理结果 |
| | | */ |
| | | R makeHandleAdmin(MakeHandleAdminDTO makeHandleDTO); |
| | | |
| | | /** |
| | | * 导出预约处理列表数据查询 |
| | | * @param pageMakeHandleDTO 请求参数 |
| | | * @return 预约处理列表 |
| | | */ |
| | | R exportMakeHandleAdmin(PageReserveMakeHandleAdminDTO pageMakeHandleDTO); |
| | | |
| | | R registerDetailedDetailAdmin(Long reserveRecordId); |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.community.reserve.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.dtos.community.PageUserReserveDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActReserveCommitVO; |
| | | import com.panzhihua.service_community.model.dos.ComActReserveDO; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-08-23 10:33:11 |
| | | * @describe 预约登记表服务类 |
| | | */ |
| | | public interface ComActReserveService extends IService<ComActReserveDO> { |
| | | /** |
| | | * 小程序提交预约登记 |
| | | * @param comActReserveCommitVO |
| | | * @return 预约登记结果 |
| | | */ |
| | | R commit(ComActReserveCommitVO comActReserveCommitVO); |
| | | |
| | | /** |
| | | * 小程序我的预约登记 |
| | | * @param pageUserReserveDTO |
| | | * @return 预约登记列表 |
| | | */ |
| | | R pageReserveList(PageUserReserveDTO pageUserReserveDTO); |
| | | |
| | | /** |
| | | * 社区后台-分页查询预约登记列表 |
| | | * @param pageReserveDTO 请求参数 |
| | | * @return 预约登记列表 |
| | | */ |
| | | R pageReserveAdmin(PageReserveAdminDTO pageReserveDTO); |
| | | |
| | | /** |
| | | * 社区后台-新增预约登记信息 |
| | | * @param addReserveDTO 请求参数 |
| | | * @return 新增结果 |
| | | */ |
| | | R addReserveAdmin(AddReserveAdminDTO addReserveDTO); |
| | | |
| | | /** |
| | | * 社区后台-编辑预约登记信息 |
| | | * @param editReserveDTO 请求参数 |
| | | * @return 新增结果 |
| | | */ |
| | | R editReserveAdmin(EditReserveAdminDTO editReserveDTO); |
| | | |
| | | /** |
| | | * 社区后台-修改预约登记状态 |
| | | * @param editReserveDTO 请求参数 |
| | | * @return 修改结果 |
| | | */ |
| | | R editReserveStatusAdmin(EditComActReserveStatusDTO editReserveDTO); |
| | | |
| | | /** |
| | | * 社区后台-继续预约登记 |
| | | * @param editReserveDTO 请求参数 |
| | | * @return 修改结果 |
| | | */ |
| | | R editReserveInfoAdmin(EditComActReserveInfoDTO editReserveDTO); |
| | | |
| | | /** |
| | | * 社区后台-根据预约登记id查询详情 |
| | | * @param reserveId 预约登记id |
| | | * @return 预约登记详情 |
| | | */ |
| | | R detailReserveAdmin(Long reserveId); |
| | | |
| | | /** |
| | | * 社区后台-根据社区id统计预约类数据 |
| | | * @param makeStatisticsDTO 请求参数 |
| | | * @return 统计预约类数据 |
| | | */ |
| | | R makeStatisticsAdmin(ComActReserveMakeStatisticsDTO makeStatisticsDTO); |
| | | |
| | | /** |
| | | * 社区后台-查询导出预约统计汇总数据 |
| | | * @param makeStatisticsDTO 请求参数 |
| | | * @return 统计预约类数据 |
| | | */ |
| | | R makeStatisticsExportAdmin(ComActReserveMakeStatisticsDTO makeStatisticsDTO); |
| | | |
| | | /** |
| | | * 删除预约登记信息 |
| | | * @param reserveId 预约登记id |
| | | * @return 删除结果 |
| | | */ |
| | | R deleteReserveAdmin(Long reserveId); |
| | | |
| | | /** |
| | | * 查询社区所有预约信息列表 |
| | | * @param communityId 社区id |
| | | * @return 预约信息列表 |
| | | */ |
| | | R listReserveAdmin(Long communityId); |
| | | |
| | | /** |
| | | * 小程序预约登记查询详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | R getById(Long id,Long userId,Long recordId,Integer isBack); |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.service_community.model.dos.ComActReserveSubSelectionDO; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-08-23 10:34:13 |
| | | * @describe 预约登记题目选项 服务类 |
| | | */ |
| | | public interface ComActReserveSubSelectionService extends IService<ComActReserveSubSelectionDO> { |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.model.dos.ComActReserveSubDO; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-08-23 10:34:03 |
| | | * @describe 预约登记题目选项服务类 |
| | | */ |
| | | public interface ComActReserveSubService extends IService<ComActReserveSubDO> { |
| | | |
| | | /** |
| | | * 查询预约登记题目列表 |
| | | * @param reserveId 预约登记id |
| | | * @return 约登记题目列表 |
| | | */ |
| | | R subjectListAdmin(Long reserveId); |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.apache.commons.lang3.time.DateUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActActEvaluateVO; |
| | | import com.panzhihua.service_community.dao.ComActActEvaluateDAO; |
| | | import com.panzhihua.service_community.dao.ComActActSignDAO; |
| | | import com.panzhihua.service_community.dao.ComActActivityDAO; |
| | | import com.panzhihua.service_community.model.dos.ComActActEvaluateDO; |
| | | import com.panzhihua.service_community.model.dos.ComActActSignDO; |
| | | import com.panzhihua.service_community.model.dos.ComActActivityDO; |
| | | import com.panzhihua.service_community.service.ComActActEvaluateService; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * title: ComActActEvaluateServiceImpl 社区》活动》活动评价表服务实现类 |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * description: 社区》活动》活动评价表服务实现类 |
| | | * |
| | | * @author txb |
| | | * @date 2021/8/24 10:21 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ComActActEvaluateServiceImpl extends ServiceImpl<ComActActEvaluateDAO, ComActActEvaluateDO> implements ComActActEvaluateService { |
| | | |
| | | @Resource |
| | | private ComActActivityDAO comActActivityDAO; |
| | | @Resource |
| | | private ComActActSignDAO comActActSignDAO; |
| | | /** |
| | | * 社区活动评价 |
| | | * |
| | | * @param comActActEvaluateVO 社区评价VO |
| | | * @return 评价结果 |
| | | */ |
| | | @Override |
| | | public R activityEvaluate(ComActActEvaluateVO comActActEvaluateVO) { |
| | | ComActActEvaluateDO comActActEvaluateDO = new ComActActEvaluateDO(); |
| | | BeanUtils.copyProperties(comActActEvaluateVO, comActActEvaluateDO); |
| | | int result = this.baseMapper.insert(comActActEvaluateDO); |
| | | if (result < 0) { |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 定时任务针对活动结束后7天还未评价的用户默认好评 |
| | | */ |
| | | @Override |
| | | public R timedTaskActivityDefaultPraise() { |
| | | //获取还未默认好评的活动 |
| | | List<ComActActivityDO> comActActivityDOS = comActActivityDAO.selectList(new QueryWrapper<ComActActivityDO>().lambda() |
| | | .eq(ComActActivityDO::getStatus, 5) |
| | | .eq(ComActActivityDO::getIsDefaultPraise, 0) |
| | | .le(ComActActivityDO::getEndAt, DateUtils.addDays(new Date(), 7))); |
| | | //获取报名记录 |
| | | if (!ObjectUtils.isEmpty(comActActivityDOS)) { |
| | | List<Long> activityIds = comActActivityDOS.stream().map(ComActActivityDO::getId).collect(Collectors.toList()); |
| | | List<ComActActSignDO> comActActSignDOS = comActActSignDAO.selectNeedEvaluateSignRecords(activityIds); |
| | | //批量插入好评 |
| | | if (!ObjectUtils.isEmpty(comActActSignDOS)) { |
| | | List<ComActActEvaluateDO> comActActEvaluateDOList = comActActSignDOS.stream().map(comActActSignDO -> { |
| | | ComActActEvaluateDO comActActEvaluateDO = new ComActActEvaluateDO(); |
| | | comActActEvaluateDO.setActivityId(comActActSignDO.getActivityId()); |
| | | comActActEvaluateDO.setIsVolunteer(comActActSignDO.getIsVolunteer()); |
| | | comActActEvaluateDO.setUserId(comActActSignDO.getUserId()); |
| | | comActActEvaluateDO.setCreateAt(new Date()); |
| | | comActActEvaluateDO.setStarLevel(5); |
| | | return comActActEvaluateDO; |
| | | }).collect(Collectors.toList()); |
| | | boolean result = this.saveBatch(comActActEvaluateDOList); |
| | | if (!result) { |
| | | return R.fail("批量插入评价失败"); |
| | | } |
| | | ComActActivityDO comActActivityDO = new ComActActivityDO(); |
| | | comActActivityDO.setIsDefaultPraise(1); |
| | | int updateResult = comActActivityDAO.update(comActActivityDO, new UpdateWrapper<ComActActivityDO>() |
| | | .lambda().in(ComActActivityDO::getId, activityIds)); |
| | | if (updateResult < 0) { |
| | | return R.fail("修改是否已默认评价状态失败"); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 用户评价列表 |
| | | * |
| | | * @param userId 用户id |
| | | * @return 当前用户对所有活动的评价列表 |
| | | */ |
| | | @Override |
| | | public R listEvaluate(Long userId) { |
| | | List<ComActActEvaluateDO> comActActEvaluateDOList = this.baseMapper.selectList(new QueryWrapper<ComActActEvaluateDO>() |
| | | .lambda().eq(ComActActEvaluateDO::getUserId, userId)); |
| | | ArrayList<ComActActEvaluateVO> comActActEvaluateVOS = new ArrayList<>(); |
| | | if (!ObjectUtils.isEmpty(comActActEvaluateDOList)) { |
| | | comActActEvaluateDOList.forEach(comActActEvaluateDO -> { |
| | | ComActActEvaluateVO comActActEvaluateVO = new ComActActEvaluateVO(); |
| | | BeanUtils.copyProperties(comActActEvaluateDO, comActActEvaluateVO); |
| | | comActActEvaluateVOS.add(comActActEvaluateVO); |
| | | }); |
| | | } |
| | | return R.ok(comActActEvaluateVOS); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.service_community.dao.ComActActPictureDAO; |
| | | import com.panzhihua.service_community.model.dos.ComActActPictureDO; |
| | | import com.panzhihua.service_community.service.ComActActPictureService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * title: ComActActPictureServiceImpl 社区》活动》历史上传图片服务实现类 |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * description: 社区》活动》历史上传图片服务实现类 |
| | | * |
| | | * @author txb |
| | | * @date 2021/8/24 10:21 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ComActActPictureServiceImpl extends ServiceImpl<ComActActPictureDAO, ComActActPictureDO> implements ComActActPictureService { |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.service_community.dao.ComActActRegistDAO; |
| | | import com.panzhihua.service_community.model.dos.ComActActRegistDO; |
| | | import com.panzhihua.service_community.service.ComActActRegistService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * title: ComActActRegistServiceImpl 社区》活动》活动签到表服务实现类 |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * description: 社区》活动》活动签到表服务实现类 |
| | | * |
| | | * @author txb |
| | | * @date 2021/8/24 10:21 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ComActActRegistServiceImpl extends ServiceImpl<ComActActRegistDAO, ComActActRegistDO> implements ComActActRegistService { |
| | | |
| | | } |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import java.text.DecimalFormat; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.model.vos.screen.ComActPopulationCultureVO; |
| | | import com.panzhihua.service_community.dao.*; |
| | | import com.panzhihua.service_community.model.dos.ComActActEvaluateDO; |
| | | import com.panzhihua.service_community.model.dos.ComActActPictureDO; |
| | | import org.apache.commons.lang3.time.DateUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.data.redis.core.ValueOperations; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | |
| | | import com.panzhihua.common.model.vos.IndexDataVO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.model.vos.community.screen.work.ActActivityListVO; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.utlis.WxUtil; |
| | | import com.panzhihua.common.utlis.WxXCXTempSend; |
| | | import com.panzhihua.service_community.dao.ComActActEvaluateDAO; |
| | | import com.panzhihua.service_community.dao.ComActActRegistDAO; |
| | | import com.panzhihua.service_community.dao.ComActActSignDAO; |
| | | import com.panzhihua.service_community.dao.ComActActivityDAO; |
| | | import com.panzhihua.service_community.model.dos.ComActActEvaluateDO; |
| | | import com.panzhihua.service_community.model.dos.ComActActRegistDO; |
| | | import com.panzhihua.service_community.model.dos.ComActActSignDO; |
| | | import com.panzhihua.service_community.model.dos.ComActActivityDO; |
| | | import com.panzhihua.service_community.service.ComActActivityService; |
| | |
| | | @Service |
| | | public class ComActActivityServiceImpl extends ServiceImpl<ComActActivityDAO, ComActActivityDO> |
| | | implements ComActActivityService { |
| | | private static final String DELIMITER = ":"; |
| | | private static final String ACTIVITY_SIGN_IN = "ACTIVITY:SIGN:IN"; |
| | | @Resource |
| | | private ComActActivityDAO comActActivityDAO; |
| | | @Resource |
| | | private ComActActSignDAO comActActSignDAO; |
| | | @Resource |
| | | private UserService userService; |
| | | @Resource |
| | | private ComActActEvaluateDAO comActActEvaluateDAO; |
| | | @Resource |
| | | private ComActActRegistDAO comActActRegistDAO; |
| | | @Resource |
| | | private StringRedisTemplate stringRedisTemplate; |
| | | @Resource |
| | | private ComActActPictureDAO comActActPictureDAO; |
| | | |
| | | /** |
| | | * 新增社区活动 |
| | |
| | | .eq(ComActActivityDO::getActivityName, comActActivityDO.getActivityName()) |
| | | .orderByDesc(ComActActivityDO::getCreateAt).last(" limit 1 ")); |
| | | Long activityId = one.getId(); |
| | | |
| | | //保存上传照片 |
| | | ComActActPictureDO comActActPictureDO = new ComActActPictureDO(); |
| | | comActActPictureDO.setActivityId(activityId); |
| | | comActActPictureDO.setUserId(comActActivityVO.getUserId()); |
| | | comActActPictureDO.setUploadPicture(comActActivityVO.getCover()); |
| | | comActActPictureDAO.insert(comActActPictureDO); |
| | | return R.ok(activityId); |
| | | } |
| | | |
| | |
| | | public R listActivitySigns(ActivitySignVO activitySignVO) { |
| | | List<ActivitySignVO> activitySignVOS = comActActSignDAO.listActivitySigns(activitySignVO); |
| | | return R.ok(activitySignVOS); |
| | | } |
| | | |
| | | @Override |
| | | public R getSignLists(ActivitySignVO activitySignVO) { |
| | | return R.ok(comActActSignDAO.getSignLists(activitySignVO)); |
| | | } |
| | | |
| | | @Override |
| | | public R pageActivityEvaluates(ComActActEvaluateVO comActActEvaluateVO) { |
| | | IPage<ComActActEvaluateVO> comActActEvaluateVOIPage = comActActEvaluateDAO |
| | | .pageActivityEvaluates(new Page(comActActEvaluateVO.getPageNum(), comActActEvaluateVO.getPageSize()), comActActEvaluateVO); |
| | | return R.ok(comActActEvaluateVOIPage); |
| | | } |
| | | |
| | | @Override |
| | | public R getEvaluateLists(ComActActEvaluateVO comActActEvaluateVO) { |
| | | return R.ok(comActActEvaluateDAO.getEvaluateLists(comActActEvaluateVO)); |
| | | } |
| | | |
| | | @Override |
| | | public R pageActivityRegists(ComActActRegistVO comActActRegistVO) { |
| | | IPage<ComActActRegistVO> comActActRegistVOIPage = comActActRegistDAO.pageActivityRegists(new Page(comActActRegistVO.getPageNum(), comActActRegistVO.getPageSize()), comActActRegistVO); |
| | | return R.ok(comActActRegistVOIPage); |
| | | } |
| | | |
| | | @Override |
| | | public R getRegistLists(ComActActRegistVO comActActRegistVO) { |
| | | return R.ok(comActActRegistDAO.getRegistLists(comActActRegistVO)); |
| | | } |
| | | |
| | | @Override |
| | | public R getNoRegistLists(ComActActRegistVO comActActRegistVO) { |
| | | return R.ok(comActActRegistDAO.getNoRegistLists(comActActRegistVO)); |
| | | } |
| | | |
| | | @Override |
| | | public R activityStatistics(Long activityId) { |
| | | ComActActivityStatisticsVO comActActivityStatisticsVO = comActActivityDAO.activityStatistics(activityId); |
| | | if (comActActivityStatisticsVO != null) { |
| | | if (comActActivityStatisticsVO.getSignTotal().equals(0)){ |
| | | comActActivityStatisticsVO.setSignTotalStr("不限"); |
| | | comActActivityStatisticsVO.setNoSignTotalStr(""); |
| | | comActActivityStatisticsVO.setSignPersent(""); |
| | | }else { |
| | | comActActivityStatisticsVO.setSignTotalStr(String.valueOf(comActActivityStatisticsVO.getSignTotal())); |
| | | comActActivityStatisticsVO.setNoSignTotalStr(String.valueOf(Integer.valueOf(comActActivityStatisticsVO.getSignTotalStr()) - comActActivityStatisticsVO.getReallySignTotal())); |
| | | comActActivityStatisticsVO.setSignPersent(getPersent(comActActivityStatisticsVO.getReallySignTotal(),comActActivityStatisticsVO.getSignTotal())); |
| | | } |
| | | comActActivityStatisticsVO.setRegistPersent(getPersent(comActActivityStatisticsVO.getReallyRegistTotal(),comActActivityStatisticsVO.getRegistTotal())); |
| | | comActActivityStatisticsVO.setEvaluatePersent(getPersent(comActActivityStatisticsVO.getReallyEvaluateTotal(),comActActivityStatisticsVO.getEvaluateTotal())); |
| | | } |
| | | return R.ok(comActActivityStatisticsVO); |
| | | } |
| | | |
| | | @Override |
| | | public R getPictureList(Long userId) { |
| | | List<ComActActPictureVO> comActActPictureVOS = new ArrayList<>(); |
| | | List<ComActActPictureDO> comActActPictureDOS = comActActPictureDAO.selectList(new QueryWrapper<ComActActPictureDO>().lambda(). |
| | | eq(ComActActPictureDO::getUserId, userId)); |
| | | if (comActActPictureDOS != null && comActActPictureDOS.size() != 0) { |
| | | comActActPictureDOS.forEach(comActActPictureDO -> { |
| | | ComActActPictureVO comActActPictureVO = new ComActActPictureVO(); |
| | | BeanUtils.copyProperties(comActActPictureDO, comActActPictureVO); |
| | | comActActPictureVOS.add(comActActPictureVO); |
| | | }); |
| | | } |
| | | return R.ok(comActActPictureVOS); |
| | | } |
| | | |
| | | /** |
| | |
| | | page.setSize(pageSize); |
| | | page.setCurrent(pageNum); |
| | | IPage<ComActActivityVO> iPage = comActActivityDAO.pageActivityCommunityBack(page, comActActivityVO); |
| | | iPage.getRecords().forEach(vo ->{ |
| | | List<ComActActEvaluateDO> comActActEvaluateDOList = comActActEvaluateDAO |
| | | .selectList(new QueryWrapper<ComActActEvaluateDO>().lambda().eq(ComActActEvaluateDO::getActivityId, vo.getId())); |
| | | if (comActActEvaluateDOList != null && comActActEvaluateDOList.size() != 0) { |
| | | //总星级 |
| | | int starNum = comActActEvaluateDOList.stream().mapToInt(ComActActEvaluateDO::getStarLevel).sum(); |
| | | //评分星级=总星级/总评价人数 |
| | | vo.setEvaluateLevel(Double.valueOf(starNum/comActActEvaluateDOList.size())); |
| | | } |
| | | }); |
| | | return R.ok(iPage); |
| | | } |
| | | |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | private String getPersent(int x, int y){ |
| | | if (y == 0) { |
| | | return ""; |
| | | } |
| | | if (x == 0) { |
| | | return "0.00%"; |
| | | } |
| | | double d1 = x * 1.0; |
| | | double d2 = y * 1.0; |
| | | DecimalFormat decimalFormat = new DecimalFormat("##.00%"); |
| | | return decimalFormat.format(d1 / d2); |
| | | } |
| | | |
| | | /** |
| | | * 用户签到 |
| | | * |
| | | * @param comActActRegistVO 签到参数 |
| | | * @return 签到结果 |
| | | */ |
| | | @Override |
| | | public R activitySignIn(ComActActRegistVO comActActRegistVO) { |
| | | Long activityId = comActActRegistVO.getActivityId(); |
| | | Long userId = comActActRegistVO.getUserId(); |
| | | String activitySignInKey = String.join(DELIMITER, ACTIVITY_SIGN_IN, userId.toString(), activityId.toString()); |
| | | if (stringRedisTemplate.hasKey(activitySignInKey)) { |
| | | return R.fail("你已签到,如要再次签到请三十分钟后尝试!"); |
| | | } |
| | | ComActActRegistDO comActActRegistDO = new ComActActRegistDO(); |
| | | comActActRegistDO.setActivityId(activityId); |
| | | comActActRegistDO.setUserId(userId); |
| | | comActActRegistDO.setIsVolunteer(comActActRegistVO.getIsVolunteer()); |
| | | comActActRegistDO.setCreateAt(new Date()); |
| | | int result = comActActRegistDAO.insert(comActActRegistDO); |
| | | if (result > 0) { |
| | | ValueOperations<String, String> opsForValue = stringRedisTemplate.opsForValue(); |
| | | opsForValue.set(activitySignInKey, "", 1800L, TimeUnit.SECONDS); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | *用户签到记录列表 |
| | | * |
| | | * @param userId 用id |
| | | * @return 用户签到列表 |
| | | */ |
| | | @Override |
| | | public R listSignInActivity(Long userId) { |
| | | List<ComActActRegistDO> comActActRegistDOS = comActActRegistDAO.selectList(new QueryWrapper<ComActActRegistDO>() |
| | | .lambda().eq(ComActActRegistDO::getUserId, userId)); |
| | | ArrayList<ComActActRegistVO> comActActRegistVOS = new ArrayList<>(); |
| | | comActActRegistDOS.forEach(comActActRegistDO -> { |
| | | ComActActRegistVO comActActRegistVO = new ComActActRegistVO(); |
| | | BeanUtils.copyProperties(comActActRegistDO, comActActRegistVO); |
| | | comActActRegistVOS.add(comActActRegistVO); |
| | | }); |
| | | return R.ok(comActActRegistVOS); |
| | | } |
| | | } |
| | |
| | | .collect(Collectors.toList()); |
| | | if (!ObjectUtils.isEmpty(collect)) { |
| | | String userName = collect.get(0).getUserName(); |
| | | String userNickName = collect.get(0).getUserNickName(); |
| | | comActDiscussCommentVO1.setUserNameBack(userName); |
| | | comActDiscussCommentVO1.setUserNickNameBack(userNickName); |
| | | } |
| | | List<ComActDiscussCommentVO> collect1 = records.stream() |
| | | .filter(comActDiscussCommentVO2 -> comActDiscussCommentVO2.getId().equals(parentId)) |
| | |
| | | private ComActEasyPhotoFeedbackMapper comActEasyPhotoFeedbackMapper; |
| | | @Resource |
| | | private ComActQuestnaireDAO comActQuestnaireDAO; |
| | | @Resource |
| | | private ComActReserveMapper comActReserveMapper; |
| | | @Resource |
| | | private ComActActivityDAO comActActivityDAO; |
| | | |
| | | /** |
| | | * 分页查询随手拍 |
| | |
| | | cmActEasyPhotoDO.setTransferTime(nowDate); |
| | | } else { |
| | | cmActEasyPhotoDO.setIsReportUrban(ComActEasyPhotoVO.isReportUrban.no); |
| | | cmActEasyPhotoDO.setHandlerId(comActEasyPhotoVO.getHandlerId()); |
| | | } |
| | | cmActEasyPhotoDO.setHandlerId(comActEasyPhotoVO.getHandlerId()); |
| | | cmActEasyPhotoDO.setExamineAt(nowDate); |
| | | cmActEasyPhotoDO.setActivityType(comActEasyPhotoVO.getActivityType()); |
| | | if (StringUtils.isNotEmpty(comActEasyPhotoVO.getHandleResult()) |
| | |
| | | cmActEasyPhotoDO.setFeedbackAt(nowDate); |
| | | cmActEasyPhotoDO.setStatus(ComActEasyPhotoDO.status.ywc); |
| | | cmActEasyPhotoDO.setCompleteId(comActEasyPhotoVO.getUserId()); |
| | | if(comActEasyPhotoVO.getUrbanStatus()!=null&&comActEasyPhotoVO.getUrbanStatus()==2){ |
| | | cmActEasyPhotoDO.setUrbanStatus(2); |
| | | } |
| | | break; |
| | | default: |
| | | break; |
| | |
| | | easyPhotoRewardVO.setBannerQuestnaireList(bannerQuestnaireList); |
| | | } |
| | | |
| | | //查询社区正在进行中的banner位置的社区活动 |
| | | List<ComActActivityVO> comActActivityVOList = comActActivityDAO.getIndexTopActivityList(communityId); |
| | | if (!comActActivityVOList.isEmpty()) { |
| | | easyPhotoRewardVO.setBannerActivityList(comActActivityVOList); |
| | | } |
| | | |
| | | // 查询社区正在进行中的应用位置调查问卷列表 |
| | | List<ComActQuestnaireAppVO> applicationQuestnaireList = |
| | | comActQuestnaireDAO.getIndexApplicationQuestnaireList(communityId); |
| | | if (!applicationQuestnaireList.isEmpty()) { |
| | | easyPhotoRewardVO.setApplicationQuestnaireList(applicationQuestnaireList); |
| | | } |
| | | |
| | | //查询社区正在进行中的banner预约/登记列表 |
| | | List<ComActReserveIndexVo> comActReserveIndexVos=comActReserveMapper.indexBanner(communityId); |
| | | if(!comActReserveIndexVos.isEmpty()){ |
| | | easyPhotoRewardVO.setComActReserveIndexBannerVos(comActReserveIndexVos); |
| | | } |
| | | //查询社区正在进行中的应用预约/登记列表 |
| | | List<ComActReserveIndexVo> comActReserveIndexApplicationVos=comActReserveMapper.indexApplication(communityId); |
| | | if(!comActReserveIndexApplicationVos.isEmpty()){ |
| | | easyPhotoRewardVO.setComActReserveIndexApplicationVos(comActReserveIndexApplicationVos); |
| | | } |
| | | return R.ok(easyPhotoRewardVO); |
| | | } |
| | | |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.community.QuestnaireAnswersDTO; |
| | | import com.panzhihua.common.model.dtos.community.reserve.PageReserveRegisterDetailedAdminDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActQuestnaireAnswerContentVO; |
| | | import com.panzhihua.common.model.vos.community.ComActQuestnaireSubVO; |
| | | import com.panzhihua.common.model.vos.community.reserve.ComActReserveRecordListVO; |
| | | import com.panzhihua.common.model.vos.community.reserve.ComActReserveRegisterDetailedAnswerVO; |
| | | import com.panzhihua.common.model.vos.community.reserve.ComActReserveRegisterDetailedVO; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.service_community.dao.ComActReserveAnswerContentMapper; |
| | | import com.panzhihua.service_community.dao.ComActReserveSubMapper; |
| | | import com.panzhihua.service_community.model.dos.ComActQuestnaireAnswerContentDO; |
| | | import com.panzhihua.service_community.model.dos.ComActQuestnaireSubDO; |
| | | import com.panzhihua.service_community.model.dos.ComActReserveAnswerContentDO; |
| | | import com.panzhihua.service_community.model.dos.ComActReserveSubDO; |
| | | import com.panzhihua.service_community.service.ComActReserveAnswerContentService; |
| | | import com.panzhihua.service_community.service.ComActReserveSubService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-08-23 10:33:32 |
| | | * @describe 预约登记回答记录内容 服务实现类 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ComActReserveAnswerContentServiceImpl extends ServiceImpl<ComActReserveAnswerContentMapper, ComActReserveAnswerContentDO> implements ComActReserveAnswerContentService { |
| | | |
| | | @Resource |
| | | private ComActReserveSubMapper comActReserveSubMapper; |
| | | |
| | | /** |
| | | * 导出登记明细数据 |
| | | * @param reserveId 登记id |
| | | * @return 登记明细数据 |
| | | */ |
| | | @Override |
| | | public R exportRegisterAdmin(Long reserveId){ |
| | | QuestnaireAnswersDTO result = new QuestnaireAnswersDTO(); |
| | | |
| | | //查询题目 |
| | | List<ComActReserveSubDO> list = comActReserveSubMapper.selectList(new QueryWrapper<ComActReserveSubDO>().lambda().eq(ComActReserveSubDO::getReserveId, reserveId)); |
| | | List<ComActQuestnaireSubVO> listSubVo = new ArrayList<>(); |
| | | list.forEach(subDo -> { |
| | | ComActQuestnaireSubVO comActQuestnaireSubVO = new ComActQuestnaireSubVO(); |
| | | BeanUtils.copyProperties(subDo, comActQuestnaireSubVO); |
| | | listSubVo.add(comActQuestnaireSubVO); |
| | | }); |
| | | result.setSubs(listSubVo); |
| | | |
| | | Long reserveRecordId = null; |
| | | //查询用户回答 |
| | | List<ComActReserveAnswerContentDO> questnaireAnswerContentDOList = this.baseMapper.selectListByReserve(reserveId); |
| | | List<ComActQuestnaireAnswerContentVO> vos = new ArrayList<>(); |
| | | for (ComActReserveAnswerContentDO dos:questnaireAnswerContentDOList) { |
| | | ComActQuestnaireAnswerContentVO vo = new ComActQuestnaireAnswerContentVO(); |
| | | BeanUtils.copyProperties(dos, vo); |
| | | reserveRecordId = dos.getReserveRecordId(); |
| | | vos.add(vo); |
| | | } |
| | | result.setAnswers(vos); |
| | | |
| | | //查询用户提交信息 |
| | | ComActReserveRegisterDetailedVO recordListVO = this.baseMapper.getRegisterDetailedById(reserveRecordId); |
| | | if(recordListVO != null){ |
| | | result.setRecordListVO(recordListVO); |
| | | } |
| | | return R.ok(result); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询登记明细列表 |
| | | * @param detailedAdminDTO 请求参数 |
| | | * @return 登记明细列表 |
| | | */ |
| | | @Override |
| | | public R registerDetailedListAdmin(PageReserveRegisterDetailedAdminDTO detailedAdminDTO){ |
| | | IPage<HashMap<String,Object>> resultPage = new Page<>(); |
| | | |
| | | IPage<ComActReserveRegisterDetailedVO> registerDetailedPage = this.baseMapper.pageRegisterDetailedListAdmin(new Page(detailedAdminDTO.getPageNum(),detailedAdminDTO.getPageSize()),detailedAdminDTO); |
| | | resultPage.setCurrent(registerDetailedPage.getCurrent()); |
| | | resultPage.setTotal(registerDetailedPage.getTotal()); |
| | | resultPage.setSize(registerDetailedPage.getSize()); |
| | | resultPage.setPages(registerDetailedPage.getPages()); |
| | | |
| | | List<HashMap<String,Object>> resultMapList = new ArrayList<>(); |
| | | Integer nub = 1; |
| | | if(!registerDetailedPage.getRecords().isEmpty()){ |
| | | for (ComActReserveRegisterDetailedVO registerDetailed:registerDetailedPage.getRecords()) { |
| | | //渲染序号 |
| | | HashMap<String,Object> map = new HashMap<>(); |
| | | map.put("nub",nub); |
| | | //渲染用户昵称 |
| | | map.put("nickName",registerDetailed.getNickName()); |
| | | //查询记录填写答案并装载到数据集中 |
| | | List<ComActReserveRegisterDetailedAnswerVO> registerDetailedAnswerList = this.baseMapper.getRegisterDetailedAnswerList(registerDetailed.getId()); |
| | | if(!registerDetailedAnswerList.isEmpty()){ |
| | | for (ComActReserveRegisterDetailedAnswerVO detailed:registerDetailedAnswerList) { |
| | | map.put(detailed.getReserveSubId() + "",detailed.getAnswerContent()); |
| | | } |
| | | } |
| | | //渲染登记流水号 |
| | | map.put("id",registerDetailed.getId()); |
| | | //渲染登记时间 |
| | | map.put("time", DateUtils.format(registerDetailed.getCreateAt(),DateUtils.ymdhms_format)); |
| | | resultMapList.add(map); |
| | | nub++; |
| | | } |
| | | } |
| | | resultPage.setRecords(resultMapList); |
| | | return R.ok(resultPage); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.community.OperationDetailDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.reserve.ComOperationDetailVO; |
| | | import com.panzhihua.common.model.vos.community.reserve.ComOperationListVO; |
| | | import com.panzhihua.service_community.dao.ComActReserveMapper; |
| | | import com.panzhihua.service_community.dao.ComActReserveOperationRecordMapper; |
| | | import com.panzhihua.service_community.dao.ComActReserveRecordMapper; |
| | | import com.panzhihua.service_community.model.dos.ComActReserveDO; |
| | | import com.panzhihua.service_community.model.dos.ComActReserveOperationRecordDO; |
| | | import com.panzhihua.service_community.model.dos.ComActReserveRecordDO; |
| | | import com.panzhihua.service_community.service.ComActReserveOperationRecordService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-08-23 10:33:42 |
| | | * @describe 预约登记操作记录表服务实现类 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ComActReserveOperationRecordServiceImpl extends ServiceImpl<ComActReserveOperationRecordMapper, ComActReserveOperationRecordDO> implements ComActReserveOperationRecordService { |
| | | @Resource |
| | | private ComActReserveMapper comActReserveMapper; |
| | | @Resource |
| | | private ComActReserveRecordMapper comActReserveRecordMapper; |
| | | /** |
| | | * 添加预约登记操作记录 |
| | | * @param reserveId 预约登记id |
| | | * @param reserveRecordId 预约登记记录id |
| | | * @param userId 用户id |
| | | * @param type 类型(1.本人操作 2.社区操作) |
| | | * @param phone 操作人手机号 |
| | | * @param reserveContent 操作内容 |
| | | * @param remark 备注 |
| | | * @param status 状态(1.提交 2.预约成功 3.预约失败 4.取消) |
| | | * @param createBy 创建人 |
| | | * @param reserveTime 预约成功时间 |
| | | */ |
| | | @Override |
| | | public void addReserveOperationRecord(Long reserveId, Long reserveRecordId, Long userId, Integer type |
| | | , String phone, String reserveContent,String remark,Integer status,Long createBy,Date reserveTime){ |
| | | Date nowDate = new Date(); |
| | | ComActReserveOperationRecordDO operationRecordDO = new ComActReserveOperationRecordDO(); |
| | | operationRecordDO.setReserveId(reserveId); |
| | | operationRecordDO.setReserveRecordId(reserveRecordId); |
| | | operationRecordDO.setUserId(userId); |
| | | operationRecordDO.setType(type); |
| | | operationRecordDO.setPhone(phone); |
| | | operationRecordDO.setReserveContent(reserveContent); |
| | | operationRecordDO.setRemark(remark); |
| | | operationRecordDO.setStatus(status); |
| | | operationRecordDO.setCreateBy(createBy); |
| | | operationRecordDO.setCreateAt(nowDate); |
| | | operationRecordDO.setReserveTime(reserveTime); |
| | | this.baseMapper.insert(operationRecordDO); |
| | | } |
| | | |
| | | @Override |
| | | public R detailOperationRecord(OperationDetailDTO comActReserveOperationRecordDO) { |
| | | if(comActReserveOperationRecordDO!=null){ |
| | | ComOperationDetailVO comOperationDetailVO=new ComOperationDetailVO(); |
| | | List<ComOperationListVO> comOperationListVOS=comActReserveRecordMapper.queryAll(comActReserveOperationRecordDO); |
| | | if(!comOperationListVOS.isEmpty()){ |
| | | comOperationDetailVO.setList(comOperationListVOS); |
| | | ComActReserveRecordDO comActReserveRecordDO= comActReserveRecordMapper.selectById(comActReserveOperationRecordDO.getReserveRecordId()); |
| | | if(comActReserveRecordDO.getStatus()==ComActReserveRecordDO.status.yqx||comActReserveRecordDO.getStatus()==ComActReserveRecordDO.status.sb){ |
| | | ComActReserveDO com=comActReserveMapper.selectById(comOperationListVOS.get(0).getReserveId()); |
| | | if(com!=null&&com.getStatus()==ComActReserveDO.status.jxz){ |
| | | comOperationDetailVO.setIsContinue(1); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return R.ok(comOperationDetailVO); |
| | | } |
| | | return R.fail("未查询到数据"); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.community.reserve.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.reserve.*; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.service_community.dao.ComActReserveAnswerContentMapper; |
| | | import com.panzhihua.service_community.dao.ComActReserveOperationRecordMapper; |
| | | import com.panzhihua.common.model.dtos.community.CancelRecordDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.dao.ComActReserveOperationRecordMapper; |
| | | import com.panzhihua.service_community.dao.ComActReserveRecordMapper; |
| | | import com.panzhihua.service_community.model.dos.ComActReserveOperationRecordDO; |
| | | import com.panzhihua.service_community.model.dos.ComActReserveRecordDO; |
| | | import com.panzhihua.service_community.service.ComActReserveOperationRecordService; |
| | | import com.panzhihua.service_community.service.ComActReserveRecordService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-08-23 10:33:53 |
| | | * @describe 预约登记记录表服务实现类 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ComActReserveRecordServiceImpl extends ServiceImpl<ComActReserveRecordMapper, ComActReserveRecordDO> implements ComActReserveRecordService { |
| | | @Resource |
| | | private ComActReserveRecordMapper comActReserveRecordMapper; |
| | | @Resource |
| | | private ComActReserveAnswerContentMapper comActReserveAnswerContentMapper; |
| | | @Resource |
| | | private ComActReserveOperationRecordMapper comActReserveOperationRecordMapper; |
| | | @Resource |
| | | private ComActReserveOperationRecordService comActReserveOperationRecordService; |
| | | |
| | | private final static String CANCEL="用户取消"; |
| | | @Override |
| | | @Transactional |
| | | public R cancel(CancelRecordDTO comActReserveRecord) { |
| | | if(comActReserveRecord!=null&&comActReserveRecord.getId()!=null){ |
| | | //查询当前操作数据并判断取消状态 |
| | | ComActReserveRecordDO comActReserveRecordDO=comActReserveRecordMapper.selectById(comActReserveRecord.getId()); |
| | | if(comActReserveRecordDO!=null&&comActReserveRecordDO.getStatus()!=ComActReserveRecordDO.status.yqx){ |
| | | comActReserveRecordDO.setStatus(ComActReserveRecordDO.status.yqx); |
| | | comActReserveRecordDO.setRemark(comActReserveRecord.getContent()); |
| | | comActReserveRecordDO.setReserveTime(DateUtil.date()); |
| | | int result =comActReserveRecordMapper.updateById(comActReserveRecordDO); |
| | | //判断取消状态并添加操作记录 |
| | | if(result>0){ |
| | | ComActReserveOperationRecordDO comActReserveOperationRecordDO=new ComActReserveOperationRecordDO(); |
| | | comActReserveOperationRecordDO.setReserveId(comActReserveRecordDO.getReserveId()); |
| | | comActReserveOperationRecordDO.setReserveRecordId(comActReserveRecordDO.getId()); |
| | | comActReserveOperationRecordDO.setType(ComActReserveOperationRecordDO.type.br); |
| | | comActReserveOperationRecordDO.setCreateAt(DateUtil.date()); |
| | | comActReserveOperationRecordDO.setReserveContent(CANCEL); |
| | | comActReserveOperationRecordDO.setPhone(comActReserveRecordDO.getPhone()); |
| | | comActReserveOperationRecordDO.setStatus(ComActReserveOperationRecordDO.status.qx); |
| | | comActReserveOperationRecordDO.setUserId(comActReserveRecordDO.getUserId()); |
| | | comActReserveOperationRecordDO.setReserveTime(DateUtil.date()); |
| | | comActReserveOperationRecordMapper.insert(comActReserveOperationRecordDO); |
| | | return R.ok(); |
| | | } |
| | | } |
| | | return R.fail("无法重复取消"); |
| | | } |
| | | |
| | | return R.fail("参数异常"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 社区后台-根据预约id查询预约明细 |
| | | * @param pageMakeDTO 请求参数 |
| | | * @return 预约明细 |
| | | */ |
| | | @Override |
| | | public R pageMakeAdmin(PageReserveMakeAdminDTO pageMakeDTO){ |
| | | return R.ok(this.baseMapper.pageMakeAdmin(new Page(pageMakeDTO.getPageNum(),pageMakeDTO.getPageSize()),pageMakeDTO)); |
| | | } |
| | | |
| | | /** |
| | | * 根据预约记录id查询预约明细操作记录 |
| | | * @param reserveRecordId 预约记录id |
| | | * @return 预约明细操作记录 |
| | | */ |
| | | @Override |
| | | public R detailMakeAdmin(Long reserveRecordId){ |
| | | ComActReserveMakeDetailAdminVO makeDetailAdminVO = this.baseMapper.getMakeDetailAdmin(reserveRecordId); |
| | | if(makeDetailAdminVO != null){ |
| | | //查询预约明细操作记录 |
| | | List<ComActReserveMakeOperationAdminVO> makeOperationList = comActReserveOperationRecordMapper.getMakeOperationList(reserveRecordId); |
| | | makeDetailAdminVO.setOperationList(makeOperationList); |
| | | } |
| | | return R.ok(makeDetailAdminVO); |
| | | } |
| | | |
| | | /** |
| | | * 批量取消预约记录 |
| | | * @param reserveRecordDTO 请求参数 |
| | | * @return 取消结果 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R makeCancelAdmin(CancelReserveRecordDTO reserveRecordDTO){ |
| | | Integer count = this.baseMapper.getReserveStatusById(reserveRecordDTO.getIds()); |
| | | if(count > 0){ |
| | | return R.ok("您选择的记录中存在未预约成功,不可进行批量取消"); |
| | | } |
| | | if(this.baseMapper.editReserveStatusById(reserveRecordDTO.getIds()) > 0){ |
| | | Long userId = reserveRecordDTO.getUserId(); |
| | | reserveRecordDTO.getIds().forEach(id -> { |
| | | ComActReserveRecordDO reserveRecordDO = comActReserveRecordMapper.selectById(id); |
| | | if(reserveRecordDO != null){ |
| | | //添加操作记录 |
| | | comActReserveOperationRecordService.addReserveOperationRecord(reserveRecordDO.getReserveId() |
| | | ,reserveRecordDO.getId(),reserveRecordDO.getUserId(),ComActReserveOperationRecordDO.type.sq,null |
| | | ,"社区管理员取消预约",reserveRecordDTO.getRemark(),ComActReserveOperationRecordDO.status.qx,userId,null); |
| | | } |
| | | }); |
| | | return R.ok(); |
| | | }else{ |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 预约明细导出数据查询 |
| | | * @param pageMakeDTO 请求参数 |
| | | * @return 预约明细数据 |
| | | */ |
| | | @Override |
| | | public R exportMakeAdmin(PageReserveMakeAdminDTO pageMakeDTO){ |
| | | return R.ok(this.baseMapper.exportMakeAdmin(pageMakeDTO)); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询登记统计汇总 |
| | | * @param registerStatisticsDTO 请求参数 |
| | | * @return 登记统计汇总 |
| | | */ |
| | | @Override |
| | | public R registerStatisticsAdmin(ComActReserveRegisterStatisticsDTO registerStatisticsDTO){ |
| | | IPage<ComActReserveRegisterStatisticsAdminVO> registerStatisticsList = this.baseMapper.registerStatisticsAdmin(new Page(registerStatisticsDTO.getPageNum() |
| | | ,registerStatisticsDTO.getPageSize()),registerStatisticsDTO); |
| | | registerStatisticsList.getRecords().forEach(registerStatistics -> { |
| | | BigDecimal tag = BigDecimal.ZERO; |
| | | if(registerStatistics.getAllCount() > 0){ |
| | | tag = BigDecimal.valueOf(registerStatistics.getCount()).divide(BigDecimal.valueOf(registerStatistics.getAllCount()),4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | } |
| | | registerStatistics.setTag(tag); |
| | | }); |
| | | return R.ok(registerStatisticsList.getRecords()); |
| | | } |
| | | |
| | | /** |
| | | * 导出登记统计汇总 |
| | | * @param registerStatisticsDTO 请求参数 |
| | | * @return 登记统计汇总 |
| | | */ |
| | | @Override |
| | | public R registerStatisticsExportAdmin(ComActReserveRegisterStatisticsDTO registerStatisticsDTO){ |
| | | List<ComActReserveRegisterStatisticsAdminVO> registerStatisticsList = this.baseMapper.registerStatisticsExportAdmin(registerStatisticsDTO); |
| | | registerStatisticsList.forEach(registerStatistics -> { |
| | | BigDecimal tag = BigDecimal.ZERO; |
| | | if(registerStatistics.getAllCount() > 0){ |
| | | tag = BigDecimal.valueOf(registerStatistics.getCount()).divide(BigDecimal.valueOf(registerStatistics.getAllCount()),4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | } |
| | | registerStatistics.setTag(tag); |
| | | }); |
| | | return R.ok(registerStatisticsList); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询预约处理列表 |
| | | * @param pageMakeHandleDTO 请求参数 |
| | | * @return 预约处理列表 |
| | | */ |
| | | @Override |
| | | public R pageMakeHandleAdmin(PageReserveMakeHandleAdminDTO pageMakeHandleDTO){ |
| | | return R.ok(this.baseMapper.pageMakeHandleAdmin(new Page(pageMakeHandleDTO.getPageNum(),pageMakeHandleDTO.getPageSize()),pageMakeHandleDTO)); |
| | | } |
| | | |
| | | /** |
| | | * 批量处理预约记录 |
| | | * @param makeHandleDTO 请求参数 |
| | | * @return 处理结果 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R makeHandleAdmin(MakeHandleAdminDTO makeHandleDTO){ |
| | | if(makeHandleDTO.getIds() == null || makeHandleDTO.getIds().isEmpty()){ |
| | | return R.fail("请勾选预约记录"); |
| | | } |
| | | //判断选中的所有记录是否都是待处理记录 |
| | | if(this.baseMapper.getReserveListCountByIds(makeHandleDTO.getIds()) > 0){ |
| | | return R.fail("您勾选的记录中存在不是待处理状态的记录,请核对后再进行处理"); |
| | | } |
| | | Date nowDate = new Date(); |
| | | Long userId = makeHandleDTO.getUserId(); |
| | | String remark = makeHandleDTO.getRemark(); |
| | | List<ComActReserveRecordDO> updateList = new ArrayList<>(); |
| | | makeHandleDTO.getIds().forEach(id -> { |
| | | ComActReserveRecordDO reserveRecordDO = this.baseMapper.selectById(id); |
| | | if(reserveRecordDO != null){ |
| | | Date reserveTime = DateUtils.stringToDate(makeHandleDTO.getMakeTime(),DateUtils.ymdhms_format); |
| | | //判断处理是否通过 |
| | | if(makeHandleDTO.getIsOk().equals(MakeHandleAdminDTO.isOk.yes)){ |
| | | reserveRecordDO.setStatus(ComActReserveRecordDO.status.cg); |
| | | comActReserveOperationRecordService.addReserveOperationRecord(reserveRecordDO.getReserveId() |
| | | ,id,reserveRecordDO.getUserId(),ComActReserveOperationRecordDO.type.sq,null |
| | | ,"社区管理员处理预约成功",remark,ComActReserveOperationRecordDO.status.cg,userId,reserveTime); |
| | | }else if(makeHandleDTO.getIsOk().equals(MakeHandleAdminDTO.isOk.no)){ |
| | | reserveRecordDO.setStatus(ComActReserveRecordDO.status.sb); |
| | | comActReserveOperationRecordService.addReserveOperationRecord(reserveRecordDO.getReserveId() |
| | | ,id,reserveRecordDO.getUserId(),ComActReserveOperationRecordDO.type.sq,null |
| | | ,"社区管理员处理预约失败",remark,ComActReserveOperationRecordDO.status.sb,userId,null); |
| | | } |
| | | reserveRecordDO.setActRemark(remark); |
| | | reserveRecordDO.setReserveTime(reserveTime); |
| | | reserveRecordDO.setUpdateAt(nowDate); |
| | | reserveRecordDO.setUpdateBy(userId); |
| | | updateList.add(reserveRecordDO); |
| | | } |
| | | }); |
| | | |
| | | if(!updateList.isEmpty()){ |
| | | this.updateBatchById(updateList); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 导出预约处理列表数据查询 |
| | | * @param pageMakeHandleDTO 请求参数 |
| | | * @return 预约处理列表 |
| | | */ |
| | | @Override |
| | | public R exportMakeHandleAdmin(PageReserveMakeHandleAdminDTO pageMakeHandleDTO){ |
| | | return R.ok(this.baseMapper.exportMakeHandleAdmin(pageMakeHandleDTO)); |
| | | } |
| | | |
| | | @Override |
| | | public R registerDetailedDetailAdmin(Long reserveRecordId){ |
| | | //查询用户信息 |
| | | ComActReserveRegisterDetailedVO registerDetailedVO = this.baseMapper.getRegisterDetailedByRecordId(reserveRecordId); |
| | | if(registerDetailedVO != null){ |
| | | //组装用户身份信息 |
| | | StringBuilder sb = new StringBuilder(); |
| | | if(registerDetailedVO.getIsPartymember().equals(1)){ |
| | | sb.append("党员/"); |
| | | } |
| | | if(registerDetailedVO.getIsVolunteer().equals(1)){ |
| | | sb.append("志愿者/"); |
| | | } |
| | | if(sb.length() == 0){ |
| | | sb.append("居民/"); |
| | | } |
| | | String identity = sb.toString(); |
| | | registerDetailedVO.setIdentity(identity.substring(0,identity.length()-1)); |
| | | //查询答题数据 |
| | | List<ComActReserveRegisterDetailedAnswerVO> answerList = comActReserveAnswerContentMapper.getRegisterDetailedAnswerList(reserveRecordId); |
| | | registerDetailedVO.setAnswerList(answerList); |
| | | } |
| | | return R.ok(registerDetailedVO); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.google.common.collect.Lists; |
| | | import com.panzhihua.common.model.dtos.community.reserve.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.questnaire.QuestnaiteSubSelectionVO; |
| | | import com.panzhihua.common.model.vos.community.questnaire.QuestnaiteSubVO; |
| | | import com.panzhihua.common.model.vos.community.reserve.*; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_community.dao.ComActReserveMapper; |
| | | import com.panzhihua.service_community.dao.ComActReserveSubMapper; |
| | | import com.panzhihua.service_community.model.dos.*; |
| | | import com.panzhihua.common.model.dtos.community.PageUserReserveDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActReserveCommitVO; |
| | | import com.panzhihua.common.model.vos.community.questnaire.QuestnaiteSubVO; |
| | | import com.panzhihua.service_community.dao.*; |
| | | import com.panzhihua.service_community.model.dos.*; |
| | | import com.panzhihua.service_community.service.ComActReserveAnswerContentService; |
| | | import com.panzhihua.service_community.service.ComActReserveRecordService; |
| | | import com.panzhihua.service_community.service.ComActReserveService; |
| | | import com.panzhihua.service_community.service.ComActReserveSubSelectionService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-08-23 10:33:11 |
| | | * @describe 预约登记表服务实现类 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ComActReserveServiceImpl extends ServiceImpl<ComActReserveMapper, ComActReserveDO> implements ComActReserveService { |
| | | @Resource |
| | | private ComActReserveMapper comActReserveMapper; |
| | | @Resource |
| | | private ComActReserveSubMapper comActReserveSubMapper; |
| | | @Resource |
| | | private ComActReserveSubSelectionMapper comActReserveSubSelectionMapper; |
| | | @Resource |
| | | private ComActReserveAnswerContentService comActReserveAnswerContentService; |
| | | @Resource |
| | | private ComActReserveRecordMapper comActReserveRecordMapper; |
| | | @Resource |
| | | private ComActReserveOperationRecordMapper comActReserveOperationRecordMapper; |
| | | @Resource |
| | | private ComActReserveSubSelectionService comActReserveSubSelectionService; |
| | | @Resource |
| | | private ComActReserveRecordService comActReserveRecordService; |
| | | |
| | | private final static String COMMIT="用户已提交"; |
| | | @Override |
| | | @Transactional |
| | | public R commit(ComActReserveCommitVO comActReserveCommitVO) { |
| | | if(comActReserveCommitVO!=null){ |
| | | Long userId=comActReserveCommitVO.getUserId(); |
| | | Date nowDate=DateUtil.date(); |
| | | //查询预约登记记录 |
| | | ComActReserveDO comActReserveDO=comActReserveMapper.selectById(comActReserveCommitVO.getId()); |
| | | if(comActReserveDO!=null){ |
| | | //查询当前用户是否已预约并判断是否能继续预约 |
| | | if(comActReserveDO.getJoinAllCount()!=0){ |
| | | Integer count=comActReserveRecordMapper.selectCount(new QueryWrapper<ComActReserveRecordDO>().eq("reserve_id",comActReserveCommitVO.getId())); |
| | | if(count>=comActReserveDO.getJoinAllCount()){ |
| | | return R.fail("预约已上限"); |
| | | } |
| | | } |
| | | |
| | | |
| | | List<ComActReserveRecordDO> list=comActReserveRecordMapper.selectList(new QueryWrapper<ComActReserveRecordDO>().eq("reserve_id",comActReserveCommitVO.getId()).eq("user_id",comActReserveCommitVO.getUserId()).in("status",1,2,3)); |
| | | if(!list.isEmpty()&&list.size()>1&&comActReserveDO.getIsRepeat()==ComActReserveDO.isRepeat.no){ |
| | | return R.fail("提交失败,不可重复预约"); |
| | | } |
| | | else { |
| | | List<QuestnaiteSubVO> questnaiteSubVOS = JSON.parseArray(comActReserveCommitVO.getJsonObject(),QuestnaiteSubVO.class); |
| | | if(!questnaiteSubVOS.isEmpty()){ |
| | | Long questId=comActReserveCommitVO.getId(); |
| | | List<ComActReserveAnswerContentDO> answerContentList=new ArrayList<>(); |
| | | for(QuestnaiteSubVO questnaiteSub:questnaiteSubVOS){ |
| | | //查询用户填写题目 |
| | | ComActReserveSubDO questnaireSubDO = comActReserveSubMapper.selectOne(new QueryWrapper<ComActReserveSubDO>().lambda() |
| | | .eq(ComActReserveSubDO::getReserveId,questId).eq(ComActReserveSubDO::getKey,questnaiteSub.getKey())); |
| | | if(questnaireSubDO == null){ |
| | | log.error("未查询到调查问卷题目,题目名称:" + questnaiteSub.getLabel() + "题目key:" + questnaiteSub.getKey()); |
| | | continue; |
| | | } |
| | | |
| | | Long queSubId = questnaireSubDO.getId(); |
| | | //根据上传的类型查询不同的题目选项 |
| | | if(questnaiteSub.getType().equals(QuestnaiteSubVO.type.danxuan)){ |
| | | |
| | | //单选题处理 |
| | | ComActReserveSubSelectionDO subSelectionDO = comActReserveSubSelectionMapper.selectOne(new QueryWrapper<ComActReserveSubSelectionDO>() |
| | | .lambda().eq(ComActReserveSubSelectionDO::getReserveSubId,queSubId).eq(ComActReserveSubSelectionDO::getReserveId,questId) |
| | | .eq(ComActReserveSubSelectionDO::getKey,questnaiteSub.getValues())); |
| | | if(subSelectionDO == null){ |
| | | log.error("未查询到调查问卷选项,题目名称:" + questnaiteSub.getLabel() + "选项key:" + questnaiteSub.getValues()); |
| | | continue; |
| | | } |
| | | |
| | | ComActReserveAnswerContentDO answerContentDO = new ComActReserveAnswerContentDO(); |
| | | answerContentDO.setUserId(userId); |
| | | answerContentDO.setCreateAt(nowDate); |
| | | answerContentDO.setCreateBy(userId); |
| | | answerContentDO.setReserveSelectionId(subSelectionDO.getId()); |
| | | answerContentDO.setReserveSubId(queSubId); |
| | | answerContentDO.setType(1); |
| | | answerContentDO.setChoice(subSelectionDO.getOptionName()); |
| | | answerContentDO.setAnswerContent(subSelectionDO.getContent()); |
| | | answerContentList.add(answerContentDO); |
| | | }else if(questnaiteSub.getType().equals(QuestnaiteSubVO.type.duoxuan)){ |
| | | //多选题处理 |
| | | String values = questnaiteSub.getValues(); |
| | | String []value = values.split(","); |
| | | for (int i = 0; i < value.length; i++) { |
| | | ComActReserveSubSelectionDO subSelectionDO = comActReserveSubSelectionMapper.selectOne(new QueryWrapper<ComActReserveSubSelectionDO>() |
| | | .lambda().eq(ComActReserveSubSelectionDO::getReserveSubId,queSubId).eq(ComActReserveSubSelectionDO::getReserveId,questId) |
| | | .eq(ComActReserveSubSelectionDO::getKey,value[i])); |
| | | if(subSelectionDO == null){ |
| | | log.error("未查询到调查问卷选项,题目名称:" + questnaiteSub.getLabel() + "选项key:" + questnaiteSub.getValues()); |
| | | continue; |
| | | } |
| | | ComActReserveAnswerContentDO answerContentDO = new ComActReserveAnswerContentDO(); |
| | | answerContentDO.setUserId(userId); |
| | | answerContentDO.setCreateAt(nowDate); |
| | | answerContentDO.setCreateBy(userId); |
| | | answerContentDO.setReserveSelectionId(subSelectionDO.getId()); |
| | | answerContentDO.setReserveSubId(queSubId); |
| | | answerContentDO.setType(1); |
| | | answerContentDO.setChoice(subSelectionDO.getOptionName()); |
| | | answerContentDO.setAnswerContent(subSelectionDO.getContent()); |
| | | answerContentList.add(answerContentDO); |
| | | } |
| | | }else{ |
| | | //问答题处理 |
| | | String values = questnaiteSub.getValues(); |
| | | ComActReserveAnswerContentDO answerContentDO = new ComActReserveAnswerContentDO(); |
| | | answerContentDO.setUserId(userId); |
| | | answerContentDO.setCreateAt(nowDate); |
| | | answerContentDO.setCreateBy(userId); |
| | | answerContentDO.setReserveSubId(queSubId); |
| | | answerContentDO.setType(2); |
| | | answerContentDO.setAnswerContent(values); |
| | | answerContentList.add(answerContentDO); |
| | | } |
| | | } |
| | | if(!answerContentList.isEmpty()){ |
| | | //更新回答用户数量 |
| | | Integer joinCount = comActReserveDO.getJoinCount(); |
| | | comActReserveDO.setJoinCount(joinCount != null ? joinCount + 1 : 1); |
| | | comActReserveMapper.updateById(comActReserveDO); |
| | | //新增用户答题记录 |
| | | ComActReserveRecordDO userAnswerDO = new ComActReserveRecordDO(); |
| | | userAnswerDO.setName(comActReserveCommitVO.getName()); |
| | | userAnswerDO.setCommunityId(comActReserveCommitVO.getCommunityId()); |
| | | userAnswerDO.setPhone(comActReserveCommitVO.getPhone()); |
| | | userAnswerDO.setReserveId(questId); |
| | | userAnswerDO.setReserveTime(comActReserveCommitVO.getReserveTime()); |
| | | userAnswerDO.setUserId(userId); |
| | | userAnswerDO.setType(comActReserveCommitVO.getType()); |
| | | userAnswerDO.setCreateAt(nowDate); |
| | | userAnswerDO.setJsonObject(comActReserveCommitVO.getJsonObject()); |
| | | if(comActReserveCommitVO.getType()==ComActReserveRecordDO.type.yy){ |
| | | userAnswerDO.setStatus(ComActReserveRecordDO.status.dcl); |
| | | } |
| | | else { |
| | | userAnswerDO.setStatus(ComActReserveRecordDO.status.cg); |
| | | } |
| | | comActReserveRecordService.saveOrUpdate(userAnswerDO); |
| | | |
| | | //给答题记录赋值预约登记记录id |
| | | answerContentList.forEach(answerContent -> { |
| | | answerContent.setReserveRecordId(userAnswerDO.getId()); |
| | | }); |
| | | comActReserveAnswerContentService.saveBatch(answerContentList); |
| | | //新增用户操作记录 |
| | | ComActReserveOperationRecordDO comActReserveOperationRecordDO=new ComActReserveOperationRecordDO(); |
| | | comActReserveOperationRecordDO.setReserveId(comActReserveCommitVO.getId()); |
| | | comActReserveOperationRecordDO.setReserveRecordId(userAnswerDO.getId()); |
| | | comActReserveOperationRecordDO.setType(ComActReserveOperationRecordDO.type.br); |
| | | comActReserveOperationRecordDO.setCreateAt(DateUtil.date()); |
| | | comActReserveOperationRecordDO.setReserveTime(comActReserveCommitVO.getReserveTime()); |
| | | comActReserveOperationRecordDO.setReserveContent(COMMIT); |
| | | comActReserveOperationRecordDO.setPhone(comActReserveCommitVO.getPhone()); |
| | | comActReserveOperationRecordDO.setStatus(ComActReserveOperationRecordDO.status.ytj); |
| | | comActReserveOperationRecordDO.setUserId(comActReserveCommitVO.getUserId()); |
| | | comActReserveOperationRecordMapper.insert(comActReserveOperationRecordDO); |
| | | return R.ok("提交成功"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | return R.fail("参数错误"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 社区后台-分页查询预约登记列表 |
| | | * @param pageReserveDTO 请求参数 |
| | | * @return 预约登记列表 |
| | | */ |
| | | @Override |
| | | public R pageReserveAdmin(PageReserveAdminDTO pageReserveDTO){ |
| | | IPage<ComActReserveListAdminVO> reservePage = this.baseMapper.pageReserveAdmin(new Page(pageReserveDTO.getPageNum(),pageReserveDTO.getPageSize()),pageReserveDTO); |
| | | reservePage.getRecords().forEach(reserve -> { |
| | | //判断广告位置 |
| | | StringBuilder sb = new StringBuilder(); |
| | | if(reserve.getAdverPositionTop().equals(ComActQuestnaireDO.isOk.yes)){ |
| | | sb.append("首页顶部,"); |
| | | } |
| | | if(reserve.getAdverPositionApplication().equals(ComActQuestnaireDO.isOk.yes)){ |
| | | sb.append("首页应用,"); |
| | | } |
| | | String advertPosition = sb.toString(); |
| | | if(advertPosition.length() > 0){ |
| | | reserve.setAdvertPosition(advertPosition.substring(0,advertPosition.length()-1)); |
| | | }else{ |
| | | reserve.setAdvertPosition("无"); |
| | | } |
| | | }); |
| | | return R.ok(reservePage); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台-新增预约登记信息 |
| | | * @param addReserveDTO 请求参数 |
| | | * @return 新增结果 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R addReserveAdmin(AddReserveAdminDTO addReserveDTO){ |
| | | Date nowDate = new Date(); |
| | | Long userId = addReserveDTO.getUserId(); |
| | | //新增预约登记信息 |
| | | ComActReserveDO reserveDO = new ComActReserveDO(); |
| | | BeanUtils.copyProperties(addReserveDTO,reserveDO); |
| | | reserveDO.setStatus(ComActReserveDO.status.dfb); |
| | | reserveDO.setCreateAt(nowDate); |
| | | reserveDO.setCreateBy(userId); |
| | | |
| | | if(addReserveDTO.getIsPublish().equals(ComActReserveDO.isOk.yes)){ |
| | | reserveDO.setStatus(ComActReserveDO.status.jxz); |
| | | reserveDO.setPublishTime(nowDate); |
| | | } |
| | | this.baseMapper.insert(reserveDO); |
| | | |
| | | //根据上传的json数据录入选项以及题目到数据库 |
| | | if(StringUtils.isEmpty(addReserveDTO.getJsonObject())){ |
| | | return R.fail("组件json数据为空,录入失败"); |
| | | } |
| | | List<QuestnaiteSubVO> reserveSubVOS = JSON.parseArray(addReserveDTO.getJsonObject(),QuestnaiteSubVO.class); |
| | | reserveSubVOS.forEach(reserveSub -> { |
| | | ComActReserveSubDO comActReserveSubDO = new ComActReserveSubDO(); |
| | | comActReserveSubDO.setType(reserveSub.getType()); |
| | | comActReserveSubDO.setContent(reserveSub.getLabel()); |
| | | comActReserveSubDO.setSort(reserveSub.getSort()); |
| | | comActReserveSubDO.setReserveId(reserveDO.getId()); |
| | | comActReserveSubDO.setCreateBy(userId); |
| | | comActReserveSubDO.setCreateAt(nowDate); |
| | | comActReserveSubDO.setKey(reserveSub.getKey()); |
| | | comActReserveSubMapper.insert(comActReserveSubDO); |
| | | |
| | | ArrayList<ComActReserveSubSelectionDO> subSelectionList = Lists.newArrayList(); |
| | | if(reserveSub.getOptions() != null && !reserveSub.getOptions().isEmpty()) { |
| | | List<QuestnaiteSubSelectionVO> subOptions = reserveSub.getOptions(); |
| | | for(int i=0; i<subOptions.size(); i++){ |
| | | QuestnaiteSubSelectionVO subSelect = subOptions.get(i); |
| | | ComActReserveSubSelectionDO subSelectionDO = new ComActReserveSubSelectionDO(); |
| | | subSelectionDO.setReserveSubId(comActReserveSubDO.getId()); |
| | | if(subSelect.getType().equals(1)){ |
| | | //添加选项名称 |
| | | subSelectionDO.setOptionName(subSelect.getOptionName()); |
| | | }else { |
| | | subSelectionDO.setOptionName(String.valueOf(Character.toChars('A' + i))); |
| | | } |
| | | subSelectionDO.setContent(subSelect.getLabel()); |
| | | subSelectionDO.setReserveId(reserveDO.getId()); |
| | | subSelectionDO.setCreateBy(userId); |
| | | subSelectionDO.setCreateAt(nowDate); |
| | | subSelectionDO.setType(subSelect.getType()); |
| | | subSelectionDO.setKey(subSelect.getKey()); |
| | | subSelectionList.add(subSelectionDO); |
| | | } |
| | | } |
| | | comActReserveSubSelectionService.saveBatch(subSelectionList); |
| | | }); |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台-编辑预约登记信息 |
| | | * @param editReserveDTO 请求参数 |
| | | * @return 新增结果 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R editReserveAdmin(EditReserveAdminDTO editReserveDTO){ |
| | | Date nowDate = new Date(); |
| | | Long userId = editReserveDTO.getUserId(); |
| | | Long reserveId = editReserveDTO.getId(); |
| | | //查询预约登记信息 |
| | | ComActReserveDO reserveDO = this.baseMapper.selectById(reserveId); |
| | | if(reserveDO == null){ |
| | | return R.fail("未查询到预约登记记录"); |
| | | } |
| | | if(!reserveDO.getStatus().equals(ComActReserveDO.status.dfb)){ |
| | | return R.fail("不可修改不是待发布状态的预约登记记录"); |
| | | } |
| | | BeanUtils.copyProperties(editReserveDTO,reserveDO); |
| | | reserveDO.setStatus(ComActReserveDO.status.dfb); |
| | | reserveDO.setUpdateAt(nowDate); |
| | | reserveDO.setUpdateBy(userId); |
| | | if(editReserveDTO.getIsPublish().equals(ComActReserveDO.isOk.yes)){ |
| | | reserveDO.setStatus(ComActReserveDO.status.jxz); |
| | | reserveDO.setPublishTime(nowDate); |
| | | } |
| | | this.baseMapper.updateById(reserveDO); |
| | | |
| | | //根据上传的json数据录入选项以及题目到数据库 |
| | | if(StringUtils.isEmpty(editReserveDTO.getJsonObject())){ |
| | | return R.fail("组件json数据为空,录入失败"); |
| | | } |
| | | |
| | | //清除原来预约登记题目以及题目选项 |
| | | this.baseMapper.deleteReserveSubAll(reserveId); |
| | | //清除原有的,添加更新的 |
| | | List<QuestnaiteSubVO> reserveSubVOS = JSON.parseArray(editReserveDTO.getJsonObject(),QuestnaiteSubVO.class); |
| | | if(reserveSubVOS.isEmpty()){ |
| | | return R.fail("组件json数据为空,录入失败"); |
| | | } |
| | | reserveSubVOS.forEach(reserveSub -> { |
| | | ComActReserveSubDO comActReserveSubDO = new ComActReserveSubDO(); |
| | | comActReserveSubDO.setType(reserveSub.getType()); |
| | | comActReserveSubDO.setContent(reserveSub.getLabel()); |
| | | comActReserveSubDO.setSort(reserveSub.getSort()); |
| | | comActReserveSubDO.setReserveId(reserveDO.getId()); |
| | | comActReserveSubDO.setCreateBy(userId); |
| | | comActReserveSubDO.setCreateAt(nowDate); |
| | | comActReserveSubDO.setKey(reserveSub.getKey()); |
| | | comActReserveSubMapper.insert(comActReserveSubDO); |
| | | |
| | | ArrayList<ComActReserveSubSelectionDO> subSelectionList = Lists.newArrayList(); |
| | | if(reserveSub.getOptions() != null && !reserveSub.getOptions().isEmpty()) { |
| | | List<QuestnaiteSubSelectionVO> subOptions = reserveSub.getOptions(); |
| | | for(int i=0; i<subOptions.size(); i++){ |
| | | QuestnaiteSubSelectionVO subSelect = subOptions.get(i); |
| | | ComActReserveSubSelectionDO subSelectionDO = new ComActReserveSubSelectionDO(); |
| | | subSelectionDO.setReserveSubId(comActReserveSubDO.getId()); |
| | | if(subSelect.getType().equals(1)){ |
| | | //添加选项名称 |
| | | subSelectionDO.setOptionName(subSelect.getOptionName()); |
| | | }else { |
| | | subSelectionDO.setOptionName(String.valueOf(Character.toChars('A' + i))); |
| | | } |
| | | subSelectionDO.setContent(subSelect.getLabel()); |
| | | subSelectionDO.setReserveId(reserveDO.getId()); |
| | | subSelectionDO.setCreateBy(userId); |
| | | subSelectionDO.setCreateAt(nowDate); |
| | | subSelectionDO.setType(subSelect.getType()); |
| | | subSelectionDO.setKey(subSelect.getKey()); |
| | | subSelectionList.add(subSelectionDO); |
| | | } |
| | | } |
| | | comActReserveSubSelectionService.saveBatch(subSelectionList); |
| | | }); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台-修改预约登记状态 |
| | | * @param editReserveDTO 请求参数 |
| | | * @return 修改结果 |
| | | */ |
| | | @Override |
| | | public R editReserveStatusAdmin(EditComActReserveStatusDTO editReserveDTO){ |
| | | Date nowDate = new Date(); |
| | | Long userId = editReserveDTO.getUserId(); |
| | | Long reserveId = editReserveDTO.getId(); |
| | | //查询预约登记信息 |
| | | ComActReserveDO reserveDO = this.baseMapper.selectById(reserveId); |
| | | if(reserveDO == null){ |
| | | return R.fail("未查询到预约登记记录"); |
| | | } |
| | | |
| | | if(editReserveDTO.getType().equals(EditComActReserveStatusDTO.type.tz)){ |
| | | reserveDO.setStatus(ComActReserveDO.status.ytz); |
| | | reserveDO.setEndTime(nowDate); |
| | | }else if(editReserveDTO.getType().equals(EditComActReserveStatusDTO.type.fb)){ |
| | | reserveDO.setStatus(ComActReserveDO.status.jxz); |
| | | reserveDO.setPublishTime(nowDate); |
| | | } |
| | | reserveDO.setUpdateBy(userId); |
| | | reserveDO.setUpdateAt(nowDate); |
| | | if(this.baseMapper.updateById(reserveDO) > 0){ |
| | | return R.ok(); |
| | | }else{ |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 社区后台-继续预约登记 |
| | | * @param editReserveDTO 请求参数 |
| | | * @return 修改结果 |
| | | */ |
| | | @Override |
| | | public R editReserveInfoAdmin(EditComActReserveInfoDTO editReserveDTO){ |
| | | Date nowDate = new Date(); |
| | | Long userId = editReserveDTO.getUserId(); |
| | | Long reserveId = editReserveDTO.getId(); |
| | | //查询预约登记信息 |
| | | ComActReserveDO reserveDO = this.baseMapper.selectById(reserveId); |
| | | if(reserveDO == null){ |
| | | return R.fail("未查询到预约登记记录"); |
| | | } |
| | | BeanUtils.copyProperties(editReserveDTO,reserveDO); |
| | | reserveDO.setStatus(ComActReserveDO.status.jxz); |
| | | reserveDO.setUpdateAt(nowDate); |
| | | reserveDO.setUpdateBy(userId); |
| | | reserveDO.setEndTime(null); |
| | | if(this.baseMapper.updateById(reserveDO) > 0){ |
| | | return R.ok(); |
| | | }else{ |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 社区后台-根据预约登记id查询详情 |
| | | * @param reserveId 预约登记id |
| | | * @return 预约登记详情 |
| | | */ |
| | | @Override |
| | | public R detailReserveAdmin(Long reserveId){ |
| | | ComActReserveDetailAdminVO reserveDetailAdminVO = new ComActReserveDetailAdminVO(); |
| | | //查询预约登记信息 |
| | | ComActReserveDO reserveDO = this.baseMapper.selectById(reserveId); |
| | | BeanUtils.copyProperties(reserveDO,reserveDetailAdminVO); |
| | | return R.ok(reserveDetailAdminVO); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台-根据社区id统计预约类数据 |
| | | * @param makeStatisticsDTO 请求参数 |
| | | * @return 统计预约类数据 |
| | | */ |
| | | @Override |
| | | public R makeStatisticsAdmin(ComActReserveMakeStatisticsDTO makeStatisticsDTO){ |
| | | Long communityId = makeStatisticsDTO.getCommunityId(); |
| | | ComActReserveMakeStatisticsAdminVO makeStatisticsAdminVO = new ComActReserveMakeStatisticsAdminVO(); |
| | | //查询预约登记统计汇总左边数据 |
| | | List<ComActReserveMakeLeftStatisticsAdminVO> leftStatisticsList = this.baseMapper.getReserveMakeLeftStatistics(communityId); |
| | | if(!leftStatisticsList.isEmpty()){ |
| | | makeStatisticsAdminVO.setLeftStatisticsList(leftStatisticsList); |
| | | } |
| | | |
| | | //查询预约登记统计汇总右边数据 |
| | | List<ComActReserveMakeRightStatisticsAdminVO> rightStatisticsList = getRightStatisticsList(makeStatisticsDTO); |
| | | if(!rightStatisticsList.isEmpty()){ |
| | | makeStatisticsAdminVO.setRightStatisticsList(rightStatisticsList); |
| | | } |
| | | return R.ok(makeStatisticsAdminVO); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台-查询预约统计汇总右边数据 |
| | | * @param makeStatisticsDTO 请求参数 |
| | | * @return 预约统计汇总右边数据 |
| | | */ |
| | | private List<ComActReserveMakeRightStatisticsAdminVO> getRightStatisticsList(ComActReserveMakeStatisticsDTO makeStatisticsDTO){ |
| | | Long communityId = makeStatisticsDTO.getCommunityId(); |
| | | //查询预约登记统计汇总右边数据 |
| | | List<ComActReserveMakeRightStatisticsAdminVO> rightStatisticsList = this.baseMapper.getReserveMakeRightStatistics(makeStatisticsDTO); |
| | | if(!rightStatisticsList.isEmpty()){ |
| | | rightStatisticsList.forEach(rightStatistics -> { |
| | | String date = rightStatistics.getReserveTime(); |
| | | Integer count = this.baseMapper.getReserveRecordCount(communityId,date + " 00:00:00",date + " 23:59:59"); |
| | | rightStatistics.setAllCount(count); |
| | | |
| | | //计算百分比 |
| | | BigDecimal tag = BigDecimal.ZERO; |
| | | if(count >= 0){ |
| | | tag = BigDecimal.valueOf(rightStatistics.getCount()).divide(BigDecimal.valueOf(count),2, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | } |
| | | rightStatistics.setTag(tag); |
| | | }); |
| | | } |
| | | return rightStatisticsList; |
| | | } |
| | | |
| | | /** |
| | | * 社区后台-查询导出预约统计汇总数据 |
| | | * @param makeStatisticsDTO 请求参数 |
| | | * @return 统计预约类数据 |
| | | */ |
| | | @Override |
| | | public R makeStatisticsExportAdmin(ComActReserveMakeStatisticsDTO makeStatisticsDTO){ |
| | | return R.ok(getRightStatisticsList(makeStatisticsDTO)); |
| | | } |
| | | |
| | | /** |
| | | * 删除预约登记信息 |
| | | * @param reserveId 预约登记id |
| | | * @return 删除结果 |
| | | */ |
| | | @Override |
| | | public R deleteReserveAdmin(Long reserveId){ |
| | | //查询预约登记信息 |
| | | ComActReserveDO reserveDO = this.baseMapper.selectById(reserveId); |
| | | if(reserveDO == null){ |
| | | return R.fail("未查询到预约登记信息"); |
| | | } |
| | | reserveDO.setIsDel(ComActReserveDO.isOk.yes); |
| | | reserveDO.setUpdateAt(new Date()); |
| | | |
| | | if(this.baseMapper.updateById(reserveDO) > 0){ |
| | | return R.ok(); |
| | | }else{ |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询社区所有预约信息列表 |
| | | * @param communityId 社区id |
| | | * @return 预约信息列表 |
| | | */ |
| | | @Override |
| | | public R listReserveAdmin(Long communityId){ |
| | | return R.ok(this.baseMapper.listReserveAdmin(communityId)); |
| | | } |
| | | |
| | | @Override |
| | | public R getById(Long id,Long userId,Long recordId,Integer isBack) { |
| | | ComActReserveDO comActReserveDO=comActReserveMapper.selectById(id); |
| | | if(comActReserveDO!=null){ |
| | | ComActReserveDetailVO comActReserveDetailVO=new ComActReserveDetailVO(); |
| | | if(isBack!=1){ |
| | | comActReserveDO.setViewNum(comActReserveDO.getViewNum()+1); |
| | | BeanUtils.copyProperties(comActReserveDO,comActReserveDetailVO); |
| | | List<ComActReserveRecordDO> list=comActReserveRecordMapper.selectList(new QueryWrapper<ComActReserveRecordDO>().eq("user_id",userId).eq("reserve_id",id).in("status",1,2).orderByDesc("reserve_time")); |
| | | List<ComActReserveRecordDO> secondlist=comActReserveRecordMapper.selectList(new QueryWrapper<ComActReserveRecordDO>().eq("user_id",userId).eq("reserve_id",id).orderByDesc("reserve_time")); |
| | | //判断当前数据是否可重复提交 |
| | | if(comActReserveDO.getIsRepeat()==ComActReserveDetailVO.isOk.y||list.isEmpty()){ |
| | | comActReserveDetailVO.setIsOk(ComActReserveDetailVO.isOk.n); |
| | | }else { |
| | | comActReserveDetailVO.setIsOk(ComActReserveDetailVO.isOk.y); |
| | | } |
| | | //如果用户已提交返回最新一条记录 列表时间倒序排列 |
| | | if(!list.isEmpty()){ |
| | | comActReserveDetailVO.setJsonObject(list.get(0).getJsonObject()); |
| | | comActReserveDetailVO.setReserveTime(list.get(0).getReserveTime()); |
| | | } |
| | | if(!secondlist.isEmpty()&&recordId!=null){ |
| | | secondlist.forEach(comActReserveRecordDO -> { |
| | | if(comActReserveRecordDO.getId().equals(recordId)){ |
| | | comActReserveDetailVO.setRecordStatus(comActReserveRecordDO.getStatus()); |
| | | } |
| | | }); |
| | | } |
| | | //更新浏览量 |
| | | comActReserveMapper.updateById(comActReserveDO); |
| | | return R.ok(comActReserveDetailVO); |
| | | } |
| | | ComActReserveRecordDO comActReserveRecordDO =comActReserveRecordMapper.selectById(recordId); |
| | | if(comActReserveRecordDO!=null){ |
| | | BeanUtils.copyProperties(comActReserveRecordDO,comActReserveDetailVO); |
| | | } |
| | | return R.ok(comActReserveDetailVO); |
| | | } |
| | | return R.fail("未查询到数据"); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public R pageReserveList(PageUserReserveDTO pageUserReserveDTO) { |
| | | return R.ok(comActReserveRecordMapper.pageReserveList(new Page<ComActReserveDO>(pageUserReserveDTO.getPageNum(), pageUserReserveDTO.getPageSize()),pageUserReserveDTO)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.service_community.dao.ComActReserveSubSelectionMapper; |
| | | import com.panzhihua.service_community.model.dos.ComActReserveSubSelectionDO; |
| | | import com.panzhihua.service_community.service.ComActReserveSubSelectionService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-08-23 10:34:13 |
| | | * @describe 预约登记题目选项 服务实现类 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ComActReserveSubSelectionServiceImpl extends ServiceImpl<ComActReserveSubSelectionMapper, ComActReserveSubSelectionDO> implements ComActReserveSubSelectionService { |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.reserve.ComActReserveSubListVO; |
| | | import com.panzhihua.service_community.dao.ComActReserveSubMapper; |
| | | import com.panzhihua.service_community.model.dos.ComActReserveSubDO; |
| | | import com.panzhihua.service_community.service.ComActReserveSubService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-08-23 10:34:03 |
| | | * @describe 预约登记题目选项服务实现类 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ComActReserveSubServiceImpl extends ServiceImpl<ComActReserveSubMapper, ComActReserveSubDO> implements ComActReserveSubService { |
| | | |
| | | /** |
| | | * 查询预约登记题目列表 |
| | | * @param reserveId 预约登记id |
| | | * @return 约登记题目列表 |
| | | */ |
| | | @Override |
| | | public R subjectListAdmin(Long reserveId){ |
| | | List<ComActReserveSubListVO> resultList = new ArrayList<>(100); |
| | | resultList.add(new ComActReserveSubListVO("nub","序号")); |
| | | resultList.add(new ComActReserveSubListVO("nickName","用户昵称")); |
| | | List<ComActReserveSubListVO> list = this.baseMapper.getReserveSubjectList(reserveId); |
| | | if(list != null && !list.isEmpty()){ |
| | | resultList.addAll(list); |
| | | } |
| | | resultList.add(new ComActReserveSubListVO("id","登记流水")); |
| | | resultList.add(new ComActReserveSubListVO("time","登记时间")); |
| | | return R.ok(resultList); |
| | | } |
| | | |
| | | } |
| | |
| | | // } |
| | | BeanUtils.copyProperties(comActVO, comActDO); |
| | | |
| | | // ComActDO selectOne = comActDAO.selectOne(new QueryWrapper<ComActDO>().lambda().eq(ComActDO::getAccount, account)); |
| | | // if (null != selectOne && selectOne.getAccount().equals(comActVO.getAccount())) { |
| | | // return R.fail("该登录账号重复,请重新修改"); |
| | | // } |
| | | int update = comActDAO.updateById(comActDO); |
| | | if (update > 0) { |
| | | if (a == 1) { |
| | |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ComMngPopulationServiceImpl extends ServiceImpl<ComMngPopulationDAO, ComMngPopulationDO> |
| | | implements ComMngPopulationService { |
| | | public class ComMngPopulationServiceImpl extends ServiceImpl<ComMngPopulationDAO, ComMngPopulationDO> implements ComMngPopulationService { |
| | | @Resource |
| | | private ComMngPopulationDAO populationDAO; |
| | | @Resource |
| | |
| | | try { |
| | | // 查询社区信息 |
| | | log.info("开始查询社区信息数据"); |
| | | ComPopulationActVO populationActVO = comActDAO.getPopulationActById(communityId); |
| | | ComPopulationActVO populationActVO = comActDAO.getPopulationActById(31L); |
| | | if (populationActVO == null) { |
| | | log.error("未查询到社区信息"); |
| | | return R.fail("未查询到社区信息"); |
| | |
| | | // 查询当前社区标签列表 |
| | | List<String> labelList = new ArrayList<>(); |
| | | List<ComMngUserTagDO> comMngUserTagDOS = comMngUserTagDAO |
| | | .selectList(new QueryWrapper<ComMngUserTagDO>().eq("sys_flag", 1).or().eq("community_id", communityId)); |
| | | .selectList(new QueryWrapper<ComMngUserTagDO>().eq("sys_flag", 1).or().eq("community_id", 31)); |
| | | if (!ObjectUtils.isEmpty(comMngUserTagDOS)) { |
| | | labelList = comMngUserTagDOS.stream().map(comMngUserTagDO -> comMngUserTagDO.getTagName()) |
| | | .collect(Collectors.toList()); |
| | |
| | | log.info("开始查询小区街路巷是否存在"); |
| | | // 查询小区街路巷是否存在 |
| | | ComMngVillageDO comMngVillageDO = null; |
| | | String villageKey = communityId + vo.getRoad() + vo.getDoorNo(); |
| | | String villageKey = 31 + vo.getRoad() + vo.getDoorNo(); |
| | | if (!isOnly(villageKey, villageMap)) { |
| | | comMngVillageDO = (ComMngVillageDO)villageMap.get(villageKey); |
| | | } else { |
| | |
| | | mvo.setHouseStatus(PopulHouseStatusEnum.getCnDescByName(vo.getHouseStatus())); |
| | | mvo.setHousePurpose(PopulHousePurposeEnum.getCnDescByName(vo.getHousePurpose())); |
| | | mvo.setControlStatus(PopulHouseControlStatusEnum.getCnDescByName(vo.getControlStatus())); |
| | | mvo.setCultureLevel(PopulCultureLevelEnum.getCnDescByName(vo.getCultureLevel())); |
| | | // mvo.setCultureLevel(PopulCultureLevelEnum.getCnDescByName(vo.getCultureLevel())); |
| | | // mvo.setMarriage(PopulMarriageEnum.getCnDescByName(vo.getMarriage())); |
| | | mvo.setOutOrLocal(PopulOutOrLocalEnum.getCnDescByName(vo.getOutOrLocal())); |
| | | mvo.setIsCorrectGroup(PopulHouseUseEnum.getCnDescByName(vo.getIsCorrectGroup())); |
| | |
| | | private void setMajorMistake(ComMngPopulationMajorMistakeExcelVO mvo, ComMngPopulationMajorExcelVO vo) { |
| | | // mvo.setPoliticalOutlook(PopulPoliticalOutlookEnum.getCnDescByName(vo.getPoliticalOutlook())); |
| | | mvo.setIsRent(PopulHouseUseEnum.getCnDescByName(vo.getIsRent())); |
| | | mvo.setCustodyRelation(PopulRelationEnum.getCnDescByName(vo.getCustodyRelation())); |
| | | // mvo.setCustodyRelation(PopulRelationEnum.getCnDescByName(vo.getCustodyRelation())); |
| | | // mvo.setRelation(PopulRelationEnum.getCnDescByName(vo.getRelation())); |
| | | mvo.setHouseStatus(PopulHouseStatusEnum.getCnDescByName(vo.getHouseStatus())); |
| | | mvo.setHousePurpose(PopulHousePurposeEnum.getCnDescByName(vo.getHousePurpose())); |
| | |
| | | ComMngPopulationRehabilitationExcelVO vo) { |
| | | // mvo.setPoliticalOutlook(PopulPoliticalOutlookEnum.getCnDescByName(vo.getPoliticalOutlook())); |
| | | mvo.setIsRent(PopulHouseUseEnum.getCnDescByName(vo.getIsRent())); |
| | | mvo.setPatientRelation(PopulRelationEnum.getCnDescByName(vo.getPatientRelation())); |
| | | // mvo.setPatientRelation(PopulRelationEnum.getCnDescByName(vo.getPatientRelation())); |
| | | mvo.setHouseStatus(PopulHouseStatusEnum.getCnDescByName(vo.getHouseStatus())); |
| | | mvo.setHousePurpose(PopulHousePurposeEnum.getCnDescByName(vo.getHousePurpose())); |
| | | mvo.setControlStatus(PopulHouseControlStatusEnum.getCnDescByName(vo.getControlStatus())); |
| | |
| | | } |
| | | |
| | | private void setVeteransMistake(ComMngPopulationVeteransMistakeExcelVO mvo, ComMngPopulationVeteransExcelVO vo) { |
| | | mvo.setRegiterNature(PopulRegiterNatureEnum.getCnDescByName(vo.getRegiterNature())); |
| | | // mvo.setRegiterNature(PopulRegiterNatureEnum.getCnDescByName(vo.getRegiterNature())); |
| | | mvo.setPoliticalOutlook(PopulPoliticalOutlookEnum.getCnDescByName(vo.getPoliticalOutlook())); |
| | | mvo.setIsRent(PopulHouseUseEnum.getCnDescByName(vo.getIsRent())); |
| | | // mvo.setPatientRelation(PopulRelationEnum.getCnDescByName(vo.getPatientRelation())); |
| | |
| | | @Override |
| | | public R exportDangerReport(List<Long> dangerReportIds) { |
| | | List<ComSwDangerReportExcelVO> list = comSwDangerReportDAO.exportDangerReport(dangerReportIds); |
| | | // list.forEach(comSwDangerReportExcelVO -> { |
| | | // List<String> patrolUserIds = Arrays.asList(comSwDangerReportExcelVO.getPatrolPerson().split(",")); |
| | | // List<String> patrolPhones = new ArrayList<>(); |
| | | // for (String userId : patrolUserIds) { |
| | | // LoginUserInfoVO loginUserInfoVO = userService.getUserInfoByUserId(userId).getData(); |
| | | // patrolPhones.add(loginUserInfoVO.getPhone()); |
| | | // } |
| | | // comSwDangerReportExcelVO.setPatrolPersonPhone(StringUtils.join(patrolPhones,",")); |
| | | // }); |
| | | list.forEach(comSwDangerReportExcelVO -> { |
| | | // 整改人员id查询整改人员的名字和电话 |
| | | StringBuilder dangerNameString = new StringBuilder(); |
| | | StringBuilder dangerPhoneString = new StringBuilder(); |
| | | if (StringUtils.isNotEmpty(comSwDangerReportExcelVO.getDpersonName())) { |
| | | String[] dangerIds = comSwDangerReportExcelVO.getDpersonName().split(","); |
| | | for (int i = 0; i < dangerIds.length; i++) { |
| | | Map<String, String> person = comSwPatrolRecordDAO.getPbServiceTeamById(dangerIds[i]); |
| | | if (person != null) { |
| | | if (i != 0) { |
| | | dangerNameString.append(","); |
| | | dangerPhoneString.append(","); |
| | | } |
| | | dangerNameString.append(person.get("name")); |
| | | dangerPhoneString.append(person.get("phone")); |
| | | } |
| | | } |
| | | comSwDangerReportExcelVO.setDpersonName(dangerNameString.toString()); |
| | | comSwDangerReportExcelVO.setDpersonPhone(dangerPhoneString.toString()); |
| | | } |
| | | }); |
| | | return R.ok(list); |
| | | } |
| | | } |
| | |
| | | BeanUtils.copyProperties(comSwPatrolRecordAddDTO, comSwPatrolRecordDO); |
| | | Long patrolRecordId = Snowflake.getId(); |
| | | comSwPatrolRecordDO.setId(patrolRecordId); |
| | | comSwPatrolRecordDO.setPatrolTime(new Date()); |
| | | if(StringUtils.isEmpty(comSwPatrolRecordAddDTO.getPatrolTime())){ |
| | | comSwPatrolRecordDO.setPatrolTime(new Date()); |
| | | }else { |
| | | comSwPatrolRecordDO.setPatrolTime( |
| | | DateUtils.stringToDate(comSwPatrolRecordAddDTO.getPatrolTime(), DateUtils.yyyyMMdd_format)); |
| | | } |
| | | // comSwPatrolRecordDO.setPatrolTime(new Date()); |
| | | comSwPatrolRecordDO.setSuccessionTime( |
| | | DateUtils.stringToDate(comSwPatrolRecordAddDTO.getSuccessionTime(), DateUtils.yyyyMMdd_format)); |
| | | StringBuilder nameString = new StringBuilder(); |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_community.dao.ComActActEvaluateDAO"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ComActActEvaluateDO"> |
| | | <id column="id" property="id" /> |
| | | <result column="activity_id" property="activityId" /> |
| | | <result column="user_id" property="userId" /> |
| | | <result column="create_at" property="createAt" /> |
| | | <result column="is_volunteer" property="isVolunteer" /> |
| | | <result column="star_level" property="starLevel" /> |
| | | <result column="evaluate_content" property="evaluateContent" /> |
| | | <result column="photo" property="photo" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, activity_id, user_id, create_at, is_volunteer, star_level, evaluate_content, photo |
| | | </sql> |
| | | |
| | | <select id="pageActivityEvaluates" resultType="com.panzhihua.common.model.vos.community.ComActActEvaluateVO"> |
| | | SELECT |
| | | caae.id, |
| | | caae.activity_id, |
| | | caae.create_at, |
| | | caae.photo, |
| | | caae.star_level, |
| | | caae.evaluate_content, |
| | | su.user_id, |
| | | su.`name`, |
| | | su.nick_name, |
| | | su.phone, |
| | | su.image_url, |
| | | su.tags, |
| | | caae.is_volunteer, |
| | | CASE |
| | | |
| | | WHEN su.is_partymember = 1 THEN |
| | | '党员' |
| | | WHEN caas.is_volunteer = 1 THEN |
| | | '志愿者' ELSE '居民' |
| | | END identity |
| | | |
| | | FROM |
| | | com_act_act_evaluate caae |
| | | LEFT JOIN com_act_act_sign caas ON caae.activity_id = caas.activity_id |
| | | LEFT JOIN sys_user su ON caae.user_id = su.user_id |
| | | where caae.activity_id = #{comActActEvaluateVO.activityId} |
| | | <if test="comActActEvaluateVO.phone != null and comActActEvaluateVO.phone !=''"> |
| | | AND su.phone = #{comActActEvaluateVO.phone} |
| | | </if> |
| | | <if test="comActActEvaluateVO.name != null and comActActEvaluateVO.name !=''"> |
| | | AND su.`name` = #{comActActEvaluateVO.name} |
| | | </if> |
| | | <if test="comActActEvaluateVO.starLevel != null"> |
| | | AND caae.star_level = #{comActActEvaluateVO.starLevel} |
| | | </if> |
| | | <if test="comActActEvaluateVO.createAt != null"> |
| | | AND caae.create_at = #{comActActEvaluateVO.createAt} |
| | | </if> |
| | | order by caae.create_at desc |
| | | </select> |
| | | |
| | | <select id="getEvaluateLists" resultType="com.panzhihua.common.model.vos.community.ComActActEvaluateExcelVO"> |
| | | SELECT |
| | | caae.create_at, |
| | | caae.star_level, |
| | | caae.evaluate_content, |
| | | su.`name`, |
| | | su.phone, |
| | | CASE |
| | | |
| | | WHEN su.is_partymember = 1 THEN |
| | | '党员' |
| | | WHEN caas.is_volunteer = 1 THEN |
| | | '志愿者' ELSE '居民' |
| | | END identity |
| | | |
| | | FROM |
| | | com_act_act_evaluate caae |
| | | LEFT JOIN com_act_act_sign caas ON caae.activity_id = caas.activity_id |
| | | LEFT JOIN sys_user su ON caae.user_id = su.user_id |
| | | where caae.activity_id = #{comActActEvaluateVO.activityId} |
| | | <if test="comActActEvaluateVO.phone != null and comActActEvaluateVO.phone !=''"> |
| | | AND su.phone = #{comActActEvaluateVO.phone} |
| | | </if> |
| | | <if test="comActActEvaluateVO.name != null and comActActEvaluateVO.name !=''"> |
| | | AND su.`name` = #{comActActEvaluateVO.name} |
| | | </if> |
| | | <if test="comActActEvaluateVO.starLevel != null"> |
| | | AND caae.star_level = #{comActActEvaluateVO.starLevel} |
| | | </if> |
| | | <if test="comActActEvaluateVO.createAt != null"> |
| | | AND caae.create_at = #{comActActEvaluateVO.createAt} |
| | | </if> |
| | | order by caae.create_at desc |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_community.dao.ComActActPictureDAO"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ComActActPictureDO"> |
| | | <id column="id" property="id" /> |
| | | <result column="activity_id" property="activityId" /> |
| | | <result column="user_id" property="userId" /> |
| | | <result column="create_at" property="createAt" /> |
| | | <result column="upload_picture" property="uploadPicture" /> |
| | | <result column="picture_name" property="pictureName" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, activity_id, user_id, create_at, upload_picture, picture_name |
| | | </sql> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_community.dao.ComActActRegistDAO"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ComActActRegistDO"> |
| | | <id column="id" property="id" /> |
| | | <result column="activity_id" property="activityId" /> |
| | | <result column="user_id" property="userId" /> |
| | | <result column="create_at" property="createAt" /> |
| | | <result column="is_volunteer" property="isVolunteer" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, activity_id, user_id, create_at, is_volunteer |
| | | </sql> |
| | | |
| | | <select id="pageActivityRegists" resultType="com.panzhihua.common.model.vos.community.ComActActRegistVO"> |
| | | SELECT |
| | | caar.id, |
| | | caar.activity_id, |
| | | caar.create_at, |
| | | su.user_id, |
| | | su.`name`, |
| | | su.nick_name, |
| | | su.phone, |
| | | su.image_url, |
| | | su.tags, |
| | | caar.is_volunteer, |
| | | CASE |
| | | |
| | | WHEN su.is_partymember = 1 THEN |
| | | '党员' |
| | | WHEN caas.is_volunteer = 1 THEN |
| | | '志愿者' ELSE '居民' |
| | | END identity |
| | | |
| | | FROM |
| | | com_act_act_regist caar |
| | | LEFT JOIN com_act_act_sign caas ON caar.activity_id = caas.activity_id |
| | | LEFT JOIN sys_user su ON caar.user_id = su.user_id |
| | | where caar.activity_id = #{comActActRegistVO.activityId} |
| | | <if test="comActActRegistVO.phone != null and comActActRegistVO.phone !=''"> |
| | | AND su.phone = #{comActActRegistVO.phone} |
| | | </if> |
| | | <if test="comActActRegistVO.name != null and comActActRegistVO.name !=''"> |
| | | AND su.`name` = #{comActActRegistVO.name} |
| | | </if> |
| | | <if test="comActActRegistVO.tags != null and comActActRegistVO.tags !=''"> |
| | | AND su.tags like ('%', #{comActActRegistVO.tags}, '%') |
| | | </if> |
| | | <if test="comActActRegistVO.createAt != null"> |
| | | AND caar.create_at = #{comActActRegistVO.createAt} |
| | | </if> |
| | | order by caar.create_at desc |
| | | </select> |
| | | |
| | | <select id="getRegistLists" resultType="com.panzhihua.common.model.vos.community.ComActActRegistExcelVO"> |
| | | SELECT |
| | | caar.create_at, |
| | | su.`name`, |
| | | su.phone, |
| | | su.tags, |
| | | CASE |
| | | |
| | | WHEN su.is_partymember = 1 THEN |
| | | '党员' |
| | | WHEN caas.is_volunteer = 1 THEN |
| | | '志愿者' ELSE '居民' |
| | | END identity |
| | | |
| | | FROM |
| | | com_act_act_regist caar |
| | | LEFT JOIN com_act_act_sign caas ON caar.activity_id = caas.activity_id |
| | | LEFT JOIN sys_user su ON caar.user_id = su.user_id |
| | | where caar.activity_id = #{comActActRegistVO.activityId} |
| | | <if test="comActActRegistVO.phone != null and comActActRegistVO.phone !=''"> |
| | | AND su.phone = #{comActActRegistVO.phone} |
| | | </if> |
| | | <if test="comActActRegistVO.name != null and comActActRegistVO.name !=''"> |
| | | AND su.`name` = #{comActActRegistVO.name} |
| | | </if> |
| | | <if test="comActActRegistVO.tags != null and comActActRegistVO.tags !=''"> |
| | | AND su.tags like ('%', #{comActActRegistVO.tags}, '%') |
| | | </if> |
| | | <if test="comActActRegistVO.createAt != null"> |
| | | AND caar.create_at = #{comActActRegistVO.createAt} |
| | | </if> |
| | | order by caar.create_at desc |
| | | </select> |
| | | |
| | | <select id="getNoRegistLists" resultType="com.panzhihua.common.model.vos.community.ComActActRegistExcelVO"> |
| | | SELECT |
| | | caas.create_at, |
| | | su.`name` |
| | | su.phone, |
| | | su.tags, |
| | | CASE |
| | | |
| | | WHEN su.is_partymember = 1 THEN |
| | | '党员' |
| | | WHEN caas.is_volunteer = 1 THEN |
| | | '志愿者' ELSE '居民' |
| | | END identity |
| | | FROM |
| | | `com_act_act_sign` caas |
| | | LEFT JOIN sys_user su ON caas.user_id = su.user_id |
| | | WHERE NOT EXISTS ( SELECT 1 FROM com_act_act_regist caar WHERE caas.user_id = caar.user_id ) |
| | | AND caas.activity_id = #{comActActRegistVO.activityId} |
| | | <if test="comActActRegistVO.phone != null and comActActRegistVO.phone !=''"> |
| | | AND su.phone = #{comActActRegistVO.phone} |
| | | </if> |
| | | <if test="comActActRegistVO.name != null and comActActRegistVO.name !=''"> |
| | | AND su.`name` = #{comActActRegistVO.name} |
| | | </if> |
| | | <if test="comActActRegistVO.tags != null and comActActRegistVO.tags !=''"> |
| | | AND su.tags like ('%', #{comActActRegistVO.tags}, '%') |
| | | </if> |
| | | <if test="comActActRegistVO.createAt != null"> |
| | | AND caar.create_at = #{comActActRegistVO.createAt} |
| | | </if> |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_community.dao.ComActActSignDAO"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ComActActSignDO"> |
| | | <id column="id" property="id" /> |
| | | <result column="activity_id" property="activityId" /> |
| | | <result column="user_id" property="userId" /> |
| | | <result column="create_at" property="createAt" /> |
| | | <result column="is_volunteer" property="isVolunteer" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, activity_id, user_id, create_at, is_volunteer |
| | | </sql> |
| | | |
| | | <select id="getSignLists" resultType="com.panzhihua.common.model.vos.community.ComActActSignExcelVO"> |
| | | SELECT |
| | | caas.create_at, |
| | | su.`name`, |
| | | su.phone, |
| | | su.tags, |
| | | CASE |
| | | |
| | | WHEN su.is_partymember = 1 THEN |
| | | '党员' |
| | | WHEN caas.is_volunteer = 1 THEN |
| | | '志愿者' ELSE '居民' |
| | | END identity |
| | | |
| | | FROM |
| | | com_act_act_sign caas |
| | | LEFT JOIN sys_user su ON caas.user_id = su.user_id |
| | | where caas.activity_id = #{activitySignVO.activityId} |
| | | <if test="activitySignVO.phone != null and activitySignVO.phone !=''"> |
| | | AND su.phone = #{activitySignVO.phone} |
| | | </if> |
| | | <if test="activitySignVO.name != null and activitySignVO.name !=''"> |
| | | AND su.`name` = #{activitySignVO.name} |
| | | </if> |
| | | <if test="activitySignVO.createAt != null and activitySignVO.createAt !=''"> |
| | | AND caas.create_at = #{activitySignVO.createAt} |
| | | </if> |
| | | <if test="activitySignVO.tags != null and activitySignVO.tags !=''"> |
| | | AND su.tags like concat('%', #{activitySignVO.tags}, '%') |
| | | </if> |
| | | order by caas.create_at desc |
| | | </select> |
| | | |
| | | <select id="selectNeedEvaluateSignRecords" resultMap="BaseResultMap"> |
| | | SELECT s.id,s.activity_id,s.user_id,s.create_at,s.is_volunteer |
| | | FROM `com_act_act_sign` s |
| | | LEFT JOIN `com_act_act_evaluate` e |
| | | ON s.activity_id=e.activity_id AND s.user_id=e.user_id |
| | | WHERE s.activity_id IN |
| | | <foreach collection="activityIds" item="id" index="index" open="(" close=")" separator=","> |
| | | #{id} |
| | | </foreach> AND e.id IS NULL |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_community.dao.ComActActivityDAO"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ComActActivityDO"> |
| | | <id column="id" property="id" /> |
| | | <result column="activity_name" property="activityName" /> |
| | | <result column="sponsor_id" property="sponsorId" /> |
| | | <result column="activity_addr" property="activityAddr" /> |
| | | <result column="lat" property="lat" /> |
| | | <result column="lng" property="lng" /> |
| | | <result column="status" property="status" /> |
| | | <result column="publish_at" property="publishAt" /> |
| | | <result column="end_at" property="endAt" /> |
| | | <result column="begin_at" property="beginAt" /> |
| | | <result column="sign_up_begin" property="signUpBegin" /> |
| | | <result column="sign_up_end" property="signUpEnd" /> |
| | | <result column="aattend_people" property="aattendPeople" /> |
| | | <result column="volunteer_min" property="volunteerMin" /> |
| | | <result column="volunteer_max" property="volunteerMax" /> |
| | | <result column="participant_min" property="participantMin" /> |
| | | <result column="participant_max" property="participantMax" /> |
| | | <result column="cover" property="cover" /> |
| | | <result column="has_prize" property="hasPrize" /> |
| | | <result column="is_qr_code" property="isQrCode" /> |
| | | <result column="contact_name" property="contactName" /> |
| | | <result column="contact_phone" property="contactPhone" /> |
| | | <result column="is_regist" property="isRegist" /> |
| | | <result column="is_top" property="isTop" /> |
| | | <result column="prize_remark" property="prizeRemark" /> |
| | | <result column="reward_desc" property="rewardDesc" /> |
| | | <result column="content" property="content" /> |
| | | <result column="community_id" property="communityId" /> |
| | | <result column="create_at" property="createAt" /> |
| | | <result column="cancel_reason" property="cancelReason" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, activity_name, sponsor_id, activity_addr, lat, lng, status, publish_at, end_at, begin_at, sign_up_begin, sign_up_end, aattend_people, volunteer_min, volunteer_max, participant_min, participant_max, cover, has_prize, is_qr_code, contact_name, contact_phone, is_regist, is_top, prize_remark, reward_desc, content, community_id, create_at, cancel_reason |
| | | </sql> |
| | | |
| | | <select id="activityStatistics" resultType="com.panzhihua.common.model.vos.community.ComActActivityStatisticsVO"> |
| | | SELECT IFNULL(volunteer_max,0) + IFNULL(participant_max,0) as signTotal |
| | | ,(SELECT count(id) FROM com_act_act_sign WHERE activity_id = #{activityId}) as reallySignTotal |
| | | ,(SELECT count(id) FROM com_act_act_sign WHERE activity_id = #{activityId}) as registTotal |
| | | ,(SELECT count(id) FROM com_act_act_regist WHERE activity_id = #{activityId}) as reallyRegistTotal |
| | | ,((SELECT count(id) FROM com_act_act_sign WHERE activity_id = #{activityId}) - (SELECT count(id) FROM com_act_act_regist WHERE activity_id = #{activityId})) as noRegistTotal |
| | | ,(SELECT count(id) FROM com_act_act_sign WHERE activity_id = #{activityId}) as evaluateTotal |
| | | ,(SELECT count(id) FROM com_act_act_evaluate WHERE activity_id = #{activityId}) as reallyEvaluateTotal |
| | | ,((SELECT count(id) FROM com_act_act_sign WHERE activity_id = #{activityId}) - (SELECT count(id) FROM com_act_act_evaluate WHERE activity_id = #{activityId})) as noEvaluateTotal |
| | | FROM com_act_activity where id = #{activityId} |
| | | </select> |
| | | <select id="getIndexTopActivityList" resultMap="BaseResultMap"> |
| | | SELECT * FROM `com_act_activity` |
| | | WHERE community_id = #{communityId} and is_top = 1 and end_at >= now() and begin_at <= now() |
| | | </select> |
| | | </mapper> |
| | |
| | | <if test='comActEasyPhotoVO.isReportUrban != null' > |
| | | AND p.`is_report_urban` = #{comActEasyPhotoVO.isReportUrban} |
| | | </if> |
| | | <if test='comActEasyPhotoVO.classifyId != null' > |
| | | AND p.`classify_id` = #{comActEasyPhotoVO.classifyId} |
| | | </if> |
| | | <if test='comActEasyPhotoVO.urbanStatus != null' > |
| | | AND p.`urban_status` = #{comActEasyPhotoVO.urbanStatus} |
| | | </if> |
| | |
| | | AND (u.`name` like concat(#{comActEasyPhotoVO.keyWord},'%') or |
| | | p.happen_addr like concat(#{comActEasyPhotoVO.keyWord},'%') or |
| | | su.`name` like concat(#{comActEasyPhotoVO.keyWord},'%') or |
| | | p.detail like concat(#{comActEasyPhotoVO.keyWord},'%') |
| | | p.detail like concat(#{comActEasyPhotoVO.keyWord},'%') or u.phone like concat(#{comActEasyPhotoVO.keyWord},'%') |
| | | ) |
| | | </if> |
| | | GROUP BY |
| | |
| | | p.examine_at, |
| | | c.name communityName, |
| | | p.is_report_urban, |
| | | p.urban_status |
| | | p.urban_status, |
| | | ca.`name` as photoType |
| | | FROM |
| | | com_act_easy_photo p |
| | | LEFT JOIN sys_user u ON p.sponsor_id = u.user_id |
| | | LEFT JOIN com_act_easy_photo_user pu ON p.id = pu.easy_photo_id |
| | | LEFT JOIN sys_user su ON p.handler_id = su.user_id |
| | | left join com_act c on p.community_id =c.community_id |
| | | left join com_act_easy_photo_classify ca on ca.id = p.classify_id |
| | | WHERE |
| | | p.del_tag = 0 and p.`is_report_urban` =1 |
| | | <if test='communityId != null and communityId != 0'> |
| | |
| | | AND (u.`name` like concat(#{keyWord},'%') or |
| | | p.happen_addr like concat(#{keyWord},'%') or |
| | | su.`name` like concat(#{keyWord},'%') or |
| | | p.detail like concat(#{keyWord},'%') |
| | | p.detail like concat(#{keyWord},'%') or u.phone like concat(#{comActEasyPhotoVO.keyWord},'%') |
| | | ) |
| | | </if> |
| | | GROUP BY |
| | |
| | | p.examine_at, |
| | | c.name communityName, |
| | | p.is_report_urban, |
| | | p.urban_status |
| | | p.urban_status, |
| | | ca.`name` as photoType |
| | | FROM |
| | | com_act_easy_photo p |
| | | LEFT JOIN sys_user u ON p.sponsor_id = u.user_id |
| | | LEFT JOIN com_act_easy_photo_user pu ON p.id = pu.easy_photo_id |
| | | LEFT JOIN sys_user su ON p.handler_id = su.user_id |
| | | left join com_act c on p.community_id =c.community_id |
| | | left join com_act_easy_photo_classify ca on ca.id = p.classify_id |
| | | WHERE |
| | | p.id in |
| | | <foreach collection="list" item="ids" index="index" |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_community.dao.ComActReserveAnswerContentMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ComActReserveAnswerContentDO"> |
| | | <id column="id" property="id"/> |
| | | <result column="reserve_sub_id" property="reserveSubId"/> |
| | | <result column="reserve_selection_id" property="reserveSelectionId"/> |
| | | <result column="user_id" property="userId"/> |
| | | <result column="type" property="type"/> |
| | | <result column="choice" property="choice"/> |
| | | <result column="answer_content" property="answerContent"/> |
| | | <result column="create_by" property="createBy"/> |
| | | <result column="create_at" property="createAt"/> |
| | | <result column="update_by" property="updateBy"/> |
| | | <result column="update_at" property="updateAt"/> |
| | | <result column="reserve_record_id" property="reserveRecordId"/> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, reserve_sub_id, reserve_selection_id, user_id, type, choice, answer_content, create_by, create_at, update_by, update_at, reserve_record_id |
| | | </sql> |
| | | |
| | | <select id="selectListByReserve" resultType="com.panzhihua.service_community.model.dos.ComActReserveAnswerContentDO"> |
| | | SELECT |
| | | ac.* |
| | | FROM |
| | | com_act_reserve_answer_content ac |
| | | LEFT JOIN com_act_reserve_sub qs ON ac.reserve_sub_id = qs.id |
| | | LEFT JOIN com_act_reserve qn ON qs.reserve_id = qn.id |
| | | WHERE |
| | | qn.id = #{reserveId} |
| | | </select> |
| | | |
| | | <select id="pageRegisterDetailedListAdmin" parameterType="com.panzhihua.common.model.dtos.community.reserve.PageReserveRegisterDetailedAdminDTO" |
| | | resultType="com.panzhihua.common.model.vos.community.reserve.ComActReserveRegisterDetailedVO"> |
| | | SELECT |
| | | carr.id, |
| | | su.nick_name, |
| | | carr.create_at |
| | | FROM |
| | | com_act_reserve_record AS carr |
| | | LEFT JOIN sys_user AS su ON su.user_id = carr.user_id |
| | | WHERE |
| | | reserve_id = #{detailedAdminDTO.reserveId} |
| | | <if test='detailedAdminDTO.startTime != null and detailedAdminDTO.startTime != ""'> |
| | | AND carr.create_at <![CDATA[ >= ]]> #{detailedAdminDTO.startTime} |
| | | </if> |
| | | <if test='detailedAdminDTO.endTime != null and detailedAdminDTO.endTime != ""'> |
| | | AND carr.create_at <![CDATA[ <= ]]> #{detailedAdminDTO.endTime} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="getRegisterDetailedAnswerList" resultType="com.panzhihua.common.model.vos.community.reserve.ComActReserveRegisterDetailedAnswerVO"> |
| | | SELECT |
| | | car.content as reserveSubContent, carac.answer_content as answerContent,carac.reserve_sub_id as reserveSubId |
| | | FROM |
| | | com_act_reserve_answer_content AS carac |
| | | LEFT JOIN com_act_reserve_sub AS car ON car.reserve_id = carac.reserve_record_id |
| | | where carac.reserve_record_id = #{reserveRecordId} order by carac.id asc |
| | | </select> |
| | | |
| | | <select id="getRegisterDetailedById" resultType="com.panzhihua.common.model.vos.community.reserve.ComActReserveRegisterDetailedVO"> |
| | | SELECT |
| | | carr.id, |
| | | su.nick_name, |
| | | carr.create_at |
| | | FROM |
| | | com_act_reserve_record AS carr |
| | | LEFT JOIN sys_user AS su ON su.user_id = carr.user_id |
| | | where carr.id = #{reserveRecordId} |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_community.dao.ComActReserveMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ComActReserveDO"> |
| | | <id column="id" property="id"/> |
| | | <result column="community_id" property="communityId"/> |
| | | <result column="type" property="type"/> |
| | | <result column="title" property="title"/> |
| | | <result column="view_num" property="viewNum"/> |
| | | <result column="join_all_count" property="joinAllCount"/> |
| | | <result column="join_count" property="joinCount"/> |
| | | <result column="img_type" property="imgType"/> |
| | | <result column="img_url" property="imgUrl"/> |
| | | <result column="status" property="status"/> |
| | | <result column="publish_time" property="publishTime"/> |
| | | <result column="is_repeat" property="isRepeat"/> |
| | | <result column="remark" property="remark"/> |
| | | <result column="json_object" property="jsonObject"/> |
| | | <result column="adver_position_top" property="adverPositionTop"/> |
| | | <result column="adver_position_application" property="adverPositionApplication"/> |
| | | <result column="create_at" property="createAt"/> |
| | | <result column="create_by" property="createBy"/> |
| | | <result column="update_at" property="updateAt"/> |
| | | <result column="update_by" property="updateBy"/> |
| | | <result column="end_time" property="endTime"/> |
| | | <result column="is_del" property="isDel"/> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, community_id, type, title, view_num, join_all_count, join_count, img_type, img_url, status, publish_time, is_repeat, remark, json_object, adver_position_top, adver_position_application, create_at, create_by, update_at, update_by, end_time, is_del |
| | | </sql> |
| | | |
| | | <select id="indexBanner" resultType="com.panzhihua.common.model.vos.community.ComActReserveIndexVo"> |
| | | select id,title,type,img_type, img_url,adver_position_top, adver_position_application from com_act_reserve |
| | | where |
| | | status = 2 and adver_position_top = 1 |
| | | <if test="communityId !=null"> |
| | | and community_id =#{communityId} |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | <select id="indexApplication" resultType="com.panzhihua.common.model.vos.community.ComActReserveIndexVo"> |
| | | select id,title,type,img_type, img_url,adver_position_top, adver_position_application from com_act_reserve |
| | | <where> |
| | | status = 2 and adver_position_application = 1 |
| | | <if test="communityId !=null"> |
| | | and community_id =#{communityId} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="pageReserveAdmin" parameterType="com.panzhihua.common.model.dtos.community.reserve.PageReserveAdminDTO" |
| | | resultType="com.panzhihua.common.model.vos.community.reserve.ComActReserveListAdminVO"> |
| | | SELECT |
| | | id, |
| | | community_id, |
| | | `type`, |
| | | title, |
| | | view_num, |
| | | join_all_count, |
| | | join_count, |
| | | `status`, |
| | | publish_time, |
| | | create_at, |
| | | end_time, |
| | | adver_position_top, |
| | | adver_position_application |
| | | FROM |
| | | com_act_reserve |
| | | <where> |
| | | and is_del = 2 |
| | | <if test="pageReserveDTO.communityId != null"> |
| | | and community_id = #{pageReserveDTO.communityId} |
| | | </if> |
| | | <if test="pageReserveDTO.type != null and pageReserveDTO.type.size > 0"> |
| | | and `type` in |
| | | <foreach collection='pageReserveDTO.type' item='id' index='index' open='(' close=')' separator=',' > |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | <if test="pageReserveDTO.status != null"> |
| | | and status = #{pageReserveDTO.status} |
| | | </if> |
| | | <if test="pageReserveDTO.advertType != null and pageReserveDTO.advertType == 1"> |
| | | and adver_position_top = 2 and adver_position_application = 2 |
| | | </if> |
| | | <if test="pageReserveDTO.advertType != null and pageReserveDTO.advertType == 2"> |
| | | and adver_position_top = 1 |
| | | </if> |
| | | <if test="pageReserveDTO.advertType != null and pageReserveDTO.advertType == 3"> |
| | | and adver_position_application = 1 |
| | | </if> |
| | | <if test="pageReserveDTO.keyWord != null and pageReserveDTO.keyWord != """> |
| | | and title like concat (#{pageReserveDTO.keyWord},'%') |
| | | </if> |
| | | <if test="pageReserveDTO.startTime != null and pageReserveDTO.startTime != """> |
| | | AND DATE_FORMAT(create_at,'%Y-%m-%d %H:%i:%s') <![CDATA[ >= ]]> #{pageReserveDTO.startTime} |
| | | </if> |
| | | <if test="pageReserveDTO.endTime != null and pageReserveDTO.endTime != """> |
| | | AND DATE_FORMAT(create_at,'%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> #{pageReserveDTO.endTime} |
| | | </if> |
| | | </where> |
| | | order by create_at desc |
| | | </select> |
| | | |
| | | <delete id="deleteReserveSubAll"> |
| | | delete from com_act_reserve_sub where reserve_id = #{reserveId}; |
| | | delete from com_act_reserve_sub_selection where reserve_id = #{reserveId}; |
| | | </delete> |
| | | |
| | | <select id="getReserveMakeLeftStatistics" resultType="com.panzhihua.common.model.vos.community.reserve.ComActReserveMakeLeftStatisticsAdminVO"> |
| | | SELECT |
| | | date_format( reserve_time, '%Y-%m-%d' ) AS reserveTime, |
| | | count( id ) AS count |
| | | FROM |
| | | com_act_reserve_record |
| | | WHERE |
| | | `status` = 2 |
| | | AND type = 1 |
| | | AND community_id = #{communityId} |
| | | |
| | | group by reserveTime |
| | | </select> |
| | | |
| | | <select id="getReserveMakeRightStatistics" parameterType="com.panzhihua.common.model.dtos.community.reserve.ComActReserveMakeStatisticsDTO" |
| | | resultType="com.panzhihua.common.model.vos.community.reserve.ComActReserveMakeRightStatisticsAdminVO"> |
| | | SELECT |
| | | date_format( carr.reserve_time, '%Y-%m-%d' ) AS reserveTime, |
| | | car.title AS title, |
| | | count( carr.id ) AS count |
| | | FROM |
| | | com_act_reserve_record AS carr |
| | | LEFT JOIN com_act_reserve AS car ON car.id = carr.reserve_id |
| | | WHERE |
| | | carr.`status` = 2 |
| | | AND carr.type = 1 |
| | | AND carr.community_id = #{makeStatisticsDTO.communityId} |
| | | <if test="makeStatisticsDTO.startTime != null and makeStatisticsDTO.startTime != """> |
| | | AND carr.reserve_time <![CDATA[ >= ]]> #{makeStatisticsDTO.startTime} |
| | | </if> |
| | | <if test="makeStatisticsDTO.endTime != null and makeStatisticsDTO.endTime != """> |
| | | AND carr.reserve_time <![CDATA[ <= ]]> #{makeStatisticsDTO.endTime} |
| | | </if> |
| | | GROUP BY |
| | | reserveTime, |
| | | car.id |
| | | </select> |
| | | |
| | | <select id="getReserveRecordCount" resultType="integer"> |
| | | select count(id) from com_act_reserve_record |
| | | where `status` = 2 and `type` = 1 and community_id = #{communityId} |
| | | and reserve_time <![CDATA[ >= ]]> #{startTime} |
| | | and reserve_time <![CDATA[ <= ]]> #{endTime} |
| | | </select> |
| | | |
| | | <select id="listReserveAdmin" parameterType="com.panzhihua.common.model.dtos.community.reserve.PageReserveAdminDTO" |
| | | resultType="com.panzhihua.common.model.vos.community.reserve.ComActReserveListAdminVO"> |
| | | SELECT |
| | | id, |
| | | community_id, |
| | | `type`, |
| | | title, |
| | | view_num, |
| | | join_all_count, |
| | | join_count, |
| | | `status`, |
| | | publish_time, |
| | | create_at, |
| | | end_time, |
| | | adver_position_top, |
| | | adver_position_application |
| | | FROM |
| | | com_act_reserve |
| | | where is_del = 2 and `type` = 1 and community_id = #{communityId} |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_community.dao.ComActReserveOperationRecordMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ComActReserveOperationRecordDO"> |
| | | <id column="id" property="id"/> |
| | | <result column="reserve_id" property="reserveId"/> |
| | | <result column="reserve_record_id" property="reserveRecordId"/> |
| | | <result column="user_id" property="userId"/> |
| | | <result column="type" property="type"/> |
| | | <result column="phone" property="phone"/> |
| | | <result column="reserve_time" property="reserveTime"/> |
| | | <result column="reserve_content" property="reserveContent"/> |
| | | <result column="remark" property="remark"/> |
| | | <result column="status" property="status"/> |
| | | <result column="create_at" property="createAt"/> |
| | | <result column="create_by" property="createBy"/> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, reserve_id, reserve_record_id, user_id, type, phone, reserve_time, reserve_content, remark, status, create_at, create_by |
| | | </sql> |
| | | |
| | | |
| | | <select id="getMakeOperationList" resultType="com.panzhihua.common.model.vos.community.reserve.ComActReserveMakeOperationAdminVO"> |
| | | SELECT |
| | | caror.reserve_id, |
| | | caror.reserve_record_id, |
| | | caror.create_at, |
| | | caror.type, |
| | | caror.`status`, |
| | | caror.reserve_time, |
| | | caror.reserve_content, |
| | | su.`name`, |
| | | su.phone, |
| | | caror.remark, |
| | | su1.`name` as createByName |
| | | FROM |
| | | com_act_reserve_operation_record AS caror |
| | | left join sys_user as su on su.user_id = caror.user_id |
| | | left join sys_user as su1 on su1.user_id = caror.create_by |
| | | where caror.reserve_record_id = #{reserveRecordId} |
| | | order by caror.create_at desc |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_community.dao.ComActReserveRecordMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ComActReserveRecordDO"> |
| | | <id column="id" property="id"/> |
| | | <result column="user_id" property="userId"/> |
| | | <result column="reserve_id" property="reserveId"/> |
| | | <result column="community_id" property="communityId"/> |
| | | <result column="type" property="type"/> |
| | | <result column="name" property="name"/> |
| | | <result column="phone" property="phone"/> |
| | | <result column="status" property="status"/> |
| | | <result column="content" property="content"/> |
| | | <result column="remark" property="remark"/> |
| | | <result column="act_remark" property="actRemark"/> |
| | | <result column="reserve_time" property="reserveTime"/> |
| | | <result column="json_object" property="jsonObject"/> |
| | | <result column="create_at" property="createAt"/> |
| | | <result column="create_by" property="createBy"/> |
| | | <result column="update_at" property="updateAt"/> |
| | | <result column="update_by" property="updateBy"/> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, user_id, reserve_id, community_id, type, name, phone, status, content, remark, act_remark, reserve_time, json_object, create_at, create_by, update_at, update_by |
| | | </sql> |
| | | |
| | | <select id="pageReserveList" resultType="com.panzhihua.common.model.vos.community.reserve.ComActReserveRecordListVO"> |
| | | select t.*,t1.title from com_act_reserve_record t left join com_act_reserve t1 on t.reserve_id = t1.id |
| | | <where> |
| | | 1=1 |
| | | <if test="pageUserReserveDTO.type !=null"> |
| | | and t.type =#{pageUserReserveDTO.type} |
| | | </if> |
| | | <if test="pageUserReserveDTO.status !=null"> |
| | | and t.status =#{pageUserReserveDTO.status} |
| | | </if> |
| | | <if test="pageUserReserveDTO.userId !=null"> |
| | | and t.user_id =#{pageUserReserveDTO.userId} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="pageMakeAdmin" parameterType="com.panzhihua.common.model.dtos.community.reserve.PageReserveMakeAdminDTO" |
| | | resultType="com.panzhihua.common.model.vos.community.reserve.ComActReserveMakeListAdminVO"> |
| | | SELECT |
| | | carr.id, |
| | | su.nick_name, |
| | | carr.`name`, |
| | | carr.phone, |
| | | carr.reserve_time, |
| | | carr.`content`, |
| | | carr.remark, |
| | | carr.act_remark, |
| | | carr.create_at |
| | | FROM |
| | | com_act_reserve_record AS carr |
| | | LEFT JOIN sys_user AS su ON su.user_id = carr.user_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} |
| | | </if> |
| | | <if test="pageMakeDTO.endTime != null and pageMakeDTO.endTime != """> |
| | | AND carr.reserve_time <![CDATA[ <= ]]> #{pageMakeDTO.endTime} |
| | | </if> |
| | | order by carr.create_at desc |
| | | </select> |
| | | |
| | | <select id="getMakeDetailAdmin" resultType="com.panzhihua.common.model.vos.community.reserve.ComActReserveMakeDetailAdminVO"> |
| | | SELECT |
| | | carr.id, |
| | | su.nick_name, |
| | | carr.`name`, |
| | | carr.phone, |
| | | carr.reserve_time, |
| | | carr.`content`, |
| | | carr.remark, |
| | | carr.act_remark, |
| | | carr.create_at |
| | | FROM |
| | | com_act_reserve_record AS carr |
| | | LEFT JOIN sys_user AS su ON su.user_id = carr.user_id |
| | | where carr.id = #{reserveRecordId} |
| | | </select> |
| | | |
| | | <select id="getReserveStatusById" resultType="integer"> |
| | | select count(id) from com_act_reserve_record where `status` != 2 and id in |
| | | <foreach collection='ids' item='id' index='index' open='(' close=')' separator=',' > |
| | | #{id} |
| | | </foreach> |
| | | </select> |
| | | |
| | | <update id="editReserveStatusById"> |
| | | update com_act_reserve_record set `status` = 4 where id in |
| | | <foreach collection='ids' item='id' index='index' open='(' close=')' separator=',' > |
| | | #{id} |
| | | </foreach> |
| | | </update> |
| | | |
| | | <select id="exportMakeAdmin" parameterType="com.panzhihua.common.model.dtos.community.reserve.PageReserveMakeAdminDTO" |
| | | resultType="com.panzhihua.common.model.vos.community.reserve.ComActReserveMakeListAdminVO"> |
| | | SELECT |
| | | carr.id, |
| | | su.nick_name, |
| | | carr.`name`, |
| | | carr.phone, |
| | | carr.reserve_time, |
| | | carr.`content`, |
| | | carr.remark, |
| | | carr.act_remark, |
| | | carr.create_at |
| | | FROM |
| | | com_act_reserve_record AS carr |
| | | LEFT JOIN sys_user AS su ON su.user_id = carr.user_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} |
| | | </if> |
| | | <if test="pageMakeDTO.endTime != null and pageMakeDTO.endTime != """> |
| | | AND carr.reserve_time <![CDATA[ <= ]]> #{pageMakeDTO.endTime} |
| | | </if> |
| | | <if test="pageMakeDTO.ids != null and pageMakeDTO.ids.size > 0"> |
| | | AND carr.id in |
| | | <foreach collection='pageMakeDTO.ids' item='id' index='index' open='(' close=')' separator=',' > |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | order by carr.create_at desc |
| | | </select> |
| | | |
| | | <select id="registerStatisticsAdmin" parameterType="com.panzhihua.common.model.dtos.community.reserve.ComActReserveRegisterStatisticsDTO" |
| | | resultType="com.panzhihua.common.model.vos.community.reserve.ComActReserveRegisterStatisticsAdminVO"> |
| | | SELECT |
| | | car.title, |
| | | count( carr.id ) AS count, |
| | | ( SELECT count( id ) FROM com_act_reserve_record WHERE `type` = 2 AND community_id = #{registerStatisticsDTO.communityId} AND `status` = 2 ) AS allCount |
| | | FROM |
| | | com_act_reserve_record AS carr |
| | | LEFT JOIN com_act_reserve AS car ON car.id = carr.reserve_id |
| | | WHERE |
| | | carr.type = 2 |
| | | AND carr.community_id = #{registerStatisticsDTO.communityId} |
| | | AND carr.`status` = 2 |
| | | <if test="registerStatisticsDTO.startTime != null and registerStatisticsDTO.startTime != """> |
| | | AND DATE_FORMAT(carr.create_at,'%Y-%m-%d %H:%i:%s') <![CDATA[ >= ]]> #{registerStatisticsDTO.startTime} |
| | | </if> |
| | | <if test="registerStatisticsDTO.endTime != null and registerStatisticsDTO.endTime != """> |
| | | AND DATE_FORMAT(carr.create_at,'%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> #{registerStatisticsDTO.endTime} |
| | | </if> |
| | | GROUP BY |
| | | car.id |
| | | </select> |
| | | |
| | | <select id="registerStatisticsExportAdmin" parameterType="com.panzhihua.common.model.dtos.community.reserve.ComActReserveRegisterStatisticsDTO" |
| | | resultType="com.panzhihua.common.model.vos.community.reserve.ComActReserveRegisterStatisticsAdminVO"> |
| | | SELECT |
| | | car.title, |
| | | count( carr.id ) AS count, |
| | | ( SELECT count( id ) FROM com_act_reserve_record WHERE `type` = 2 AND community_id = #{registerStatisticsDTO.communityId} AND `status` = 2 ) AS allCount |
| | | FROM |
| | | com_act_reserve_record AS carr |
| | | LEFT JOIN com_act_reserve AS car ON car.id = carr.reserve_id |
| | | WHERE |
| | | carr.type = 2 |
| | | AND carr.community_id = #{registerStatisticsDTO.communityId} |
| | | AND carr.`status` = 2 |
| | | <if test="registerStatisticsDTO.startTime != null and registerStatisticsDTO.startTime != """> |
| | | AND DATE_FORMAT(carr.create_at,'%Y-%m-%d %H:%i:%s') <![CDATA[ >= ]]> #{registerStatisticsDTO.startTime} |
| | | </if> |
| | | <if test="registerStatisticsDTO.endTime != null and registerStatisticsDTO.endTime != """> |
| | | AND DATE_FORMAT(carr.create_at,'%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> #{registerStatisticsDTO.endTime} |
| | | </if> |
| | | GROUP BY |
| | | car.id |
| | | </select> |
| | | |
| | | <select id="pageMakeHandleAdmin" parameterType="com.panzhihua.common.model.dtos.community.reserve.PageReserveMakeHandleAdminDTO" |
| | | resultType="com.panzhihua.common.model.vos.community.reserve.ComActReserveMakeHandleListAdminVO"> |
| | | SELECT |
| | | carr.id, |
| | | su.nick_name, |
| | | carr.`name`, |
| | | carr.phone, |
| | | carr.reserve_time, |
| | | carr.`content`, |
| | | carr.remark, |
| | | carr.act_remark, |
| | | carr.`status`, |
| | | car.`title`, |
| | | carr.create_at |
| | | FROM |
| | | com_act_reserve_record AS carr |
| | | LEFT JOIN sys_user AS su ON su.user_id = carr.user_id |
| | | LEFT JOIN com_act_reserve AS car ON car.id = carr.reserve_id |
| | | WHERE |
| | | carr.`type` = 1 |
| | | <if test="pageMakeHandleDTO.keyWord != null and pageMakeHandleDTO.keyWord != """> |
| | | and (car.`title` like concat (#{pageMakeHandleDTO.keyWord},'%') |
| | | or carr.`name` like concat (#{pageMakeHandleDTO.keyWord},'%') |
| | | or su.nick_name like concat (#{pageMakeHandleDTO.keyWord},'%')) |
| | | </if> |
| | | <if test="pageMakeHandleDTO.status != null and pageMakeHandleDTO.status.size > 0"> |
| | | and carr.`status` in |
| | | <foreach collection='pageMakeHandleDTO.status' item='id' index='index' open='(' close=')' separator=',' > |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | <if test="pageMakeHandleDTO.reserveId != null "> |
| | | and carr.reserve_id = #{pageMakeHandleDTO.reserveId} |
| | | </if> |
| | | <if test="pageMakeHandleDTO.communityId != null "> |
| | | and carr.community_id = #{pageMakeHandleDTO.communityId} |
| | | </if> |
| | | <if test="pageMakeHandleDTO.startTime != null and pageMakeHandleDTO.startTime != """> |
| | | AND DATE_FORMAT(carr.reserve_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ >= ]]> #{pageMakeHandleDTO.startTime} |
| | | </if> |
| | | <if test="pageMakeHandleDTO.endTime != null and pageMakeHandleDTO.endTime != """> |
| | | AND DATE_FORMAT(carr.reserve_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> #{pageMakeHandleDTO.endTime} |
| | | </if> |
| | | order by carr.create_at desc |
| | | </select> |
| | | |
| | | <select id="getReserveListCountByIds" resultType="integer"> |
| | | select count(id) from com_act_reserve_record where `status` != 1 and `type` = 1 and id in |
| | | <foreach collection='ids' item='id' index='index' open='(' close=')' separator=',' > |
| | | #{id} |
| | | </foreach> |
| | | </select> |
| | | |
| | | <select id="exportMakeHandleAdmin" parameterType="com.panzhihua.common.model.dtos.community.reserve.PageReserveMakeHandleAdminDTO" |
| | | resultType="com.panzhihua.common.model.vos.community.reserve.ComActReserveMakeHandleListAdminVO"> |
| | | SELECT |
| | | carr.id, |
| | | su.nick_name, |
| | | carr.`name`, |
| | | carr.phone, |
| | | carr.reserve_time, |
| | | carr.`content`, |
| | | carr.remark, |
| | | carr.act_remark, |
| | | carr.`status`, |
| | | car.`title`, |
| | | carr.create_at |
| | | FROM |
| | | com_act_reserve_record AS carr |
| | | LEFT JOIN sys_user AS su ON su.user_id = carr.user_id |
| | | LEFT JOIN com_act_reserve AS car ON car.id = carr.reserve_id |
| | | WHERE |
| | | carr.`type` = 1 |
| | | <if test="pageMakeHandleDTO.keyWord != null and pageMakeHandleDTO.keyWord != """> |
| | | and (car.`title` like concat (#{pageMakeHandleDTO.keyWord},'%') |
| | | or carr.`name` like concat (#{pageMakeHandleDTO.keyWord},'%') |
| | | or su.nick_name like concat (#{pageMakeHandleDTO.keyWord},'%')) |
| | | </if> |
| | | <if test="pageMakeHandleDTO.status != null and pageMakeHandleDTO.status.size > 0"> |
| | | and carr.`status` in |
| | | <foreach collection='pageMakeHandleDTO.status' item='id' index='index' open='(' close=')' separator=',' > |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | <if test="pageMakeHandleDTO.reserveId != null "> |
| | | and carr.reserve_id = #{pageMakeHandleDTO.reserveId} |
| | | </if> |
| | | <if test="pageMakeHandleDTO.communityId != null "> |
| | | and carr.community_id = #{pageMakeHandleDTO.communityId} |
| | | </if> |
| | | <if test="pageMakeHandleDTO.startTime != null and pageMakeHandleDTO.startTime != """> |
| | | AND DATE_FORMAT(carr.reserve_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ >= ]]> #{pageMakeHandleDTO.startTime} |
| | | </if> |
| | | <if test="pageMakeHandleDTO.endTime != null and pageMakeHandleDTO.endTime != """> |
| | | AND DATE_FORMAT(carr.reserve_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> #{pageMakeHandleDTO.endTime} |
| | | </if> |
| | | <if test="pageMakeHandleDTO.ids != null and pageMakeHandleDTO.ids.size > 0"> |
| | | and carr.id in |
| | | <foreach collection='pageMakeHandleDTO.ids' item='id' index='index' open='(' close=')' separator=',' > |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | order by carr.create_at desc |
| | | </select> |
| | | |
| | | <select id="getRegisterDetailedByRecordId" resultType="com.panzhihua.common.model.vos.community.reserve.ComActReserveRegisterDetailedVO"> |
| | | SELECT |
| | | carr.create_at, |
| | | carr.id, |
| | | su.nick_name, |
| | | su.is_partymember, |
| | | su.is_volunteer |
| | | FROM |
| | | com_act_reserve_record AS carr |
| | | LEFT JOIN sys_user AS su ON su.user_id = carr.user_id |
| | | where carr.id = #{reserveRecordId} |
| | | </select> |
| | | |
| | | <select id="queryAll" resultType="com.panzhihua.common.model.vos.community.reserve.ComOperationListVO" parameterType="com.panzhihua.common.model.dtos.community.OperationDetailDTO"> |
| | | select * from com_act_reserve_operation_record |
| | | <where> |
| | | <if test="reserveRecordId!=null"> |
| | | and reserve_record_id =#{reserveRecordId} |
| | | </if> |
| | | <if test="userId!=null"> |
| | | and user_id =#{userId} |
| | | </if> |
| | | <if test="type!=null"> |
| | | and type =#{type} |
| | | </if> |
| | | </where> |
| | | order by create_at desc |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_community.dao.ComActReserveSubMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ComActReserveSubDO"> |
| | | <id column="id" property="id"/> |
| | | <result column="reserve_id" property="reserveId"/> |
| | | <result column="sort" property="sort"/> |
| | | <result column="type" property="type"/> |
| | | <result column="key" property="key"/> |
| | | <result column="content" property="content"/> |
| | | <result column="create_by" property="createBy"/> |
| | | <result column="create_at" property="createAt"/> |
| | | <result column="update_by" property="updateBy"/> |
| | | <result column="update_at" property="updateAt"/> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, reserve_id, sort, type, key, content, create_by, create_at, update_by, update_at |
| | | </sql> |
| | | |
| | | <select id="getReserveSubjectList" resultType="com.panzhihua.common.model.vos.community.reserve.ComActReserveSubListVO"> |
| | | select id,content from com_act_reserve_sub where reserve_id = #{reserveId} order by id asc |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_community.dao.ComActReserveSubSelectionMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ComActReserveSubSelectionDO"> |
| | | <id column="id" property="id" /> |
| | | <result column="reserve_id" property="reserveId" /> |
| | | <result column="reserve_sub_id" property="reserveSubId" /> |
| | | <result column="key" property="key" /> |
| | | <result column="type" property="type" /> |
| | | <result column="sort" property="sort" /> |
| | | <result column="option_name" property="optionName" /> |
| | | <result column="content" property="content" /> |
| | | <result column="create_at" property="createAt" /> |
| | | <result column="create_by" property="createBy" /> |
| | | <result column="update_at" property="updateAt" /> |
| | | <result column="update_by" property="updateBy" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, reserve_id, reserve_sub_id, key, type, sort, option_name, content, create_at, create_by, update_at, update_by |
| | | </sql> |
| | | |
| | | </mapper> |
| | |
| | | |
| | | <select id="exportDangerReport" resultType="com.panzhihua.common.model.vos.community.ComSwDangerReportExcelVO" parameterType="java.util.List"> |
| | | SELECT |
| | | cspr.person_name AS personName, |
| | | cspr.person_phone AS personPhone, |
| | | cspr.person_name AS ppersonName, |
| | | cspr.person_phone AS ppersonPhone, |
| | | cspr.address, |
| | | csdr.remark, |
| | | csdr.dager_description AS dagerDescription, |
| | | csdr.danger_type AS dangerType, |
| | | csdr.danger_level AS dangerLevel |
| | | case csdr.danger_type |
| | | when '1' then '火灾隐患' |
| | | when '2' then '汛情隐患' |
| | | when '3' then '疫情隐患' |
| | | end |
| | | AS dangerType, |
| | | case csdr.status |
| | | when '1' then '待处理' |
| | | when '2' then '待整改' |
| | | when '3' then '已整改' |
| | | end |
| | | AS status, |
| | | case csdr.danger_level |
| | | when '1' then '红色预警' |
| | | when '2' then '橙色预警' |
| | | when '3' then '黄色预警' |
| | | when '4' then '蓝色预警' |
| | | end |
| | | AS dangerLevel, |
| | | cspr.create_at AS createAt, |
| | | csdr.rectify_person AS dpersonName, |
| | | csdr.rectify_time AS rectifyTime |
| | | FROM |
| | | com_sw_danger_report as csdr |
| | | left join com_sw_patrol_record_report as csprr on csprr.report_id = csdr.id |
| | |
| | | log.info("执行结果【{}】", r.toString()); |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | /** |
| | | * 定时任务针对活动结束后7天还未评价的用户默认好评 |
| | | */ |
| | | @XxlJob("timedTaskActivityDefaultPraiseJobHandler") |
| | | public ReturnT<String> timedTaskActivityDefaultPraiseJobHandler(String param) throws Exception { |
| | | log.info("定时任务针对活动结束后7天还未评价的用户默认好评"); |
| | | R r = communityService.timedTaskActivityDefaultPraise(); |
| | | log.info("执行结果【{}】", r.toString()); |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | } |