New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.AddComActDynTypeDTO; |
| | | import com.panzhihua.common.model.dtos.community.EditComActDynTypeDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageComActDynTypeDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActDynTypeVO; |
| | | 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.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | import static java.util.Objects.isNull; |
| | | |
| | | @Slf4j |
| | | @Api(tags = {"社区动态分类模块"}) |
| | | @RestController |
| | | @RequestMapping("/dyn/type/") |
| | | public class ActDynTypeApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @ApiOperation(value = "查询社区动态分类列表", response = ComActDynTypeVO.class) |
| | | @PostMapping("/list") |
| | | public R list(@RequestBody PageComActDynTypeDTO comActDynTypeDTO) { |
| | | // comActDynTypeDTO.setCommunityId(this.getCommunityId()+""); |
| | | // return communityService.getDynTypeListByAdmin(comActDynTypeDTO); |
| | | return communityService.pageDynTypeByAdmin(comActDynTypeDTO); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 行政区划表(BcRegion)表控制层 |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * description: 行政区划表相关功能 |
| | | * |
| | | * @author zzj |
| | | * @since 2022-04-20 14:26:14 |
| | | */ |
| | | @Api(tags = {"行政区划"}) |
| | | @RestController |
| | | @RequestMapping("bcRegion") |
| | | public class BcRegionApi extends BaseController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @ApiOperation("四级联动接口") |
| | | @GetMapping("levelList") |
| | | public R levelList(@RequestParam("level")Integer level,@RequestParam("code")String code){ |
| | | return this.communityService.levelList(level,code); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.cluster.PageClusterMemberDto; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.cluster.PageClusterMemberVo; |
| | | import com.panzhihua.common.model.vos.community.cluster.PageClusterVo; |
| | | 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; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * title: 群团组织接口类 |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * description: 群团组织接口类 |
| | | * |
| | | * @author lyq |
| | | * @date 2021/9/23 16:12 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"群团组织"}) |
| | | @RestController |
| | | @RequestMapping("/cluster/") |
| | | public class ClusterApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @ApiOperation(value = "群团组织成员分页查询",response = PageClusterMemberVo.class) |
| | | @PostMapping("/member/page") |
| | | public R pageMemberClusterApplets(@RequestBody PageClusterMemberDto pageClusterMemberDto) { |
| | | pageClusterMemberDto.setCommunityId(this.getCommunityId()); |
| | | return communityService.pageClusterMemberApplets(pageClusterMemberDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "群团组织列表",response = PageClusterVo.class) |
| | | @GetMapping("list") |
| | | public R listClusterApplets() { |
| | | return communityService.listClusterApplets(this.getCommunityId()); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.acid.ComActAcidCheckRecordDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.acid.ComActAcidCheckRecordVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 排查跟进表(ComActAcidCheckRecord)表控制层 |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * description: 排查跟进表相关功能 |
| | | * |
| | | * @author zzj |
| | | * @since 2022-04-24 16:14:27 |
| | | */ |
| | | @Api(tags = {"排查跟进"}) |
| | | @RestController |
| | | @RequestMapping("comActAcidCheckRecord") |
| | | public class ComActAcidCheckRecordApi extends BaseController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | /** |
| | | * 列表查询 |
| | | * |
| | | * @param comActAcidCheckRecordDTO 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @ApiOperation(value = "分页查询",response = ComActAcidCheckRecordVO.class) |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody ComActAcidCheckRecordDTO comActAcidCheckRecordDTO) { |
| | | return this.communityService.selectAllComActAcidCheckRecord(comActAcidCheckRecordDTO); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @ApiOperation(value = "通过主键查询单条数据",response = ComActAcidCheckRecordVO.class) |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable("id") Long id) { |
| | | return this.communityService.selectOneComActAcidCheckRecord(id); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comActAcidCheckRecordVO 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @ApiOperation(value = "新增数据") |
| | | @PostMapping |
| | | public R insert(@RequestBody ComActAcidCheckRecordVO comActAcidCheckRecordVO) { |
| | | comActAcidCheckRecordVO.setUsername(this.getLoginUserInfo().getName()); |
| | | return this.communityService.insertComActAcidCheckRecord(comActAcidCheckRecordVO); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comActAcidCheckRecordVO 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @ApiOperation(value = "修改数据") |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody ComActAcidCheckRecordVO comActAcidCheckRecordVO) { |
| | | return this.communityService.updateComActAcidCheckRecord(comActAcidCheckRecordVO); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.acid.PageDangerMemberDTO; |
| | | import com.panzhihua.common.model.dtos.community.fms.PageFmsTeamDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.acid.ComActAcidDangerMemberVO; |
| | | import com.panzhihua.common.model.vos.community.fms.ComFmsTeamVO; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | |
| | | /** |
| | | * @title: ComActAcidDangerMemberApi |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: |
| | | * @author: hans |
| | | * @date: 2022/04/27 15:54 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"风险人员"}) |
| | | @RestController |
| | | @RequestMapping("comActAcidDangerMember") |
| | | public class ComActAcidDangerMemberApi extends BaseController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @ApiOperation(value = "分页查询风险人员", response = ComActAcidDangerMemberVO.class) |
| | | @PostMapping("/page") |
| | | public R pageDangerMember(@RequestBody @Valid PageDangerMemberDTO pageDangerMemberDTO) { |
| | | return communityService.pageDangerMember(pageDangerMemberDTO); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.acid.ComActAcidRecordDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.acid.ComActAcidCharts; |
| | | import com.panzhihua.common.model.vos.community.acid.ComActAcidRecordTimeVO; |
| | | import com.panzhihua.common.model.vos.community.acid.ComActAcidRecordVO; |
| | | import com.panzhihua.common.model.vos.community.reserve.FiveCount; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | 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.util.Date; |
| | | |
| | | /** |
| | | * (ComActAcidRecord)表控制层 |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * description: 相关功能 |
| | | * |
| | | * @author zzj |
| | | * @since 2022-04-12 15:29:59 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"防疫登记"}) |
| | | @RestController |
| | | @RequestMapping("comActAcidRecord") |
| | | public class ComActAcidRecordApi extends BaseController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param comActAcidRecordDTO 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @ApiOperation(value = "分页查询",response = ComActAcidRecordVO.class) |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody ComActAcidRecordDTO comActAcidRecordDTO) { |
| | | return this.communityService.selectAllComActAcidRecord(comActAcidRecordDTO); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @ApiOperation(value = "通过主键查询单条数据",response = ComActAcidRecordVO.class) |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable("id") Long id) { |
| | | return this.communityService.selectOneComActAcidRecord(id); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comActAcidRecord 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @ApiOperation(value = "新增数据") |
| | | @PostMapping |
| | | public R insert(@RequestBody ComActAcidRecordTimeVO comActAcidRecord) { |
| | | ComActAcidRecordVO comActAcidRecordVO=new ComActAcidRecordVO(); |
| | | BeanUtils.copyProperties(comActAcidRecord,comActAcidRecordVO); |
| | | comActAcidRecordVO.setUserId(this.getUserId()); |
| | | comActAcidRecordVO.setCreateTime(new Date()); |
| | | return this.communityService.insertComActAcidRecord(comActAcidRecordVO); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comActAcidRecordVO 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @ApiOperation(value = "修改数据") |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody ComActAcidRecordVO comActAcidRecordVO) { |
| | | comActAcidRecordVO.setUserId(this.getUserId()); |
| | | return this.communityService.updateComActAcidRecord(comActAcidRecordVO); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comActAcidRecordVO 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @ApiOperation(value = "修改数据") |
| | | @PostMapping("/updateApplets") |
| | | public R updateApplets(@RequestBody ComActAcidRecordVO comActAcidRecordVO) { |
| | | comActAcidRecordVO.setUserId(this.getUserId()); |
| | | return this.communityService.updateApplets(comActAcidRecordVO); |
| | | } |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @ApiOperation(value = "删除数据") |
| | | @GetMapping("del") |
| | | public R delete(@RequestParam("id") Long id) { |
| | | return this.communityService.deleteComActAcidRecord(id); |
| | | } |
| | | |
| | | /** |
| | | * 5项常规统计 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "7项常规统计",response = FiveCount.class) |
| | | @GetMapping("fiveCountPlus") |
| | | public R fiveCountPlus(@RequestParam("date")String date,@RequestParam("localCity") String localCity){ |
| | | return this.communityService.comActAcidRecordFiveCountPlus(date,localCity,null); |
| | | } |
| | | @ApiOperation(value = "新版查看详情",response = ComActAcidRecordVO.class) |
| | | @GetMapping("/detailByApp") |
| | | public R detailByApp(@RequestParam("id")Long id,@RequestParam("localCity")String localCity){ |
| | | return this.communityService.detailByApp(id,localCity); |
| | | } |
| | | |
| | | /** |
| | | * 图标统计 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "图标统计",response = ComActAcidCharts.class) |
| | | @GetMapping("charts") |
| | | public R charts(@RequestParam("date")String date,@RequestParam("localCity")String localCity){ |
| | | return this.communityService.charts(date,localCity); |
| | | } |
| | | @GetMapping("/checkCommit") |
| | | public R checkCommit(){ |
| | | return this.communityService.checkCommit(this.getUserId()); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.QRActivityCodeVO; |
| | | 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; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 签到二维码表(ComActActivityCode)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-15 15:23:10 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"活动二维码"}) |
| | | @RestController |
| | | @RequestMapping("comActActivityCode") |
| | | public class ComActActivityCodeApi extends BaseController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | /** |
| | | * 查看二维码 |
| | | * @param qrCodeVO |
| | | * @return |
| | | */ |
| | | @ApiOperation("查看二维码") |
| | | @PostMapping("/getQRCode") |
| | | public R getQRCode(@RequestBody QRActivityCodeVO qrCodeVO){ |
| | | return this.communityService.getQRCode(qrCodeVO); |
| | | } |
| | | |
| | | /** |
| | | * 重置二维码 |
| | | * @param qrCodeVO |
| | | * @return |
| | | */ |
| | | @ApiOperation("重置二维码") |
| | | @PostMapping("/resetQRCode") |
| | | public R resetQRCode(@RequestBody QRActivityCodeVO qrCodeVO){ |
| | | return this.communityService.resetQRCode(qrCodeVO); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActAnnouncementVO; |
| | | 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; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * (ComActAnnouncement)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-11-01 13:45:55 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"通知公告"}) |
| | | @RestController |
| | | @RequestMapping("comActAnnouncement") |
| | | public class ComActAnnouncementApi extends BaseController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @ApiOperation(value = "分页查询所有数据",response = ComActAnnouncementVO.class) |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | commonPage.setCommunityId(this.getCommunityId()); |
| | | return this.communityService.comActAnnouncementSelectAll(commonPage); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @ApiOperation("通过主键查询单条数据") |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable("id") Long id) { |
| | | return this.communityService.comActAnnouncementSelectOne(id); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comActAnnouncementVO 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @ApiOperation("新增数据") |
| | | @PostMapping |
| | | public R insert(@RequestBody ComActAnnouncementVO comActAnnouncementVO) { |
| | | comActAnnouncementVO.setCreateTime(new Date()); |
| | | comActAnnouncementVO.setCommunityId(this.getCommunityId()); |
| | | return this.communityService.comActAnnouncementInsert(comActAnnouncementVO); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comActAnnouncementVO 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @ApiOperation("修改数据") |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody ComActAnnouncementVO comActAnnouncementVO) { |
| | | return this.communityService.comActAnnouncementUpdate(comActAnnouncementVO); |
| | | } |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @ApiOperation("删除数据") |
| | | @GetMapping("del") |
| | | public R delete(@RequestParam("id") Long id) { |
| | | return this.communityService.comActAnnouncementDelete(id); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActColumnVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | 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; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 分类列表(ComActColumn)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-20 17:28:14 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"分类管理"}) |
| | | @RestController |
| | | @RequestMapping("comActColumn") |
| | | public class ComActColumnApi extends BaseController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @ApiOperation(value = "分页查询所有数据",response = ComActColumnVO.class) |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | return this.communityService.comActColumnSelectAll(commonPage); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @ApiOperation("通过主键查询单条数据") |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable("id") Long id) { |
| | | return this.communityService.comActColumnSelectOne(id); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comActColumnVO 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @ApiOperation("新增数据") |
| | | @PostMapping |
| | | public R insert(@RequestBody ComActColumnVO comActColumnVO) { |
| | | comActColumnVO.setStatus(1); |
| | | comActColumnVO.setCreateTime(new Date()); |
| | | if(StringUtils.isNotEmpty(this.getLoginUserInfo().getName())){ |
| | | comActColumnVO.setCreateBy(this.getLoginUserInfo().getName()); |
| | | } |
| | | return communityService.comActColumnInsert(comActColumnVO); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comActColumnVO 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @ApiOperation("修改数据") |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody ComActColumnVO comActColumnVO) { |
| | | comActColumnVO.setUpdateTime(new Date()); |
| | | if(StringUtils.isNotEmpty(this.getLoginUserInfo().getName())){ |
| | | comActColumnVO.setUpdateBy(this.getLoginUserInfo().getName()); |
| | | } |
| | | return this.communityService.comActColumnUpdate(comActColumnVO); |
| | | } |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @ApiOperation("删除数据") |
| | | @GetMapping("del") |
| | | public R delete(@RequestParam("id") Long id) { |
| | | return this.communityService.comActColumnDelete(id); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | |
| | | import org.springframework.util.ObjectUtils; |
| | | 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.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.dpc.PageDpcDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActDpcVO; |
| | | import com.panzhihua.common.model.vos.community.ComActEasyPhotoFeedbackVO; |
| | | import com.panzhihua.common.model.vos.community.ComActEasyPhotoVO; |
| | | import com.panzhihua.common.model.vos.user.SysUserNoticeVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | |
| | | /** |
| | | * @title: ComActDpcApi |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 人大代表 |
| | | * @author: hans |
| | | * @date: 2022/06/07 10:57 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"人大代表相关"}) |
| | | @RestController |
| | | @RequestMapping("/dpc") |
| | | public class ComActDpcApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | @ApiOperation(value = "获取人大代表详情", response = ComActDpcVO.class) |
| | | @ApiImplicitParam(name = "id", value = "人大代表id", required = true) |
| | | @GetMapping("/detail") |
| | | public R detailDpc(@RequestParam("id") Long id) { |
| | | return communityService.detailDpc(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询人大代表", response = ComActDpcVO.class) |
| | | @PostMapping("/page") |
| | | public R pageDpc(@RequestBody @Valid PageDpcDTO pageDpcDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (nonNull(loginUserInfo)) { |
| | | pageDpcDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | } else if (isNull(pageDpcDTO.getCommunityId())) { |
| | | return R.fail("未指定社区"); |
| | | } |
| | | return communityService.pageDpc(pageDpcDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取人大代表反馈记录", response = ComActEasyPhotoFeedbackVO.class) |
| | | @ApiImplicitParam(name = "id", value = "随手拍id", required = true) |
| | | @GetMapping("/feedback") |
| | | public R getFeedbackList(@RequestParam("id") Long id) { |
| | | return communityService.getFeedbackList(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "人大代表反馈随手拍") |
| | | @PostMapping("/feedback") |
| | | public R addFeedback(@RequestBody ComActEasyPhotoVO comActEasyPhotoVO) { |
| | | LoginUserInfoVO loginUserInfo = userService.getUserInfoByUserId(this.getLoginUserInfo().getUserId().toString()).getData(); |
| | | Integer isDpcMember = loginUserInfo.getIsDpcMember(); |
| | | if (isNull(isDpcMember) || !isDpcMember.equals(1)) { |
| | | return R.fail("暂无权限"); |
| | | } |
| | | Long userId = loginUserInfo.getUserId(); |
| | | Integer type = comActEasyPhotoVO.getType(); |
| | | if (null == type || type != 3) { |
| | | return R.fail("操作类型错误"); |
| | | } |
| | | Long id = comActEasyPhotoVO.getId(); |
| | | if (ObjectUtils.isEmpty(id)) { |
| | | return R.fail("随手拍主键不能为空"); |
| | | } |
| | | comActEasyPhotoVO.setUserId(userId); |
| | | R r = communityService.addEasyPhotoFeedbackForDpc(comActEasyPhotoVO); |
| | | if (R.isOk(r)) { |
| | | R r1 = communityService.detailEasyPhoto(id, userId); |
| | | if (R.isOk(r1)) { |
| | | ComActEasyPhotoVO comActEasyPhotoVO1 = |
| | | JSONObject.parseObject(JSONObject.toJSONString(r1.getData()), ComActEasyPhotoVO.class); |
| | | SysUserNoticeVO sysUserNoticeVO = new SysUserNoticeVO(); |
| | | sysUserNoticeVO.setUserId(comActEasyPhotoVO1.getSponsorId()); |
| | | sysUserNoticeVO.setType(2); |
| | | sysUserNoticeVO.setBusinessType(4); |
| | | sysUserNoticeVO.setBusinessTime(comActEasyPhotoVO1.getExamineAt()); |
| | | sysUserNoticeVO.setBusinessId(id); |
| | | sysUserNoticeVO.setStatus(0); |
| | | if (type.intValue() == 3) { |
| | | sysUserNoticeVO.setTitle("随手拍有反馈"); |
| | | sysUserNoticeVO.setBusinessTitle(comActEasyPhotoVO.getHandleResult()); |
| | | sysUserNoticeVO.setBusinessContent("社区已经处理好了具体的事宜,将变成现在更好看的样子找到更好的自己……"); |
| | | sysUserNoticeVO.setBusinessStatus(2); |
| | | R r2 = userService.addNotice(sysUserNoticeVO); |
| | | if (R.isOk(r2)) { |
| | | log.info("新增随手拍有反馈通知成功【{}】", JSONObject.toJSONString(sysUserNoticeVO)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return r; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | |
| | | 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.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.enterprise.AddEnterpriseDTO; |
| | | import com.panzhihua.common.model.dtos.community.enterprise.EditEnterpriseDTO; |
| | | import com.panzhihua.common.model.dtos.community.enterprise.PageEnterpriseDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActEnterpriseVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * @title: ComActEnterpriseApi |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 社区企业管理 |
| | | * @author: hans |
| | | * @date: 2022/05/31 10:22 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"社区企业管理"}) |
| | | @RestController |
| | | @RequestMapping("/enterprise") |
| | | public class ComActEnterpriseApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @ApiOperation("获取社区企业详情") |
| | | @ApiImplicitParam(name = "id", value = "社区企业id", required = true) |
| | | @GetMapping("/detail") |
| | | public R detailEnterprise(@RequestParam("id") Long id) { |
| | | return communityService.detailEnterprise(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询社区企业", response = ComActEnterpriseVO.class) |
| | | @PostMapping("/page") |
| | | public R pageEnterprise(@RequestBody @Valid PageEnterpriseDTO pageEnterpriseDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (nonNull(loginUserInfo)) { |
| | | pageEnterpriseDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | } else if (isNull(pageEnterpriseDTO.getCommunityId())) { |
| | | return R.fail("未指定社区"); |
| | | } |
| | | return communityService.pageEnterprise(pageEnterpriseDTO); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.*; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | 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.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; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * (ComActFourMember)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-09-23 10:13:31 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"四长四员"}) |
| | | @RestController |
| | | @RequestMapping("comActFourMember") |
| | | public class ComActFourMemberApi extends BaseController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @ApiOperation(value = "分页查询",response = ComActFourMemberVO.class) |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | commonPage.setParamId(this.getCommunityId()); |
| | | commonPage.setStatus(1); |
| | | return this.communityService.comActFourMemberSelectAll(commonPage); |
| | | } |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @ApiOperation(value = "分页查询",response = ComMngPopulationVO.class) |
| | | @PostMapping("queryMember") |
| | | public R selectMember(@RequestBody CommonPage commonPage) { |
| | | commonPage.setParamId(this.getCommunityId()); |
| | | return this.communityService.comActFourMemberQueryMember(commonPage); |
| | | } |
| | | |
| | | /** |
| | | *居民数据详情 |
| | | */ |
| | | @ApiOperation(value = "居民数据详情",response = FourMemberDetailVO.class) |
| | | @GetMapping("/memberDetail") |
| | | public R memberDetail(@RequestParam("id")Long id){ |
| | | return this.communityService.comActFourMemberMemberDetail(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "房屋级联菜单查询") |
| | | @PostMapping("/cascade/list") |
| | | public R getCascadeHouseAddress(@RequestBody CascadeHouseDTO cascadeHouseDTO) { |
| | | // 获取登陆用户绑定社区id |
| | | LoginUserInfoVO loginUser = this.getLoginUserInfo(); |
| | | if (loginUser != null) { |
| | | cascadeHouseDTO.setCommunityId(loginUser.getCommunityId()); |
| | | } |
| | | return communityService.getCascadeHouseAddress(cascadeHouseDTO); |
| | | } |
| | | |
| | | /** |
| | | * 查询房屋二级级联菜单 |
| | | * |
| | | * @param cascadeHouseDTO |
| | | * 请求参数 |
| | | * @return 菜单列表 |
| | | */ |
| | | @ApiOperation(value = "房屋级联菜单查询") |
| | | @PostMapping("/second/list") |
| | | public R getSecondHouseAddress(@RequestBody CascadeHouseDTO cascadeHouseDTO) { |
| | | cascadeHouseDTO.setCommunityId(this.getCommunityId()); |
| | | return communityService.getSecondHouseAddress(cascadeHouseDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询实有房屋列表", response = ComMngPopulationHouseAdminVO.class) |
| | | @PostMapping("/pageHouse") |
| | | public R pageHouse(@RequestBody ComMngPopulationHouseAdminDTO populationHouseAdminDTO) { |
| | | // 获取登陆用户绑定社区id |
| | | LoginUserInfoVO loginUser = this.getLoginUserInfo(); |
| | | if (loginUser != null) { |
| | | populationHouseAdminDTO.setCommunityId(loginUser.getCommunityId()); |
| | | } |
| | | return communityService.pageHouse(populationHouseAdminDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询实有房屋详情", response = ComMngPopulationHouseDetailAdminVO.class) |
| | | @PostMapping("/house/detail") |
| | | public R getHouseDetail(@RequestParam(value = "houseId") Long houseId) { |
| | | return communityService.getHouseDetail(houseId); |
| | | } |
| | | |
| | | /** |
| | | * 编辑实有房屋信息 |
| | | * |
| | | * @param comMngPopulationHouseUserVO |
| | | * 请求参数 |
| | | * @return 编辑结果 |
| | | */ |
| | | @ApiOperation(value = "编辑实有房屋信息") |
| | | @PostMapping("/population/house/user/edit") |
| | | public R editHouseUser(@RequestBody ComMngPopulationHouseUserVO comMngPopulationHouseUserVO) { |
| | | return communityService.editHouseUser(comMngPopulationHouseUserVO); |
| | | } |
| | | |
| | | /** |
| | | * 新增实有房屋信息 |
| | | * |
| | | * @param comMngPopulationHouseUserVO |
| | | * 请求参数 |
| | | * @return 编辑结果 |
| | | */ |
| | | @ApiOperation(value = "新增实有房屋信息") |
| | | @PostMapping("/population/house/user/insert") |
| | | public R insertHouseUser(@RequestBody ComMngPopulationHouseUserVO comMngPopulationHouseUserVO) { |
| | | return communityService.insertHouseUser(comMngPopulationHouseUserVO); |
| | | } |
| | | |
| | | /** |
| | | * 根据房屋id列表删除房屋信息 |
| | | * |
| | | * @param comMngPopulationHouseUserVO |
| | | * 请求参数 |
| | | * @return 删除结果 |
| | | */ |
| | | @ApiOperation(value = "删除实有房屋信息") |
| | | @PostMapping("/population/house/user/delete") |
| | | public R deleteHousesUser(@RequestBody ComMngPopulationHouseUserVO comMngPopulationHouseUserVO) { |
| | | return communityService.deleteHousesUser(comMngPopulationHouseUserVO); |
| | | } |
| | | |
| | | /** |
| | | * 根据id查询 |
| | | * |
| | | * @param id |
| | | * 请求参数 |
| | | * @return 删除结果 |
| | | */ |
| | | @ApiOperation(value = "id查询信息") |
| | | @GetMapping("/population/house/user/detail") |
| | | public R detailHousesUser(@RequestParam("id") Long id) { |
| | | return communityService.detailHousesUser(id); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.vos.community.integral.IntegralTradeVO; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.integral.ComActIntegralCommunityRankDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.integral.ComActIntegralCommunityRankVO; |
| | | import com.panzhihua.common.model.vos.community.integral.ComActIntegralCommunityTradeVO; |
| | | import com.panzhihua.common.model.vos.community.integral.ComActIntegralUserRuleVO; |
| | | import com.panzhihua.common.model.vos.community.integral.ComActIntegralUserVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/integral/") |
| | | @Api(tags = {"用户积分模块"}) |
| | | public class ComActIntegralUserApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @ApiOperation(value = "查询积分说明") |
| | | @GetMapping("/explain") |
| | | public R getIntegralExplain() { |
| | | return communityService.getIntegralExplainApplets(); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询社区领取积分列表", response = ComActIntegralUserRuleVO.class) |
| | | @PostMapping("/receive") |
| | | public R getIntegralReceive() { |
| | | LoginUserInfoVO userInfoVO = this.getLoginUserInfo(); |
| | | if (userInfoVO == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | return communityService.getIntegralReceiveApplets(userInfoVO.getUserId(), userInfoVO.getCommunityId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "积分统计", response = ComActIntegralUserVO.class) |
| | | @ApiImplicitParam(name = "communityId", value = "社区id") |
| | | @GetMapping("/user/statistics") |
| | | public R getIntegralUserList(@RequestParam(value = "communityId", required = false) Long communityId) { |
| | | LoginUserInfoVO userInfoVO = this.getLoginUserInfo(); |
| | | if (userInfoVO == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | return communityService.getIntegralUserListApplets(userInfoVO.getUserId(), communityId); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询我的积分余额", response = ComActIntegralUserVO.class) |
| | | @ApiImplicitParam(name = "communityId", value = "社区id", required = true) |
| | | @GetMapping("/user/balance") |
| | | public R getUserIntegralBalance(@RequestParam("communityId") Long communityId) { |
| | | LoginUserInfoVO userInfoVO = this.getLoginUserInfo(); |
| | | if (userInfoVO == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | return communityService.getUserIntegralBalance(userInfoVO.getUserId(), communityId); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取积分详情", response = IntegralTradeVO.class) |
| | | @ApiImplicitParam(name = "id", value = "积分明细id", required = true) |
| | | @GetMapping("/user/detail") |
| | | public R getUserIntegralDetail(@RequestParam("id") Long id) { |
| | | return communityService.getUserIntegralDetail(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询社区积分排行榜", response = ComActIntegralCommunityRankVO.class) |
| | | @PostMapping("/community/rank") |
| | | public R getIntegralCommunityRank(@RequestBody ComActIntegralCommunityRankDTO communityRankDTO) { |
| | | LoginUserInfoVO userInfoVO = this.getLoginUserInfo(); |
| | | if (userInfoVO == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | return communityService.getIntegralCommunityRankApplets(communityRankDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询用户积分明细", response = ComActIntegralCommunityTradeVO.class) |
| | | @PostMapping("/community/trade") |
| | | public R getIntegralCommunityTrade(@RequestBody ComActIntegralCommunityRankDTO communityTradeDTO) { |
| | | LoginUserInfoVO userInfoVO = this.getLoginUserInfo(); |
| | | if (userInfoVO == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | communityTradeDTO.setUserId(userInfoVO.getUserId()); |
| | | return communityService.getIntegralCommunityTradeApplets(communityTradeDTO); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | @RestController |
| | | @RequestMapping("/proceedings") |
| | | @Api(tags = "议事委员会") |
| | | public class ComActProceedings { |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @GetMapping("/list") |
| | | @ApiOperation("议事委员会列表") |
| | | public R list(@RequestParam("page")Integer page,@RequestParam("size")Integer size){ |
| | | return communityService.proceedingsList(page,size ,null ); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.raffle.ComActRaffleVO; |
| | | 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; |
| | | |
| | | /** |
| | | * 抽奖活动表(ComActRaffle)表控制层 |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * description: 抽奖活动表相关功能 |
| | | * |
| | | * @author zzj |
| | | * @since 2022-02-18 14:31:20 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"抽奖活动"}) |
| | | @RestController |
| | | @RequestMapping("comActRaffle") |
| | | public class ComActRaffleApi extends BaseController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @ApiOperation(value = "分页查询",response = ComActRaffleVO.class) |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | commonPage.setType(1); |
| | | return this.communityService.selectAllComActRaffle(commonPage); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @ApiOperation(value = "详情",response = ComActRaffleVO.class) |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable("id") Long id) { |
| | | return this.communityService.selectOneComActRaffle(id,this.getUserId()); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comActRaffleVO 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @ApiOperation(value = "新增数据") |
| | | @PostMapping |
| | | public R insert(@RequestBody ComActRaffleVO comActRaffleVO) { |
| | | comActRaffleVO.setCommunityId(this.getCommunityId()); |
| | | comActRaffleVO.setCreateBy(this.getUserId()); |
| | | return this.communityService.insertComActRaffle(comActRaffleVO); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comActRaffleVO 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @ApiOperation(value = "修改数据") |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody ComActRaffleVO comActRaffleVO) { |
| | | return this.communityService.updateComActRaffle(comActRaffleVO); |
| | | } |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @ApiOperation(value = "删除数据") |
| | | @GetMapping("del") |
| | | public R delete(@RequestParam("id") Long id) { |
| | | return this.communityService.deleteComActRaffle(id); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.raffle.ComActRaffleRecordVO; |
| | | import com.panzhihua.common.model.vos.community.warehouse.QRCodeVO; |
| | | 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.beans.BeanUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 抽奖活动中奖记录表(ComActRaffleRecord)表控制层 |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * description: 抽奖活动中奖记录表相关功能 |
| | | * |
| | | * @author zzj |
| | | * @since 2022-02-18 14:32:02 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"获奖记录"}) |
| | | @RestController |
| | | @RequestMapping("comActRaffleRecord") |
| | | public class ComActRaffleRecordApi extends BaseController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @ApiOperation(value = "分页查询",response = ComActRaffleRecordVO.class) |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | return this.communityService.selectAllComActRaffleRecord(commonPage); |
| | | } |
| | | @ApiOperation(value = "根据抽奖活动id获取奖品统计") |
| | | @GetMapping("/queryPrize") |
| | | public R queryPrize(@RequestParam("id")Long id){ |
| | | return this.communityService.queryPrize(id); |
| | | } |
| | | |
| | | /** |
| | | * 生成二维码 |
| | | * @param qrCodeVO |
| | | * @return |
| | | */ |
| | | @ApiOperation("生成二维码") |
| | | @PostMapping("/getQRCode") |
| | | public R getQRCode(@RequestBody QRCodeVO qrCodeVO){ |
| | | return this.communityService.getRaffleQRCode(qrCodeVO); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comActRaffleRecordVO 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @ApiOperation("核销接口") |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody ComActRaffleRecordVO comActRaffleRecordVO) { |
| | | comActRaffleRecordVO.setStaffId(this.getUserId()); |
| | | comActRaffleRecordVO.setStaffTime(new Date()); |
| | | comActRaffleRecordVO.setStatus(2); |
| | | return this.communityService.updateRaffleRecord(comActRaffleRecordVO); |
| | | } |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comActRaffleRecordVO 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @ApiOperation("参加活动") |
| | | @PostMapping |
| | | public R insert(@RequestBody ComActRaffleRecordVO comActRaffleRecordVO) { |
| | | comActRaffleRecordVO.setCreateTime(new Date()); |
| | | comActRaffleRecordVO.setUserId(this.getUserId()); |
| | | comActRaffleRecordVO.setStatus(0); |
| | | return communityService.insertRaffleRecord(comActRaffleRecordVO); |
| | | } |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @ApiOperation("详情") |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable("id") Long id) { |
| | | return this.communityService.selectOneRaffleRecord(id); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.ComActSocialMemberVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | 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; |
| | | |
| | | /** |
| | | * 社会组织成员表(ComActSocialMember)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-22 09:52:47 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"社会组织成员"}) |
| | | @RestController |
| | | @RequestMapping("comActSocialMember") |
| | | public class ComActSocialMemberApi extends BaseController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @ApiOperation(value = "分页查询所有数据",response = ComActSocialMemberVO.class) |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | return this.communityService.comActSocialMemberSelectAll(commonPage); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @ApiOperation("详情") |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable("id") Long id) { |
| | | return this.communityService.comActSocialMemberSelectOne(id); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comActSocialMember 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @ApiOperation("新增数据") |
| | | @PostMapping |
| | | public R insert(@RequestBody ComActSocialMemberVO comActSocialMember) { |
| | | return this.communityService.comActSocialMemberInsert(comActSocialMember); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comActSocialMember 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @ApiOperation("修改数据") |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody ComActSocialMemberVO comActSocialMember) { |
| | | return this.communityService.comActSocialMemberUpdate(comActSocialMember); |
| | | } |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @ApiOperation("删除数据") |
| | | @GetMapping("del") |
| | | public R delete(@RequestParam("id") Long id) { |
| | | return this.communityService.comActSocialMemberDelete(id); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActSocialOrgVO; |
| | | import com.panzhihua.common.model.vos.community.ComActVO; |
| | | 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; |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | |
| | | /** |
| | | * @author zzj |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"社会组织"}) |
| | | @RestController |
| | | @RequestMapping("/comActSocialOrg") |
| | | public class ComActSocialOrgApi extends BaseController { |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @ApiOperation(value = "社会组织列表", response = ComActSocialOrgVO.class) |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | LoginUserInfoVO loginUserInfoSureNoLogin = this.getLoginUserInfoSureNoLogin(); |
| | | if (nonNull(loginUserInfoSureNoLogin)) { |
| | | commonPage.setCommunityId(loginUserInfoSureNoLogin.getCommunityId()); |
| | | } else if (isNull(commonPage.getCommunityId())) { |
| | | return R.fail("缺少社区id"); |
| | | } |
| | | R r = communityService.detailCommunity(commonPage.getCommunityId()); |
| | | if (R.isOk(r)) { |
| | | ComActVO comActVO = JSONObject.parseObject(JSONObject.toJSONString(r.getData()), ComActVO.class); |
| | | if (comActVO != null) { |
| | | commonPage.setStreetId(comActVO.getStreetId()); |
| | | } |
| | | } |
| | | commonPage.setCommunityId(null); |
| | | return this.communityService.comActSocialOrgSelectAll(commonPage); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @ApiOperation("通过主键查询单条数据") |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable("id") Long id){ |
| | | return this.communityService.comActSocialOrgSelectOne(id); |
| | | } |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comActSocialOrg 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @ApiOperation("新增社会组织") |
| | | @PostMapping |
| | | public R insert(@RequestBody ComActSocialOrgVO comActSocialOrg) { |
| | | comActSocialOrg.setCommunityId(this.getCommunityId()); |
| | | return this.communityService.comActSocialOrgInsert(comActSocialOrg); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comActSocialOrg 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @ApiOperation("修改社会组织") |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody ComActSocialOrgVO comActSocialOrg) { |
| | | return this.communityService.comActSocialOrgUpdate(comActSocialOrg); |
| | | } |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @ApiOperation("删除社会组织") |
| | | @GetMapping("del") |
| | | public R delete(@RequestParam("id") Long id) { |
| | | return this.communityService.comActSocialOrgDelete(id); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.validation.annotation.Validated; |
| | | 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.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.social.HatchAuditProcessDTO; |
| | | import com.panzhihua.common.model.dtos.community.social.PageSocialOrgHatchAuditDTO; |
| | | import com.panzhihua.common.model.dtos.community.social.SocialOrgHatchAuditDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.social.SocialOrgHatchAuditVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.validated.PutGroup; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * @title: ComActSocialOrgHatchAuditApi |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 社会组织孵化申请相关 |
| | | * @author: hans |
| | | * @date: 2022/04/18 14:14 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"社会组织孵化申请"}) |
| | | @RestController |
| | | @RequestMapping("/comActSocialOrgHatchAudit") |
| | | public class ComActSocialOrgHatchAuditApi extends BaseController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @ApiOperation(value = "新增孵化申请") |
| | | @PostMapping("/add") |
| | | public R addHatchAudit(@RequestBody SocialOrgHatchAuditDTO hatchAuditDTO) { |
| | | hatchAuditDTO.setUserId(this.getUserId()); |
| | | return communityService.addHatchAudit(hatchAuditDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查看孵化申请审核进度", response = SocialOrgHatchAuditVO.class) |
| | | @GetMapping("/schedule") |
| | | public R getHatchAuditSchedule() { |
| | | return communityService.getHatchAuditSchedule(this.getUserId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "修改孵化申请") |
| | | @PostMapping("/update") |
| | | public R updateHatchAudit(@RequestBody @Validated(PutGroup.class) SocialOrgHatchAuditDTO hatchAuditDTO) { |
| | | return communityService.updateHatchAudit(hatchAuditDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取孵化流程配置", response = String.class) |
| | | @GetMapping("/process") |
| | | public R getHatchAuditProcess() { |
| | | return communityService.getHatchAuditProcess(); |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.social.PageProjectSignListDTO; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActSocialOrgVO; |
| | | import com.panzhihua.common.model.vos.community.social.SocialProjectVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | |
| | | /** |
| | | * 三社联动项目表(ComActSocialProject)表控制层 |
| | | * |
| | | * @author zzj |
| | | * @since 2021-12-22 14:02:48 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"项目管理"}) |
| | | @RestController |
| | | @RequestMapping("comActSocialProject") |
| | | public class ComActSocialProjectApi extends BaseController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @ApiOperation(value = "分页查询接口",response =SocialProjectVO.class ) |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | LoginUserInfoVO loginUserInfoSureNoLogin = this.getLoginUserInfoSureNoLogin(); |
| | | if (nonNull(loginUserInfoSureNoLogin)) { |
| | | commonPage.setCommunityId(loginUserInfoSureNoLogin.getCommunityId()); |
| | | commonPage.setStreetId(loginUserInfoSureNoLogin.getStreetId()); |
| | | } else if (isNull(commonPage.getCommunityId())) { |
| | | return R.fail("缺少社区id"); |
| | | } |
| | | commonPage.setParamId2(0); |
| | | // commonPage.setIsPublicity(1); |
| | | return communityService.selectAllComActSocialProject(commonPage); |
| | | } |
| | | |
| | | /** |
| | | * 平台详情接口 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @ApiOperation(value = "平台详情接口",response =SocialProjectVO.class ) |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable("id") Long id) { |
| | | LoginUserInfoVO userInfo = this.getLoginUserInfoSureNoLogin(); |
| | | Long userId = null; |
| | | if (nonNull(userInfo)) { |
| | | userId = userInfo.getUserId(); |
| | | } |
| | | return communityService.getAppletComActSocialProject(id, userId); |
| | | } |
| | | /** |
| | | * 根据项目id分页获取关联项目 |
| | | */ |
| | | @ApiOperation(value = "根据项目id分页获取关联项目") |
| | | @PostMapping("/getRelation") |
| | | public R getRelation(@RequestBody CommonPage commonPage){ |
| | | return communityService.getRelationComActSocialProject(commonPage); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param socialProjectVO 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @ApiOperation(value = "新增数据") |
| | | @PostMapping |
| | | public R insert(@RequestBody SocialProjectVO socialProjectVO) { |
| | | return communityService.insertComActSocialProject(socialProjectVO); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param socialProjectVO 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @ApiOperation(value = "修改数据") |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody SocialProjectVO socialProjectVO) { |
| | | return communityService.updateComActSocialProject(socialProjectVO); |
| | | } |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @ApiOperation(value = "删除数据") |
| | | @GetMapping("del") |
| | | public R delete(@RequestParam("id") Long id) { |
| | | return communityService.deleteComActSocialProject(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "项目公开报名") |
| | | @ApiImplicitParam(name = "projectId", value = "项目id", required = true) |
| | | @GetMapping("/sign") |
| | | public R signProject(@RequestParam("projectId") Long projectId) { |
| | | return communityService.signProject(projectId, this.getUserId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询项目报名列表", response = ComActSocialOrgVO.class) |
| | | @PostMapping("signList") |
| | | public R pageProjectSignList(@RequestBody @Valid PageProjectSignListDTO pageProjectSignListDTO) { |
| | | return communityService.pageProjectSignList(pageProjectSignListDTO); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.social.ComActSocialProjectMemberVO; |
| | | 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; |
| | | |
| | | /** |
| | | * 项目人员(ComActSocialProjectMember)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-23 15:16:43 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"项目成员管理"}) |
| | | @RestController |
| | | @RequestMapping("comActSocialProjectMember") |
| | | public class ComActSocialProjectMemberApi { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @ApiOperation("分页查询所有数据") |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | return communityService.selectAllComActSocialProjectMember(commonPage); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @ApiOperation("通过主键查询单条数据") |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable("id") Long id) { |
| | | return communityService.selectOneComActSocialProjectMember(id); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comActSocialProjectMemberVO 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @ApiOperation("新增数据") |
| | | @PostMapping |
| | | public R insert(@RequestBody ComActSocialProjectMemberVO comActSocialProjectMemberVO) { |
| | | return communityService.insertComActSocialProjectMember(comActSocialProjectMemberVO); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comActSocialProjectMemberVO 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @ApiOperation("修改数据") |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody ComActSocialProjectMemberVO comActSocialProjectMemberVO) { |
| | | return communityService.updateComActSocialProjectMember(comActSocialProjectMemberVO); |
| | | } |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @ApiOperation("删除") |
| | | @GetMapping("del") |
| | | public R delete(@RequestParam("id") Long id) { |
| | | return communityService.deleteComActSocialProjectMember(id); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.social.ComActSocialProjectPublicityVO; |
| | | 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; |
| | | import java.util.List; |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | |
| | | /** |
| | | * 项目宣传表(ComActSocialProjectPublicity)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-23 14:30:55 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"项目宣传管理"}) |
| | | @RestController |
| | | @RequestMapping("comActSocialProjectPublicity") |
| | | public class ComActSocialProjectPublicityApi extends BaseController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @ApiOperation(value = "分页查询",response = ComActSocialProjectPublicityVO.class) |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | LoginUserInfoVO loginUserInfoSureNoLogin = this.getLoginUserInfoSureNoLogin(); |
| | | if (nonNull(loginUserInfoSureNoLogin)) { |
| | | commonPage.setCommunityId(loginUserInfoSureNoLogin.getCommunityId()); |
| | | } else if (isNull(commonPage.getCommunityId())) { |
| | | return R.fail("缺少社区id"); |
| | | } |
| | | return communityService.selectAllComActSocialProjectPublicity(commonPage); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @ApiOperation("通过主键查询单条数据") |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable("id") Long id) { |
| | | return communityService.selectOneComActSocialProjectPublicity(id); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comActSocialProjectPublicityVO 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @ApiOperation("新增数据") |
| | | @PostMapping |
| | | public R insert(@RequestBody ComActSocialProjectPublicityVO comActSocialProjectPublicityVO) { |
| | | return communityService.insertComActSocialProjectPublicity(comActSocialProjectPublicityVO); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comActSocialProjectPublicityVO 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @ApiOperation("修改数据") |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody ComActSocialProjectPublicityVO comActSocialProjectPublicityVO) { |
| | | return communityService.updateComActSocialProjectPublicity(comActSocialProjectPublicityVO); |
| | | } |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @ApiOperation("删除数据") |
| | | @GetMapping("del") |
| | | public R delete(@RequestParam("id") Long id) { |
| | | return communityService.deleteComActSocialProjectPublicity(id); |
| | | } |
| | | /** |
| | | * 多条删除数据 |
| | | * |
| | | * @param ids 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @ApiOperation("多条删除数据") |
| | | @PostMapping("delBatch") |
| | | public R delBatch(@RequestBody List<Long> ids) { |
| | | return communityService.delBatchComActSocialProjectPublicity(ids); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.social.ComActSocialProjectScheduleVO; |
| | | 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; |
| | | |
| | | /** |
| | | * 项目进度表(ComActSocialProjectSchedule)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-23 14:31:16 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"项目进度管理"}) |
| | | @RestController |
| | | @RequestMapping("comActSocialProjectSchedule") |
| | | public class ComActSocialProjectScheduleApi { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | /** |
| | | * 根据projectId查询所有进度 |
| | | * |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @ApiOperation("分页查询") |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | return communityService.selectAllComActSocialProjectSchedule(commonPage); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @ApiOperation("通过主键查询单条数据") |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable("id") Long id) { |
| | | return communityService.selectOneComActSocialProjectSchedule(id); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comActSocialProjectScheduleVO 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @ApiOperation("新增数据") |
| | | @PostMapping |
| | | public R insert(@RequestBody ComActSocialProjectScheduleVO comActSocialProjectScheduleVO) { |
| | | return communityService.insertComActSocialProjectSchedule(comActSocialProjectScheduleVO); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comActSocialProjectScheduleVO 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @ApiOperation("修改数据") |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody ComActSocialProjectScheduleVO comActSocialProjectScheduleVO) { |
| | | return communityService.updateComActSocialProjectSchedule(comActSocialProjectScheduleVO); |
| | | } |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @ApiOperation("删除数据") |
| | | @GetMapping("del") |
| | | public R delete(@RequestParam("id") Long id) { |
| | | return communityService.deleteComActSocialProjectSchedule(id); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.listen.ComActSocialWorkerExcelListen; |
| | | import com.panzhihua.common.model.dtos.civil.*; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.civil.ComActSocialWorkerDetailsVO; |
| | | import com.panzhihua.common.model.vos.civil.ComActSocialWorkerVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.ClazzUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | |
| | | /** |
| | | * |
| | | * @author cedoo email:cedoo(a)qq.com |
| | | * @version 1.0 |
| | | * @since 1.0 |
| | | * @date 2021-06-03 |
| | | * */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/comactsocialworker") |
| | | @Api(tags = {"社工"}) |
| | | public class ComActSocialWorkerApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | // @Value("${excel.comactsocialworkerUrl}") |
| | | // private String comactsocialworkerUrl; |
| | | /** |
| | | * 新增社工 |
| | | * @param {classNameFirstLower}AddDTO 添加社工传递对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping() |
| | | @ApiOperation(value = "新增社工", response = R.class) |
| | | R add(@Validated @RequestBody ComActSocialWorkerAddDTO comActSocialWorkerAddDTO){ |
| | | ClazzUtils.setIfStringIsEmpty(comActSocialWorkerAddDTO); |
| | | comActSocialWorkerAddDTO.setUserId(getUserId()); |
| | | comActSocialWorkerAddDTO.setCommunityId(getCommunityId()); |
| | | return communityService.addComactsocialworker(comActSocialWorkerAddDTO); |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param comActSocialWorkerEditDTO 修改社工传递对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @PutMapping() |
| | | @ApiOperation(value = "编辑社工", response = R.class) |
| | | R edit(@Validated @RequestBody ComActSocialWorkerEditDTO comActSocialWorkerEditDTO){ |
| | | comActSocialWorkerEditDTO.setUserId(getUserId()); |
| | | return communityService.editComactsocialworker(comActSocialWorkerEditDTO); |
| | | } |
| | | |
| | | /** |
| | | * 分页查找 |
| | | * @param pageComActSocialWorkerDTO 查找社工传递对象 |
| | | * @return 查找结果 |
| | | */ |
| | | @GetMapping() |
| | | @ApiOperation(value = "查询社工", response= ComActSocialWorkerVO.class) |
| | | R query(@Validated @ModelAttribute PageComActSocialWorkerDTO pageComActSocialWorkerDTO){ |
| | | ClazzUtils.setIfStringIsEmpty(pageComActSocialWorkerDTO); |
| | | LoginUserInfoVO loginUserInfoSureNoLogin = this.getLoginUserInfoSureNoLogin(); |
| | | if (nonNull(loginUserInfoSureNoLogin)) { |
| | | pageComActSocialWorkerDTO.setCommunityId(loginUserInfoSureNoLogin.getCommunityId()); |
| | | } else if (isNull(pageComActSocialWorkerDTO.getCommunityId())) { |
| | | return R.fail("缺少社区id"); |
| | | } |
| | | return communityService.queryComactsocialworker(pageComActSocialWorkerDTO); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * @param comActSocialWorkerDeleteDTO 删除社工传递对象 |
| | | * @return 删除结果 |
| | | */ |
| | | @DeleteMapping() |
| | | @ApiOperation(value = "删除社工", response = R.class) |
| | | R delete(@Validated @RequestBody ComActSocialWorkerDeleteDTO comActSocialWorkerDeleteDTO){ |
| | | ClazzUtils.setIfStringIsEmpty(comActSocialWorkerDeleteDTO); |
| | | return communityService.deleteComactsocialworker(comActSocialWorkerDeleteDTO); |
| | | } |
| | | |
| | | /** |
| | | * 查询社工详细信息 |
| | | * @param id 社工 id |
| | | * @return 查找结果 |
| | | */ |
| | | @GetMapping("/{id}") |
| | | @ApiOperation(value = "查询社工详细信息") |
| | | R<ComActSocialWorkerVO> details(@PathVariable("id") Long id){ |
| | | return communityService.comActSocialWorkerDetails(id); |
| | | } |
| | | |
| | | /** |
| | | * 导入社工名单 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "导入社工名单") |
| | | @PostMapping(value = "/import", consumes = "multipart/*", headers = "content-type=multipart/form-data") |
| | | public R downloadTemplate(@RequestParam MultipartFile file, HttpServletRequest request) { |
| | | String fileName = file.getOriginalFilename(); //获取文件名 |
| | | log.info("传入文件名字【{}】",fileName); |
| | | InputStream inputStream = null; |
| | | try { |
| | | inputStream = file.getInputStream(); |
| | | EasyExcel.read(inputStream, ComActSocialWorkerExcelVO.class, new ComActSocialWorkerExcelListen(communityService,this.getCommunityId())).sheet().doRead(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | log.error("导入模板失败【{}】", e.getMessage()); |
| | | return R.fail("信息有误"); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | // @GetMapping("/getTemplate") |
| | | // @ApiOperation("获取模板") |
| | | // public R getTemplate(){ |
| | | // return R.ok(comactsocialworkerUrl); |
| | | // } |
| | | @ApiOperation("根据社工获取活动") |
| | | @PostMapping("/activityList") |
| | | R activityList(@RequestBody CommonPage commonPage){ |
| | | return communityService.activityList(commonPage); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.social.ComActSocialWorkerServiceVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 社工服务表(ComActSocialWorkerService)表控制层 |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * description: 社工服务表相关功能 |
| | | * |
| | | * @author zzj |
| | | * @since 2022-02-16 15:59:42 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("comActSocialWorkerService") |
| | | @Api(tags = {"社工服务"}) |
| | | public class ComActSocialWorkerServiceApi extends BaseController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @ApiOperation(value = "分页查询",response = ComActSocialWorkerServiceVO.class) |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | commonPage.setUserId(this.getUserId()); |
| | | return this.communityService.selectAllComActSocialWorkerService(commonPage); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @ApiOperation(value = "分页查询",response = ComActSocialWorkerServiceVO.class) |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable("id") Long id) { |
| | | return this.communityService.selectOneComActSocialWorkerService(id); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comActSocialWorkerServiceVO 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @ApiOperation("修改数据") |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody ComActSocialWorkerServiceVO comActSocialWorkerServiceVO) { |
| | | return communityService.updateComActSocialWorkerService(comActSocialWorkerServiceVO); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.warehouse.ApplyStatistics; |
| | | import com.panzhihua.common.model.vos.community.warehouse.ComActWarehouseApplyVO; |
| | | import com.panzhihua.common.model.vos.community.warehouse.QRCodeVO; |
| | | 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; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 物品申请表(ComActWarehouseApply)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-09 17:13:53 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"爱心义仓申领记录接口"}) |
| | | @RestController |
| | | @RequestMapping("comActWarehouseApply") |
| | | public class ComActWarehouseApplyApi extends BaseController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @ApiOperation(value = "分页查询所有数据",response = ComActWarehouseApplyVO.class) |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | commonPage.setParamId(this.getCommunityId()); |
| | | return this.communityService.comActWarehouseApplySelectAll(commonPage); |
| | | } |
| | | |
| | | /** |
| | | * 统计查询 |
| | | * |
| | | * @return 所有数据 |
| | | */ |
| | | @ApiOperation(value = "统计查询",response = ApplyStatistics.class) |
| | | @GetMapping("selectStatics") |
| | | public R selectAll() { |
| | | return this.communityService.comActWarehouseApplySelectAll(this.getCommunityId()); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @ApiOperation(value = "通过主键查询单条数据",response = ComActWarehouseApplyVO.class) |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable("id") Integer id) { |
| | | return this.communityService.comActWarehouseApplySelectOne(id); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comActWarehouseApply 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @ApiOperation("新增数据") |
| | | @PostMapping |
| | | public R insert(@RequestBody ComActWarehouseApplyVO comActWarehouseApply) { |
| | | comActWarehouseApply.setCommunityId(this.getCommunityId()); |
| | | comActWarehouseApply.setCreateTime(new Date()); |
| | | comActWarehouseApply.setApplyUserId(this.getUserId()); |
| | | comActWarehouseApply.setStatus(ComActWarehouseApplyVO.status.dcl); |
| | | comActWarehouseApply.setApplyName(this.getLoginUserInfo().getName()!=null?this.getLoginUserInfo().getName():""); |
| | | comActWarehouseApply.setApplyPhone(this.getLoginUserInfo().getPhone()!=null?this.getLoginUserInfo().getPhone():""); |
| | | return this.communityService.comActWarehouseApplyInsert(comActWarehouseApply); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comActWarehouseApply 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @ApiOperation("修改数据") |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody ComActWarehouseApplyVO comActWarehouseApply) { |
| | | if(comActWarehouseApply.getStatus().equals(ComActWarehouseApplyVO.status.yqx)){ |
| | | comActWarehouseApply.setCancelTime(new Date()); |
| | | } |
| | | if(comActWarehouseApply.getStatus().equals(ComActWarehouseApplyVO.status.dlq)||comActWarehouseApply.getStatus().equals(ComActWarehouseApplyVO.status.ybh)){ |
| | | comActWarehouseApply.setSolveTime(new Date()); |
| | | comActWarehouseApply.setSolveUserId(this.getUserId()); |
| | | } |
| | | if(comActWarehouseApply.getStatus().equals(ComActWarehouseApplyVO.status.ylq)){ |
| | | comActWarehouseApply.setActualTime(new Date()); |
| | | comActWarehouseApply.setWriteOffUserId(this.getUserId()); |
| | | } |
| | | return this.communityService.comActWarehouseApplyUpdate(comActWarehouseApply); |
| | | } |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @ApiOperation("删除数据") |
| | | @GetMapping("del") |
| | | public R delete(@RequestParam("id") Long id) { |
| | | return this.communityService.comActWarehouseApplyDelete(id); |
| | | } |
| | | |
| | | /** |
| | | * 生成二维码 |
| | | * @param qrCodeVO |
| | | * @return |
| | | */ |
| | | @ApiOperation("生成二维码") |
| | | @PostMapping("/getQRCode") |
| | | public R getQRCode(@RequestBody QRCodeVO qrCodeVO){ |
| | | return this.communityService.comActWarehouseApplyGetQRCode(qrCodeVO); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.warehouse.ComActWarehouseBaseVO; |
| | | 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; |
| | | |
| | | /** |
| | | * 义仓基础设置表(ComActWarehouseBase)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-11 09:21:53 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"爱心义仓基础记录接口"}) |
| | | @RestController |
| | | @RequestMapping("comActWarehouseBase") |
| | | public class ComActWarehouseBaseApi extends BaseController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | /** |
| | | * 通过社区id查询单条数据 |
| | | * |
| | | * @return 单条数据 |
| | | */ |
| | | @ApiOperation(value = "查询单条数据",response = ComActWarehouseBaseVO.class) |
| | | @GetMapping |
| | | public R selectOne() { |
| | | return this.communityService.comActWarehouseBaseSelectOne(this.getCommunityId()); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | import org.hibernate.validator.constraints.Length; |
| | | import org.springframework.validation.annotation.Validated; |
| | | 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.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import com.panzhihua.common.constants.HttpStatus; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.warehouse.ComActWarehouseDonatesDTO; |
| | | import com.panzhihua.common.model.dtos.community.warehouse.PageDonatesDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.warehouse.ComActWarehouseDonatesVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | import com.panzhihua.common.validated.PutGroup; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * @title: ComActWarehouseApi |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 爱心义仓捐赠小程序相关接口 |
| | | * @author: hans |
| | | * @date: 2021/10/11 15:45 |
| | | */ |
| | | |
| | | @Slf4j |
| | | @Api(tags = {"爱心义仓捐赠相关"}) |
| | | @RestController |
| | | @RequestMapping("/warehouse/donates") |
| | | public class ComActWarehouseDonatesApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @ApiOperation(value = "分页查询捐赠物品", response = ComActWarehouseDonatesVO.class) |
| | | @PostMapping("/page") |
| | | public R pageDonates(@RequestBody PageDonatesDTO pageDonatesDTO) { |
| | | LoginUserInfoVO loginUserInfo = getLoginUserInfoSureNoLogin(); |
| | | Integer isWhich = pageDonatesDTO.getIsWhich(); |
| | | if (isNull(isWhich)) { |
| | | return R.fail("缺少isWhich参数"); |
| | | } |
| | | if (isNull(pageDonatesDTO.getCommunityId())) { |
| | | return R.fail("社区id不能为空"); |
| | | } |
| | | if (isNull(loginUserInfo) && isWhich.intValue() != 3) { |
| | | return R.fail(HttpStatus.UNAUTHORIZED, "未登录"); |
| | | } |
| | | if (isWhich.intValue() == 2 && loginUserInfo.getIsCommunityWorker().intValue() != 1) { |
| | | return R.fail("非社区工作人员"); |
| | | } |
| | | if (nonNull(loginUserInfo)) { |
| | | pageDonatesDTO.setUserId(loginUserInfo.getUserId()); |
| | | } |
| | | return communityService.pageDonates(pageDonatesDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增物品捐赠") |
| | | @PostMapping("/add") |
| | | public R addDonates(@RequestBody @Validated(AddGroup.class) ComActWarehouseDonatesDTO comActWarehouseDonatesDTO) { |
| | | LoginUserInfoVO loginUserInfo = getLoginUserInfo(); |
| | | Long userId = loginUserInfo.getUserId(); |
| | | comActWarehouseDonatesDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | comActWarehouseDonatesDTO.setRegisterBy(userId); |
| | | comActWarehouseDonatesDTO.setUserId(userId); |
| | | comActWarehouseDonatesDTO.setName(loginUserInfo.getName()); |
| | | comActWarehouseDonatesDTO.setPhone(loginUserInfo.getPhone()); |
| | | return communityService.addDonates(comActWarehouseDonatesDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查看物品捐赠详情", response = ComActWarehouseDonatesVO.class) |
| | | @ApiImplicitParam(name = "isWhich", value = "1.个人中心捐赠详情 2.捐赠物品管理详情 3.爱心义仓捐赠列表详情", required = true) |
| | | @GetMapping("/get") |
| | | public R getDonates(@RequestParam("donatesId") Long donatesId, @RequestParam("isWhich") Integer isWhich) { |
| | | LoginUserInfoVO loginUserInfo = getLoginUserInfoSureNoLogin(); |
| | | if (isNull(isWhich)) { |
| | | return R.fail("缺少isWhich参数"); |
| | | } |
| | | if (isNull(loginUserInfo) && isWhich.intValue() != 3) { |
| | | return R.fail(HttpStatus.UNAUTHORIZED, "未登录"); |
| | | } |
| | | if (isWhich.intValue() == 2 && loginUserInfo.getIsCommunityWorker().intValue() != 1) { |
| | | return R.fail("非社区工作人员"); |
| | | } |
| | | Long userId = 0L; |
| | | if (nonNull(loginUserInfo)) { |
| | | userId = loginUserInfo.getUserId(); |
| | | } |
| | | return communityService.getDonates(donatesId, isWhich, userId); |
| | | } |
| | | |
| | | @ApiOperation(value = "捐赠物品签收") |
| | | @PostMapping("/signing") |
| | | public R signingDonates(@RequestBody @Validated(PutGroup.class) ComActWarehouseDonatesDTO comActWarehouseDonatesDTO) { |
| | | LoginUserInfoVO loginUserInfo = getLoginUserInfo(); |
| | | Integer isCommunityWorker = loginUserInfo.getIsCommunityWorker(); |
| | | if (isCommunityWorker.intValue() == 2) { |
| | | return R.fail("非社区工作人员"); |
| | | } |
| | | comActWarehouseDonatesDTO.setSigningBy(loginUserInfo.getUserId()); |
| | | return communityService.signingDonates(comActWarehouseDonatesDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "用户取消捐赠") |
| | | @GetMapping("/cancel") |
| | | public R cancelDonates(@RequestParam("donatesId") Long donatesId) { |
| | | return communityService.cancelDonates(donatesId, getUserId()); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.warehouse.ComActWarehouseBaseVO; |
| | | import com.panzhihua.common.model.vos.community.warehouse.ComActWarehouseOperationVO; |
| | | 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; |
| | | |
| | | /** |
| | | * 义仓基础设置表(ComActWarehouseBase)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-11 09:21:53 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"爱心义仓爱心接力接口"}) |
| | | @RestController |
| | | @RequestMapping("comActWarehouseOperation") |
| | | public class ComActWarehouseOperationApi extends BaseController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | /** |
| | | * 分页 |
| | | * |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "分页",response = ComActWarehouseOperationVO.class) |
| | | @PostMapping("queryAll") |
| | | public R queryAll(@RequestBody CommonPage commonPage) { |
| | | commonPage.setCommunityId(this.getCommunityId()); |
| | | return this.communityService.comActWarehouseOperationSelectAll(commonPage); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.acid.ComAreaCounty; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * (ComAreaTownCommunity)表控制层 |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * description: 相关功能 |
| | | * |
| | | * @author zzj |
| | | * @since 2022-04-10 17:37:33 |
| | | */ |
| | | @Api(tags = {"区县联动列表"}) |
| | | @RestController |
| | | @RequestMapping("comAreaTownCommunity") |
| | | public class ComAreaTownCommunityApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | @ApiOperation(value = "列表查询",response = ComAreaCounty.class) |
| | | @GetMapping("/areaTownCommunity") |
| | | public R test(){ |
| | | return communityService.areaTownCommunity("panzhihua",this.getUserId()); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.common.*; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.common.ComBatteryCommodityActivityVo; |
| | | import com.panzhihua.common.model.vos.common.ComBatteryCommodityOrderBargainVo; |
| | | import com.panzhihua.common.model.vos.common.ComBatteryCommodityOrderCollageTeamVo; |
| | | import com.panzhihua.common.service.community.ComBatteryCommodityActivityFeign; |
| | | import com.panzhihua.common.service.community.ComBatteryCommodityOrderCollageTeamFeign; |
| | | 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; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * title: 电动车商城-商家活动表(ComBatteryCommodityActivity) 表控制层 |
| | | * <p> |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * <p> |
| | | * description: 电动车商城-商家活动表 |
| | | * |
| | | * @author lyq |
| | | * @date 2022-03-29 13:17:38 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"电动车商城-活动管理"}) |
| | | @RestController |
| | | @RequestMapping("/comBatteryCommodityActivity") |
| | | public class ComBatteryCommodityActivityApi extends BaseController { |
| | | |
| | | @Resource |
| | | private ComBatteryCommodityActivityFeign comBatteryCommodityActivityService; |
| | | @Resource |
| | | private ComBatteryCommodityOrderCollageTeamFeign orderCollageTeamService; |
| | | |
| | | /** |
| | | * description queryByPage 分页查询 |
| | | * |
| | | * @param comBatteryCommodityActivity 请求参数 |
| | | * @return 分页查询返回参数 |
| | | * @author lyq |
| | | * @date 2022-03-29 13:17:38 |
| | | */ |
| | | @ApiOperation(value = "分页查询活动列表",response = ComBatteryCommodityActivityVo.class) |
| | | @PostMapping("/page") |
| | | public R queryByPage(@RequestBody PageComBatteryCommodityActivityDto comBatteryCommodityActivity) { |
| | | comBatteryCommodityActivity.setIsApplets(1); |
| | | if(comBatteryCommodityActivity.getIsUser().equals(1)){ |
| | | comBatteryCommodityActivity.setUserId(this.getUserId()); |
| | | } |
| | | return this.comBatteryCommodityActivityService.queryByPage(comBatteryCommodityActivity); |
| | | } |
| | | |
| | | /** |
| | | * description detailById 查询详情 |
| | | * |
| | | * @param id 主键id |
| | | * @return 详情数据 |
| | | * @author lyq |
| | | * @date 2022-03-29 13:17:38 |
| | | */ |
| | | @ApiOperation(value = "查询活动详情",response = ComBatteryCommodityActivityVo.class) |
| | | @GetMapping("/detail") |
| | | public R detailById(@RequestParam("id") Long id) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | Long userId = 0L; |
| | | if(loginUserInfo != null){ |
| | | userId = loginUserInfo.getUserId(); |
| | | } |
| | | return this.comBatteryCommodityActivityService.detailById(id,userId); |
| | | } |
| | | |
| | | /** |
| | | * description queryByPage 查询列表 |
| | | * |
| | | * @param comBatteryCommodityActivity 请求参数 |
| | | * @return 列表数据 |
| | | * @author lyq |
| | | * @date 2022-03-29 13:17:38 |
| | | */ |
| | | @ApiOperation(value = "查询活动列表",response = ComBatteryCommodityActivityVo.class) |
| | | @PostMapping("/list") |
| | | public R queryByList(@RequestBody PageComBatteryCommodityActivityDto comBatteryCommodityActivity) { |
| | | comBatteryCommodityActivity.setIsApplets(1); |
| | | return this.comBatteryCommodityActivityService.queryByList(comBatteryCommodityActivity); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询拼团团队列表",response = ComBatteryCommodityOrderCollageTeamVo.class) |
| | | @PostMapping("/assorted/dough") |
| | | public R queryByAssortedDoughList(@RequestBody PageComBatteryCommodityOrderCollageTeamDto orderCollageTeamDto) { |
| | | orderCollageTeamDto.setStatus(1); |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if(loginUserInfo != null){ |
| | | orderCollageTeamDto.setUserId(loginUserInfo.getUserId()); |
| | | } |
| | | return this.orderCollageTeamService.queryByPage(orderCollageTeamDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询拼团团队详情",response = ComBatteryCommodityOrderCollageTeamVo.class) |
| | | @GetMapping("/assorted/dough/detail") |
| | | public R queryByAssortedDoughDetail(@RequestParam("id") Long id) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | Long userId = 0L; |
| | | if(loginUserInfo != null){ |
| | | userId = loginUserInfo.getUserId(); |
| | | } |
| | | return this.orderCollageTeamService.detailById(id,userId); |
| | | } |
| | | |
| | | /** |
| | | * 创建拼团订单 |
| | | * @param orderDto 请求参数 |
| | | * @return 创建订单结果 |
| | | */ |
| | | @ApiOperation(value = "创建拼团订单") |
| | | @PostMapping("/start/fight") |
| | | public R startFight(@RequestBody StartFightOrderDto orderDto){ |
| | | orderDto.setUserId(this.getUserId()); |
| | | return this.comBatteryCommodityActivityService.startFight(orderDto); |
| | | } |
| | | |
| | | /** |
| | | * 创建砍价订单 |
| | | * @param orderDto 请求参数 |
| | | * @return 创建订单结果 |
| | | */ |
| | | @ApiOperation(value = "创建砍价订单") |
| | | @PostMapping("/start/bargain") |
| | | public R startBargain(@RequestBody StartBargainOrderDto orderDto){ |
| | | orderDto.setUserId(this.getUserId()); |
| | | return this.comBatteryCommodityActivityService.startBargain(orderDto); |
| | | } |
| | | |
| | | /** |
| | | * 帮好友砍价 |
| | | * @param orderDto 请求参数 |
| | | * @return 创建订单结果 |
| | | */ |
| | | @ApiOperation(value = "帮好友砍价") |
| | | @PostMapping("/start/user/bargain") |
| | | public R startUserBargain(@RequestBody StartUserBargainOrderDto orderDto){ |
| | | orderDto.setUserId(this.getUserId()); |
| | | return this.comBatteryCommodityActivityService.startUserBargain(orderDto); |
| | | } |
| | | |
| | | /** |
| | | * 查询砍价记录详情 |
| | | * @param id 砍价记录id |
| | | * @return 创建订单结果 |
| | | */ |
| | | @ApiOperation(value = "查询砍价记录详情",response = ComBatteryCommodityOrderBargainVo.class) |
| | | @GetMapping("/user/bargain") |
| | | public R getUserBargain(@RequestParam("id") Long id){ |
| | | return this.comBatteryCommodityActivityService.getUserBargain(id); |
| | | } |
| | | |
| | | /** |
| | | * 创建秒杀订单 |
| | | * @param orderDto 请求参数 |
| | | * @return 创建订单结果 |
| | | */ |
| | | @ApiOperation(value = "创建秒杀订单") |
| | | @PostMapping("/start/seckill") |
| | | public R startSeckill(@RequestBody StartSeckillOrderDto orderDto){ |
| | | orderDto.setUserId(this.getUserId()); |
| | | return this.comBatteryCommodityActivityService.startSeckill(orderDto); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.common.AddComBatteryCommodityDto; |
| | | import com.panzhihua.common.model.dtos.common.EditComBatteryCommodityDto; |
| | | import com.panzhihua.common.model.dtos.common.PageComBatteryCommodityDto; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.common.ComBatteryCommodityVo; |
| | | import com.panzhihua.common.service.community.ComBatteryCommodityFeign; |
| | | import com.panzhihua.common.service.community.ComBatteryCommoditySpecsFeign; |
| | | 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; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * title: 电动车商城-商品表(ComBatteryCommodity) 表控制层 |
| | | * <p> |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * <p> |
| | | * description: 电动车商城-商品表 |
| | | * |
| | | * @author lyq |
| | | * @date 2022-03-28 14:59:58 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"电动车商城-商品管理"}) |
| | | @RestController |
| | | @RequestMapping("/comBatteryCommodity") |
| | | public class ComBatteryCommodityApi extends BaseController { |
| | | |
| | | @Resource |
| | | private ComBatteryCommodityFeign comBatteryCommodityService; |
| | | @Resource |
| | | private ComBatteryCommoditySpecsFeign comBatteryCommoditySpecsService; |
| | | |
| | | /** |
| | | * description queryByPage 分页查询 |
| | | * |
| | | * @param comBatteryCommodity 请求参数 |
| | | * @return 分页查询返回参数 |
| | | * @author lyq |
| | | * @date 2022-03-28 14:59:58 |
| | | */ |
| | | @ApiOperation(value = "分页查询商品列表",response = ComBatteryCommodityVo.class) |
| | | @PostMapping("/page") |
| | | public R queryByPage(@RequestBody PageComBatteryCommodityDto comBatteryCommodity) { |
| | | return this.comBatteryCommodityService.queryByPage(comBatteryCommodity); |
| | | } |
| | | |
| | | /** |
| | | * description detailById 查询详情 |
| | | * |
| | | * @param id 主键id |
| | | * @return 详情数据 |
| | | * @author lyq |
| | | * @date 2022-03-28 14:59:58 |
| | | */ |
| | | @ApiOperation(value = "查询商品详情",response = ComBatteryCommodityVo.class) |
| | | @GetMapping("/detail") |
| | | public R detailById(@RequestParam("id") Long id) { |
| | | return this.comBatteryCommodityService.detailById(id); |
| | | } |
| | | |
| | | /** |
| | | * description queryByPage 查询列表 |
| | | * |
| | | * @param comBatteryCommodity 请求参数 |
| | | * @return 列表数据 |
| | | * @author lyq |
| | | * @date 2022-03-28 14:59:58 |
| | | */ |
| | | @ApiOperation(value = "查询商品列表",response = ComBatteryCommodityVo.class) |
| | | @PostMapping("/list") |
| | | public R queryByList(@RequestBody PageComBatteryCommodityDto comBatteryCommodity) { |
| | | comBatteryCommodity.setStoreId(this.getCommunityId()); |
| | | return this.comBatteryCommodityService.queryByList(comBatteryCommodity); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询商品规格详情",response = ComBatteryCommodityVo.class) |
| | | @GetMapping("/specs/detail") |
| | | public R specsDetailById(@RequestParam("id") Long id) { |
| | | return this.comBatteryCommoditySpecsService.detailById(id); |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.common.EditOrderAddressDto; |
| | | import com.panzhihua.common.model.dtos.common.EditOrderLogisticsDto; |
| | | import com.panzhihua.common.model.dtos.common.PageComBatteryCommodityOrderDto; |
| | | import com.panzhihua.common.model.dtos.common.UserCreateOrderDto; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.common.ComBatteryCommodityOrderVo; |
| | | import com.panzhihua.common.service.community.ComBatteryCommodityOrderFeign; |
| | | 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; |
| | | |
| | | /** |
| | | * title: 电动车商城-订单表(ComBatteryCommodityOrder) 表控制层 |
| | | * <p> |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * <p> |
| | | * description: 电动车商城-订单表 |
| | | * |
| | | * @author lyq |
| | | * @date 2022-03-29 16:05:04 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"电动车商城-订单管理"}) |
| | | @RestController |
| | | @RequestMapping("/comBatteryCommodityOrder") |
| | | public class ComBatteryCommodityOrderApi extends BaseController { |
| | | |
| | | @Resource |
| | | private ComBatteryCommodityOrderFeign comBatteryCommodityOrderService; |
| | | |
| | | /** |
| | | * description queryByPage 分页查询 |
| | | * |
| | | * @param comBatteryCommodityOrder 请求参数 |
| | | * @return 分页查询返回参数 |
| | | * @author lyq |
| | | * @date 2022-03-29 16:05:04 |
| | | */ |
| | | @ApiOperation(value = "分页查询订单列表",response = ComBatteryCommodityOrderVo.class) |
| | | @PostMapping("/page") |
| | | public R queryByPage(@RequestBody PageComBatteryCommodityOrderDto comBatteryCommodityOrder) { |
| | | comBatteryCommodityOrder.setUserId(this.getUserId()); |
| | | comBatteryCommodityOrder.setIsApplets(1); |
| | | return this.comBatteryCommodityOrderService.queryByPage(comBatteryCommodityOrder); |
| | | } |
| | | |
| | | /** |
| | | * description detailById 查询详情 |
| | | * |
| | | * @param id 主键id |
| | | * @return 详情数据 |
| | | * @author lyq |
| | | * @date 2022-03-29 16:05:04 |
| | | */ |
| | | @ApiOperation(value = "查询订单详情",response = ComBatteryCommodityOrderVo.class) |
| | | @GetMapping("/detail") |
| | | public R detailById(@RequestParam("id") Long id) { |
| | | return this.comBatteryCommodityOrderService.detailById(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "创建订单") |
| | | @PostMapping("/create") |
| | | public R appletsOrderCreate(@RequestBody UserCreateOrderDto createOrderDto) { |
| | | createOrderDto.setUserId(this.getUserId()); |
| | | return this.comBatteryCommodityOrderService.appletsOrderCreate(createOrderDto); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "用户确认收货") |
| | | @GetMapping("/receiving") |
| | | public R appletsOrderReceiving(@RequestParam("id") Long id){ |
| | | return this.comBatteryCommodityOrderService.appletsOrderReceiving(id,this.getUserId()); |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.common.EditComBatteryStoreDto; |
| | | import com.panzhihua.common.model.dtos.common.PageComBatteryStoreDto; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.common.ComBatteryStoreVo; |
| | | import com.panzhihua.common.service.community.ComBatteryStoreFeign; |
| | | 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; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * title: 电动车商城-商家表(ComBatteryStore) 表控制层 |
| | | * <p> |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * <p> |
| | | * description: 电动车商城-商家表 |
| | | * |
| | | * @author lyq |
| | | * @date 2022-03-28 13:44:43 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"电动车商城-商家管理"}) |
| | | @RestController |
| | | @RequestMapping("/comBatteryStore") |
| | | public class ComBatteryStoreApi extends BaseController { |
| | | |
| | | @Resource |
| | | private ComBatteryStoreFeign comBatteryStoreService; |
| | | |
| | | @ApiOperation(value = "分页查询商家列表",response = ComBatteryStoreVo.class) |
| | | @PostMapping("/page") |
| | | public R queryByPage(@RequestBody PageComBatteryStoreDto comBatteryStore) { |
| | | return this.comBatteryStoreService.queryByPage(comBatteryStore); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询商家详情",response = ComBatteryStoreVo.class) |
| | | @GetMapping("/detail") |
| | | public R detailById(@RequestParam("id") Long id) { |
| | | return this.comBatteryStoreService.detailById(id); |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.common.AddComBatteryStoreClassDto; |
| | | import com.panzhihua.common.model.dtos.common.EditComBatteryStoreClassDto; |
| | | import com.panzhihua.common.model.dtos.common.PageComBatteryStoreClassDto; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.common.ComBatteryStoreClassVo; |
| | | import com.panzhihua.common.service.community.ComBatteryStoreClassFeign; |
| | | 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; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * title: 电动车商城-商家分类表(ComBatteryStoreClass) 表控制层 |
| | | * <p> |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * <p> |
| | | * description: 电动车商城-商家分类表 |
| | | * |
| | | * @author lyq |
| | | * @date 2022-03-29 11:01:55 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"电动车商城-商家分类管理"}) |
| | | @RestController |
| | | @RequestMapping("/comBatteryStoreClass") |
| | | public class ComBatteryStoreClassApi extends BaseController { |
| | | |
| | | @Resource |
| | | private ComBatteryStoreClassFeign comBatteryStoreClassService; |
| | | |
| | | /** |
| | | * description queryByPage 分页查询 |
| | | * |
| | | * @param comBatteryStoreClass 请求参数 |
| | | * @return 分页查询返回参数 |
| | | * @author lyq |
| | | * @date 2022-03-29 11:01:55 |
| | | */ |
| | | @ApiOperation(value = "分页查询商家分类列表",response = ComBatteryStoreClassVo.class) |
| | | @PostMapping("/page") |
| | | public R queryByPage(@RequestBody PageComBatteryStoreClassDto comBatteryStoreClass) { |
| | | comBatteryStoreClass.setStatus(1); |
| | | return this.comBatteryStoreClassService.queryByPage(comBatteryStoreClass); |
| | | } |
| | | |
| | | /** |
| | | * description detailById 查询详情 |
| | | * |
| | | * @param id 主键id |
| | | * @return 详情数据 |
| | | * @author lyq |
| | | * @date 2022-03-29 11:01:55 |
| | | */ |
| | | @ApiOperation(value = "查询商家分类详情",response = ComBatteryStoreClassVo.class) |
| | | @GetMapping("/detail") |
| | | public R detailById(@RequestParam("id") Long id) { |
| | | return this.comBatteryStoreClassService.detailById(id); |
| | | } |
| | | |
| | | /** |
| | | * description queryByPage 查询列表 |
| | | * |
| | | * @param comBatteryStoreClass 请求参数 |
| | | * @return 列表数据 |
| | | * @author lyq |
| | | * @date 2022-03-29 11:01:55 |
| | | */ |
| | | @ApiOperation(value = "查询商家分类列表",response = ComBatteryStoreClassVo.class) |
| | | @PostMapping("/list") |
| | | public R queryByList(@RequestBody PageComBatteryStoreClassDto comBatteryStoreClass) { |
| | | comBatteryStoreClass.setStatus(1); |
| | | return this.comBatteryStoreClassService.queryByAppletsList(comBatteryStoreClass); |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.common.AddComBatteryUserAddressDto; |
| | | import com.panzhihua.common.model.dtos.common.EditComBatteryUserAddressDto; |
| | | import com.panzhihua.common.model.dtos.common.PageComBatteryUserAddressDto; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.common.ComBatteryUserAddressVo; |
| | | import com.panzhihua.common.service.community.ComBatteryUserAddressFeign; |
| | | 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; |
| | | |
| | | /** |
| | | * title: 电动车商城-用户收货地址表(ComBatteryUserAddress) 表控制层 |
| | | * <p> |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * <p> |
| | | * description: 电动车商城-用户收货地址表 |
| | | * |
| | | * @author lyq |
| | | * @date 2022-03-29 13:18:19 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"电动车商城-用户收货地址管理"}) |
| | | @RestController |
| | | @RequestMapping("/comBatteryUserAddress") |
| | | public class ComBatteryUserAddressApi extends BaseController { |
| | | |
| | | @Resource |
| | | private ComBatteryUserAddressFeign comBatteryUserAddressService; |
| | | |
| | | /** |
| | | * description queryByPage 分页查询 |
| | | * |
| | | * @param comBatteryUserAddress 请求参数 |
| | | * @return 分页查询返回参数 |
| | | * @author lyq |
| | | * @date 2022-03-29 13:18:19 |
| | | */ |
| | | @ApiOperation(value = "分页查询用户收货地址列表",response = ComBatteryUserAddressVo.class) |
| | | @PostMapping("/page") |
| | | public R queryByPage(@RequestBody PageComBatteryUserAddressDto comBatteryUserAddress) { |
| | | comBatteryUserAddress.setUserId(this.getUserId()); |
| | | return this.comBatteryUserAddressService.queryByPage(comBatteryUserAddress); |
| | | } |
| | | |
| | | /** |
| | | * description add 新增数据 |
| | | * |
| | | * @param comBatteryUserAddress 请求参数 |
| | | * @return 新增结果 |
| | | * @author lyq |
| | | * @date 2022-03-29 13:18:19 |
| | | */ |
| | | @ApiOperation(value = "新增用户收货地址") |
| | | @PostMapping("/add") |
| | | public R add(@RequestBody AddComBatteryUserAddressDto comBatteryUserAddress) { |
| | | comBatteryUserAddress.setUserId(this.getUserId()); |
| | | return this.comBatteryUserAddressService.insert(comBatteryUserAddress); |
| | | } |
| | | |
| | | /** |
| | | * description edit 编辑数据 |
| | | * |
| | | * @param comBatteryUserAddress 请求参数 |
| | | * @return 编辑结果 |
| | | * @author lyq |
| | | * @date 2022-03-29 13:18:19 |
| | | */ |
| | | @ApiOperation(value = "编辑用户收货地址") |
| | | @PutMapping("/edit") |
| | | public R edit(@RequestBody EditComBatteryUserAddressDto comBatteryUserAddress) { |
| | | comBatteryUserAddress.setUserId(this.getUserId()); |
| | | return this.comBatteryUserAddressService.update(comBatteryUserAddress); |
| | | } |
| | | |
| | | /** |
| | | * description deleteById 删除数据 |
| | | * |
| | | * @param id 主键id |
| | | * @return 删除结果 |
| | | * @author lyq |
| | | * @date 2022-03-29 13:18:19 |
| | | */ |
| | | @ApiOperation(value = "删除用户收货地址") |
| | | @GetMapping("/delete") |
| | | public R deleteById(@RequestParam("id") Long id) { |
| | | return this.comBatteryUserAddressService.deleteById(id); |
| | | } |
| | | |
| | | /** |
| | | * description detailById 查询详情 |
| | | * |
| | | * @param id 主键id |
| | | * @return 详情数据 |
| | | * @author lyq |
| | | * @date 2022-03-29 13:18:19 |
| | | */ |
| | | @ApiOperation(value = "查询用户收货地址详情",response = ComBatteryUserAddressVo.class) |
| | | @GetMapping("/detail") |
| | | public R detailById(@RequestParam("id") Long id) { |
| | | return this.comBatteryUserAddressService.detailById(id); |
| | | } |
| | | |
| | | /** |
| | | * description queryByPage 查询列表 |
| | | * |
| | | * @param comBatteryUserAddress 请求参数 |
| | | * @return 列表数据 |
| | | * @author lyq |
| | | * @date 2022-03-29 13:18:19 |
| | | */ |
| | | @ApiOperation(value = "查询用户收货地址列表",response = ComBatteryUserAddressVo.class) |
| | | @PostMapping("/list") |
| | | public R queryByList(@RequestBody PageComBatteryUserAddressDto comBatteryUserAddress) { |
| | | comBatteryUserAddress.setUserId(this.getUserId()); |
| | | return this.comBatteryUserAddressService.queryByList(comBatteryUserAddress); |
| | | } |
| | | |
| | | /** |
| | | * 查询用户默认收货地址 |
| | | * @return 用户默认收货地址 |
| | | */ |
| | | @ApiOperation(value = "查询用户默认收货地址",response = ComBatteryUserAddressVo.class) |
| | | @GetMapping("/default/address") |
| | | public R getDefaultAddress() { |
| | | return this.comBatteryUserAddressService.getDefaultAddress(this.getUserId()); |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.common.AddComChangeCarBrandDto; |
| | | import com.panzhihua.common.model.dtos.common.EditComChangeCarBrandDto; |
| | | import com.panzhihua.common.model.dtos.common.PageComChangeCarBrandDto; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.common.ComChangeCarBrandVo; |
| | | import com.panzhihua.common.service.community.ComChangeCarBrandFeign; |
| | | 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; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * title: 换新车-品牌表(ComChangeCarBrand) 表控制层 |
| | | * <p> |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * <p> |
| | | * description: 换新车-品牌表 |
| | | * |
| | | * @author lyq |
| | | * @date 2022-04-07 13:37:22 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"换新车-品牌管理"}) |
| | | @RestController |
| | | @RequestMapping("/comChangeCarBrand") |
| | | public class ComChangeCarBrandApi extends BaseController { |
| | | |
| | | @Resource |
| | | private ComChangeCarBrandFeign comChangeCarBrandService; |
| | | |
| | | /** |
| | | * description queryByPage 分页查询 |
| | | * |
| | | * @param comChangeCarBrand 请求参数 |
| | | * @return 分页查询返回参数 |
| | | * @author lyq |
| | | * @date 2022-04-07 13:37:22 |
| | | */ |
| | | @ApiOperation(value = "分页查询品牌列表",response = ComChangeCarBrandVo.class) |
| | | @PostMapping("/page") |
| | | public R queryByPage(@RequestBody PageComChangeCarBrandDto comChangeCarBrand) { |
| | | comChangeCarBrand.setStatus(1); |
| | | return this.comChangeCarBrandService.queryByPage(comChangeCarBrand); |
| | | } |
| | | |
| | | /** |
| | | * description detailById 查询详情 |
| | | * |
| | | * @param id 主键id |
| | | * @return 详情数据 |
| | | * @author lyq |
| | | * @date 2022-04-07 13:37:22 |
| | | */ |
| | | @ApiOperation(value = "查询品牌详情",response = ComChangeCarBrandVo.class) |
| | | @GetMapping("/detail") |
| | | public R detailById(@RequestParam("id") Long id) { |
| | | return this.comChangeCarBrandService.detailById(id); |
| | | } |
| | | |
| | | /** |
| | | * description queryByPage 查询列表 |
| | | * |
| | | * @param comChangeCarBrand 请求参数 |
| | | * @return 列表数据 |
| | | * @author lyq |
| | | * @date 2022-04-07 13:37:22 |
| | | */ |
| | | @ApiOperation(value = "查询品牌列表",response = ComChangeCarBrandVo.class) |
| | | @PostMapping("/list") |
| | | public R queryByList(@RequestBody PageComChangeCarBrandDto comChangeCarBrand) { |
| | | return this.comChangeCarBrandService.queryByList(comChangeCarBrand); |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.common.AddComChangeCarInquiryDto; |
| | | import com.panzhihua.common.model.dtos.common.EditComChangeCarInquiryDto; |
| | | import com.panzhihua.common.model.dtos.common.PageComChangeCarInquiryDto; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.common.ComChangeCarInquiryVo; |
| | | import com.panzhihua.common.service.community.ComChangeCarInquiryFeign; |
| | | 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; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * title: 换新车-分期询价表(ComChangeCarInquiry) 表控制层 |
| | | * <p> |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * <p> |
| | | * description: 换新车-分期询价表 |
| | | * |
| | | * @author lyq |
| | | * @date 2022-04-07 13:39:06 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"换新车-分期询价管理"}) |
| | | @RestController |
| | | @RequestMapping("/comChangeCarInquiry") |
| | | public class ComChangeCarInquiryApi extends BaseController { |
| | | |
| | | @Resource |
| | | private ComChangeCarInquiryFeign comChangeCarInquiryService; |
| | | |
| | | /** |
| | | * description add 新增数据 |
| | | * |
| | | * @param comChangeCarInquiry 请求参数 |
| | | * @return 新增结果 |
| | | * @author lyq |
| | | * @date 2022-04-07 13:39:06 |
| | | */ |
| | | @ApiOperation(value = "新增分期询价") |
| | | @PostMapping("/add") |
| | | public R add(@RequestBody AddComChangeCarInquiryDto comChangeCarInquiry) { |
| | | comChangeCarInquiry.setCreateAt(new Date()); |
| | | comChangeCarInquiry.setCreateBy(this.getUserId()); |
| | | comChangeCarInquiry.setUserId(this.getUserId()); |
| | | return this.comChangeCarInquiryService.insert(comChangeCarInquiry); |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.common.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.common.ComChangeCarModelSpecsVo; |
| | | import com.panzhihua.common.model.vos.common.ComChangeCarModelVo; |
| | | import com.panzhihua.common.service.community.ComChangeCarModelFeign; |
| | | import com.panzhihua.common.service.community.ComChangeCarModelRelationFeign; |
| | | import com.panzhihua.common.service.community.ComChangeCarModelSpecsFeign; |
| | | 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; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * title: 换新车-车型管理表(ComChangeCarModel) 表控制层 |
| | | * <p> |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * <p> |
| | | * description: 换新车-车型管理表 |
| | | * |
| | | * @author lyq |
| | | * @date 2022-04-07 13:41:54 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"换新车-车型管理"}) |
| | | @RestController |
| | | @RequestMapping("/comChangeCarModel") |
| | | public class ComChangeCarModelApi extends BaseController { |
| | | |
| | | @Resource |
| | | private ComChangeCarModelFeign comChangeCarModelService; |
| | | @Resource |
| | | private ComChangeCarModelSpecsFeign carModelSpecsService; |
| | | @Resource |
| | | private ComChangeCarModelRelationFeign carModelRelationService; |
| | | |
| | | /** |
| | | * description queryByPage 分页查询 |
| | | * |
| | | * @param comChangeCarModelRelation 请求参数 |
| | | * @return 分页查询返回参数 |
| | | * @author lyq |
| | | * @date 2022-04-07 13:41:54 |
| | | */ |
| | | @ApiOperation(value = "分页查询车型管理列表",response = ComChangeCarModelVo.class) |
| | | @PostMapping("/page") |
| | | public R queryByPage(@RequestBody PageComChangeCarModelRelationDto comChangeCarModelRelation) { |
| | | return this.carModelRelationService.queryByAppletsPage(comChangeCarModelRelation); |
| | | } |
| | | |
| | | /** |
| | | * description detailById 查询详情 |
| | | * |
| | | * @param id 主键id |
| | | * @return 详情数据 |
| | | * @author lyq |
| | | * @date 2022-04-07 13:41:54 |
| | | */ |
| | | @ApiOperation(value = "查询车型管理详情",response = ComChangeCarModelVo.class) |
| | | @GetMapping("/detail") |
| | | public R detailById(@RequestParam("id") Long id) { |
| | | return this.comChangeCarModelService.detailById(id); |
| | | } |
| | | |
| | | /** |
| | | * description queryByPage 查询列表 |
| | | * |
| | | * @param comChangeCarModel 请求参数 |
| | | * @return 列表数据 |
| | | * @author lyq |
| | | * @date 2022-04-07 13:41:54 |
| | | */ |
| | | @ApiOperation(value = "查询车型管理列表",response = ComChangeCarModelVo.class) |
| | | @PostMapping("/list") |
| | | public R queryByList(@RequestBody PageComChangeCarModelDto comChangeCarModel) { |
| | | return this.comChangeCarModelService.queryByList(comChangeCarModel); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询规格管理级联列表",response = ComChangeCarModelSpecsVo.class) |
| | | @PostMapping("/specs/list") |
| | | public R getSpecsList(@RequestBody PageComChangeCarModelSpecsDto comChangeCarModel) { |
| | | return this.carModelSpecsService.queryByList(comChangeCarModel); |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.common.AddComChangeCarModelSpecsChildrenDto; |
| | | import com.panzhihua.common.model.dtos.common.EditComChangeCarModelSpecsChildrenDto; |
| | | import com.panzhihua.common.model.dtos.common.PageComChangeCarModelSpecsChildrenDto; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.common.ComChangeCarModelSpecsChildrenVo; |
| | | import com.panzhihua.common.service.community.ComChangeCarModelSpecsChildrenFeign; |
| | | 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; |
| | | |
| | | /** |
| | | * title: 换新车-车型子规格表(ComChangeCarModelSpecsChildren) 表控制层 |
| | | * <p> |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * <p> |
| | | * description: 换新车-车型子规格表 |
| | | * |
| | | * @author lyq |
| | | * @date 2022-04-07 13:55:33 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"换新车-车型规格下子规格管理"}) |
| | | @RestController |
| | | @RequestMapping("/comChangeCarModelSpecsChildren") |
| | | public class ComChangeCarModelSpecsChildrenApi extends BaseController { |
| | | |
| | | @Resource |
| | | private ComChangeCarModelSpecsChildrenFeign comChangeCarModelSpecsChildrenService; |
| | | |
| | | /** |
| | | * description queryByPage 查询列表 |
| | | * |
| | | * @param comChangeCarModelSpecsChildren 请求参数 |
| | | * @return 列表数据 |
| | | * @author lyq |
| | | * @date 2022-04-07 13:55:33 |
| | | */ |
| | | @ApiOperation(value = "查询车型规格下子规格管理列表",response = ComChangeCarModelSpecsChildrenVo.class) |
| | | @PostMapping("/list") |
| | | public R queryByList(@RequestBody PageComChangeCarModelSpecsChildrenDto comChangeCarModelSpecsChildren) { |
| | | return this.comChangeCarModelSpecsChildrenService.queryByList(comChangeCarModelSpecsChildren); |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.fms.AddFmsServiceAdminDTO; |
| | | import com.panzhihua.common.model.dtos.community.fms.ApplyFmsServiceDTO; |
| | | import com.panzhihua.common.model.dtos.community.fms.ApprovalFmsServiceAdminDTO; |
| | | import com.panzhihua.common.model.dtos.community.fms.EvaluationFmsServiceDTO; |
| | | import com.panzhihua.common.model.dtos.community.fms.FeedbackFmsServiceDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActEvaluateVO; |
| | | import com.panzhihua.common.model.vos.community.fms.CascadeCommVO; |
| | | 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.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.fms.PageFmsClassroomAdminDTO; |
| | | import com.panzhihua.common.model.dtos.community.fms.PageFmsEventAdminDTO; |
| | | import com.panzhihua.common.model.dtos.community.fms.PageFmsServiceAppletsDTO; |
| | | import com.panzhihua.common.model.dtos.community.fms.PageFmsTeamDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.fms.ComFmsClassroomVO; |
| | | import com.panzhihua.common.model.vos.community.fms.ComFmsServiceVO; |
| | | import com.panzhihua.common.model.vos.community.fms.ComFmsTeamTypeVO; |
| | | import com.panzhihua.common.model.vos.community.fms.ComFmsTeamVO; |
| | | import com.panzhihua.common.model.vos.grid.EventDetailsVO; |
| | | import com.panzhihua.common.model.vos.grid.EventVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.service.grid.GridService; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * @title: ComFmsApi |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 五微服务相关接口 |
| | | * @author: hans |
| | | * @date: 2022/02/11 13:23 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"五微服务"}) |
| | | @RestController |
| | | @RequestMapping("/fms") |
| | | public class ComFmsApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | @Resource |
| | | private GridService gridService; |
| | | |
| | | @ApiOperation(value = "获取团队类型列表", response = ComFmsTeamTypeVO.class) |
| | | @ApiImplicitParam(name = "communityId", value = "社区id", required = true) |
| | | @GetMapping("/teamType/list") |
| | | public R listFmsTeamType(@RequestParam(value = "communityId", required = false) Long communityId) { |
| | | LoginUserInfoVO userInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (isNull(userInfo) && isNull(communityId)) { |
| | | return R.fail("社区id不能为空"); |
| | | } |
| | | if (nonNull(userInfo)) { |
| | | communityId = userInfo.getCommunityId(); |
| | | } |
| | | return communityService.listFmsTeamType(communityId); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页/全部查询团队信息", response = ComFmsTeamVO.class) |
| | | @PostMapping("/team/page") |
| | | public R pageFmsTeam(@RequestBody PageFmsTeamDTO pageFmsTeamDTO) { |
| | | LoginUserInfoVO userInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (isNull(userInfo) && isNull(pageFmsTeamDTO.getCommunityId())) { |
| | | return R.fail("社区id不能为空"); |
| | | } |
| | | if (nonNull(userInfo)) { |
| | | pageFmsTeamDTO.setCommunityId(userInfo.getCommunityId()); |
| | | } |
| | | return communityService.pageFmsTeamApplets(pageFmsTeamDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询微讲堂", response = ComFmsClassroomVO.class) |
| | | @PostMapping("/classroom/page") |
| | | public R pageFmsClassroom(@RequestBody @Valid PageFmsClassroomAdminDTO adminDTO) { |
| | | LoginUserInfoVO userInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (isNull(userInfo) && isNull(adminDTO.getCommunityId())) { |
| | | return R.fail("社区id不能为空"); |
| | | } |
| | | if (nonNull(userInfo)) { |
| | | adminDTO.setCommunityId(userInfo.getCommunityId()); |
| | | } |
| | | return communityService.pageFmsClassroomAdmin(adminDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取微讲堂详情", response = ComFmsClassroomVO.class) |
| | | @ApiImplicitParam(name = "id", value = "微讲堂id", required = true) |
| | | @GetMapping("/classroom/detail") |
| | | public R detailFmsClassroom(@RequestParam("id") Long id) { |
| | | return communityService.detailFmsClassroomApplets(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询微调节/微防控", response = EventVO.class) |
| | | @PostMapping("/event/page") |
| | | public R pageFmsEvent(@RequestBody @Valid PageFmsEventAdminDTO adminDTO) { |
| | | LoginUserInfoVO userInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (isNull(userInfo) && isNull(adminDTO.getCommunityId())) { |
| | | return R.fail("社区id不能为空"); |
| | | } |
| | | if (nonNull(userInfo)) { |
| | | adminDTO.setCommunityId(userInfo.getCommunityId()); |
| | | } |
| | | return communityService.pageFmsEventApplets(adminDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "微调节/微防控事件详情", response = EventDetailsVO.class) |
| | | @ApiImplicitParam(name = "eventId", value = "事件id", required = true) |
| | | @GetMapping("/event/detail") |
| | | public R detailFmsEvent(@RequestParam("eventId") Long eventId) { |
| | | return gridService.eventDetails(eventId); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询微服务", response = ComFmsServiceVO.class) |
| | | @PostMapping("/service/page") |
| | | public R pageFmsService(@RequestBody @Valid PageFmsServiceAppletsDTO adminDTO) { |
| | | LoginUserInfoVO userInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (isNull(userInfo) && isNull(adminDTO.getCommunityId())) { |
| | | return R.fail("社区id不能为空"); |
| | | } |
| | | if (nonNull(userInfo)) { |
| | | adminDTO.setCommunityId(userInfo.getCommunityId()); |
| | | } |
| | | return communityService.pageFmsServiceApplets(adminDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查看微服务详情", response = ComFmsServiceVO.class) |
| | | @ApiImplicitParam(name = "serviceId", value = "服务id", required = true) |
| | | @GetMapping("/service/detail") |
| | | public R detailFmsService(@RequestParam("serviceId") Long serviceId) { |
| | | LoginUserInfoVO userInfo = this.getLoginUserInfoSureNoLogin(); |
| | | Long userId = null; |
| | | if (nonNull(userInfo)) { |
| | | userId = userInfo.getUserId(); |
| | | } |
| | | return communityService.detailFmsServiceApplets(serviceId, userId); |
| | | } |
| | | |
| | | @ApiOperation("微服务申请") |
| | | @PostMapping("/service/apply") |
| | | public R applyFmsService(@RequestBody @Valid ApplyFmsServiceDTO adminDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | adminDTO.setUserInfo(loginUserInfo); |
| | | return communityService.applyFmsService(adminDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询我的微服务", response = ComFmsServiceVO.class) |
| | | @PostMapping("/service/pageMy") |
| | | public R pageMyFmsService(@RequestBody @Valid PageFmsServiceAppletsDTO adminDTO) { |
| | | adminDTO.setCommunityId(this.getCommunityId()); |
| | | adminDTO.setUserId(this.getUserId()); |
| | | return communityService.pageMyFmsService(adminDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "微服务评价") |
| | | @PostMapping("/service/evaluate") |
| | | public R evaluateFmsService(@RequestBody @Valid EvaluationFmsServiceDTO evaluationFmsServiceDTO) { |
| | | evaluationFmsServiceDTO.setUserId(this.getUserId()); |
| | | return communityService.evaluateFmsService(evaluationFmsServiceDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "微团队成员分页查询服务处理", response = ComFmsServiceVO.class) |
| | | @PostMapping("/service/pageDeal") |
| | | public R pageDealFmsService(@RequestBody @Valid PageFmsServiceAppletsDTO adminDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | adminDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | adminDTO.setUserId(loginUserInfo.getUserId()); |
| | | adminDTO.setUserInfo(loginUserInfo); |
| | | return communityService.pageDealFmsService(adminDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "微团队成员服务反馈", response = ComFmsServiceVO.class) |
| | | @PostMapping("/service/feedback") |
| | | public R feedbackFmsService(@RequestBody @Valid FeedbackFmsServiceDTO adminDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | adminDTO.setUserId(loginUserInfo.getUserId()); |
| | | adminDTO.setUserInfo(loginUserInfo); |
| | | return communityService.feedbackFmsService(adminDTO); |
| | | } |
| | | |
| | | @ApiOperation("核实微服务") |
| | | @PostMapping("/service/approval") |
| | | public R approvalFmsService(@RequestBody @Valid ApprovalFmsServiceAdminDTO adminDTO) { |
| | | if (adminDTO.getIsPass() && isNull(adminDTO.getMemberId())) { |
| | | return R.fail("未分配服务人员"); |
| | | } |
| | | adminDTO.setUpdatedBy(this.getUserId()); |
| | | return communityService.approvalFmsService(adminDTO); |
| | | } |
| | | |
| | | @ApiOperation("后台新增微服务") |
| | | @PostMapping("/service/add") |
| | | public R addFmsService(@RequestBody @Valid AddFmsServiceAdminDTO adminDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | adminDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | adminDTO.setCreatedBy(loginUserInfo.getUserId()); |
| | | adminDTO.setUpdatedBy(loginUserInfo.getUserId()); |
| | | return communityService.addFmsServiceAdmin(adminDTO); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.common.AddComPbCheckUnitDto; |
| | | import com.panzhihua.common.model.dtos.common.PageComPbCheckUnitDto; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.common.ComPbCheckUnitVo; |
| | | import com.panzhihua.common.service.partybuilding.ComPbCheckUnitFeign; |
| | | 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; |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * title: 党建-报到单位(ComPbCheckUnit) 控制层 |
| | | * <p> |
| | | * projectName 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * <p> |
| | | * description: 党建-报到单位 |
| | | * |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:18 |
| | | */ |
| | | |
| | | @Slf4j |
| | | @Api(tags = {"党建-报到单位"}) |
| | | @RestController |
| | | @RequestMapping("/checkUnit") |
| | | public class ComPbCheckUnitApi extends BaseController { |
| | | |
| | | @Resource |
| | | private ComPbCheckUnitFeign comPbCheckUnitService; |
| | | |
| | | /** |
| | | * description queryByPage 分页查询 |
| | | * |
| | | * @param comPbCheckUnit 请求参数 |
| | | * @return 分页查询返回参数 |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:18 |
| | | */ |
| | | @ApiOperation(value = "分页查询报道单位", response = ComPbCheckUnitVo.class) |
| | | @PostMapping("/page") |
| | | public R queryByPage(@RequestBody PageComPbCheckUnitDto comPbCheckUnit) { |
| | | comPbCheckUnit.setCommunityId(this.getCommunityId()); |
| | | return this.comPbCheckUnitService.queryByPage(comPbCheckUnit); |
| | | } |
| | | |
| | | /** |
| | | * description detailById 查询详情 |
| | | * |
| | | * @param id 主键id |
| | | * @return 详情数据 |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:18 |
| | | */ |
| | | @ApiOperation(value = "查询报道单位", response = ComPbCheckUnitVo.class) |
| | | @GetMapping("/detail") |
| | | public R detailById(@RequestParam("id") Long id) { |
| | | return this.comPbCheckUnitService.detailById(id); |
| | | } |
| | | |
| | | /** |
| | | * description queryByPage 查询列表 |
| | | * |
| | | * @param comPbCheckUnit 请求参数 |
| | | * @return 列表数据 |
| | | * @author lyq |
| | | * @date 2022-02-16 16:22:18 |
| | | */ |
| | | @ApiOperation(value = "查询报道单位列表", response = ComPbCheckUnitVo.class) |
| | | @PostMapping("/list") |
| | | public R queryByList(@RequestBody PageComPbCheckUnitDto comPbCheckUnit) { |
| | | //comPbCheckUnit.setCommunityId(this.getCommunityId()); |
| | | comPbCheckUnit.setCommunityId(null); |
| | | return this.comPbCheckUnitService.queryByList(comPbCheckUnit); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增报道单位") |
| | | @PostMapping("/add") |
| | | public R add(@RequestBody AddComPbCheckUnitDto comPbCheckUnit) { |
| | | comPbCheckUnit.setCommunityId(this.getCommunityId()); |
| | | comPbCheckUnit.setCreateAt(new Date()); |
| | | comPbCheckUnit.setCreateBy(this.getUserId()); |
| | | return this.comPbCheckUnitService.insert(comPbCheckUnit); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.dtos.user.SysUserFeedbackDTO; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiParam; |
| | | 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.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComPropertyVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * @author zzj |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"物业公司"}) |
| | | @RestController |
| | | @RequestMapping("/comProperty") |
| | | public class ComPropertyApi extends BaseController { |
| | | @Resource |
| | | private CommunityService communityService; |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @ApiOperation(value = "物业公司列表",response = ComPropertyVO.class) |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | commonPage.setParamId(this.getCommunityId()); |
| | | return this.communityService.comPropertySelectAll(commonPage); |
| | | } |
| | | |
| | | @ApiOperation(value = "物业公司详情", response = ComPropertyVO.class) |
| | | @ApiImplicitParam(name = "id", value = "物业公司id", required = true) |
| | | @GetMapping("detail") |
| | | public R detailProperty(@RequestParam("id") Long id) { |
| | | return this.communityService.detailProperty(id); |
| | | } |
| | | |
| | | @ApiOperation("新增投诉建议或问题留言") |
| | | @PostMapping("addFeedBack") |
| | | public R addFeedBack(@RequestBody SysUserFeedbackDTO sysUserFeedbackDTO){ |
| | | return userService.addFeedback(sysUserFeedbackDTO); |
| | | } |
| | | |
| | | @ApiOperation("查看自己的投诉建议或问题留言记录") |
| | | @GetMapping("myFeedBack") |
| | | public R myFeedBack(@ApiParam("类型:1问题留言2投诉建议") @RequestParam(value = "type",required = false)Integer type,@RequestParam(value = "propertyId",required = false)Long propertyId){ |
| | | return userService.myFeedBack(this.getLoginUserInfo().getUserId(),type,propertyId); |
| | | } |
| | | |
| | | @ApiOperation("通知公告列表") |
| | | @GetMapping("notice") |
| | | public R noticeList(@RequestParam("page")Integer page,@RequestParam("size")Integer size,@RequestParam("propertyId")Long propertyId){ |
| | | return communityService.noticeList(page,size,propertyId); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComPropertyVO; |
| | | import com.panzhihua.common.model.vos.property.ComPropertyHelpVO; |
| | | import com.panzhihua.common.service.property.PropertyService; |
| | | 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; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * (ComPropertyHelp)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-09-18 16:43:12 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"一件求助人员"}) |
| | | @RestController |
| | | @RequestMapping("/comPropertyHelp") |
| | | public class ComPropertyHelpApi extends BaseController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private PropertyService propertyService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @ApiOperation(value = "分页查询所有数据",response = ComPropertyVO.class) |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | commonPage.setStatus(1); |
| | | return this.propertyService.comPropertyHelpSelectAll(commonPage); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @ApiOperation(value = "主键查询") |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable("id") Serializable id) { |
| | | return this.propertyService.comPropertyHelpSelectOne(id); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comPropertyHelp 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @ApiOperation(value = "新增数据") |
| | | @PostMapping |
| | | public R insert(@RequestBody ComPropertyHelpVO comPropertyHelp) { |
| | | comPropertyHelp.setCommunityId(this.getCommunityId()); |
| | | comPropertyHelp.setCreateTime(DateUtil.date()); |
| | | return this.propertyService.comPropertyHelpInsert(comPropertyHelp); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comPropertyHelp 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @ApiOperation(value = "修改数据") |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody ComPropertyHelpVO comPropertyHelp) { |
| | | return this.propertyService.comPropertyHelpUpdate(comPropertyHelp); |
| | | } |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @ApiOperation(value = "删除数据") |
| | | @GetMapping("del") |
| | | public R delete(@RequestParam("id") Long id) { |
| | | return this.propertyService.comPropertyHelpDelete(id); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | |
| | | 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.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.PageComPropertyPublicityDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageVO; |
| | | import com.panzhihua.common.model.vos.community.ComPropertyPublicityVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | |
| | | /** |
| | | * @title: ComPropertyPublicityApi |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 物业宣传相关接口 |
| | | * @author: hans |
| | | * @date: 2021/11/11 10:08 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"物业宣传相关接口"}) |
| | | @RestController |
| | | @RequestMapping("/property/publicity") |
| | | public class ComPropertyPublicityApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @ApiOperation(value = "分页物业宣传信息", response = ComPropertyPublicityVO.class) |
| | | @PostMapping("/page") |
| | | public R pageComPropertyPublicity(@RequestBody @Valid PageComPropertyPublicityDTO pageComPropertyPublicityDTO) { |
| | | if (isNull(pageComPropertyPublicityDTO.getCommunityId())) { |
| | | return R.fail("社区id不能为空"); |
| | | } |
| | | LoginUserInfoVO loginUserInfoSureNoLogin = getLoginUserInfoSureNoLogin(); |
| | | if (nonNull(loginUserInfoSureNoLogin)) { |
| | | pageComPropertyPublicityDTO.setCommunityId(loginUserInfoSureNoLogin.getCommunityId()); |
| | | } |
| | | return communityService.pageComPropertyPublicityApplet(pageComPropertyPublicityDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查看物业宣传信息", response = ComPropertyPublicityVO.class) |
| | | @GetMapping("/get") |
| | | @ApiImplicitParam(name = "id", value = "物业宣传id", required = true) |
| | | public R getComPropertyPublicity(@RequestParam("id") Long id) { |
| | | return communityService.getComPropertyPublicity(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "增加物业宣传浏览量") |
| | | @GetMapping("/incr-view") |
| | | @ApiImplicitParam(name = "id", value = "物业宣传id", required = true) |
| | | public R incrPropertyPublicityView(@RequestParam("id") Long id) { |
| | | return communityService.incrPropertyPublicityView(id); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.panzhihua.applets.model.dtos.IDTO; |
| | | import com.panzhihua.common.constants.Constants; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.property.ComPropertyRepairVO; |
| | | import com.panzhihua.common.service.property.PropertyService; |
| | | import com.panzhihua.common.utlis.RSAUtils; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | 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; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("propertyRepair") |
| | | @Api(tags = "物业报修api") |
| | | public class ComPropertyRepairApi extends BaseController { |
| | | @Resource |
| | | private PropertyService propertyService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * @return 所有数据 |
| | | */ |
| | | @ApiOperation("小程序列表接口") |
| | | @PostMapping("/queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | commonPage.setUserId(this.getUserId()); |
| | | return this.propertyService.comPropertyRepairSelectAll(commonPage); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * @return 所有数据 |
| | | */ |
| | | @ApiOperation("小程序列表接口-脱敏") |
| | | @PostMapping("/desensitize/queryAll") |
| | | public R selectAllDesensitize(@RequestBody CommonPage commonPage) { |
| | | commonPage.setUserId(this.getUserId()); |
| | | return this.propertyService.comPropertyRepairSelectAllDesensitize(commonPage); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 小程序添加报修 |
| | | * @param comPropertyRepairVO |
| | | * @return |
| | | */ |
| | | @ApiOperation("小程序添加报修") |
| | | @PostMapping |
| | | public R insert(@RequestBody ComPropertyRepairVO comPropertyRepairVO) { |
| | | comPropertyRepairVO.setCreateTime(DateUtil.date()); |
| | | comPropertyRepairVO.setCreateBy(this.getUserId()); |
| | | comPropertyRepairVO.setRepairStatus(ComPropertyRepairVO.status.dcl); |
| | | return this.propertyService.comPropertyRepairInsert(comPropertyRepairVO); |
| | | } |
| | | |
| | | /** |
| | | * 小程序添加报修 脱敏 |
| | | * @param comPropertyRepairVO |
| | | * @return |
| | | */ |
| | | @ApiOperation("小程序添加报修-脱敏") |
| | | @PostMapping("desensitizeInsert") |
| | | public R desensitizeInsert(@RequestBody ComPropertyRepairVO comPropertyRepairVO) { |
| | | comPropertyRepairVO.setCreateTime(DateUtil.date()); |
| | | comPropertyRepairVO.setCreateBy(this.getUserId()); |
| | | comPropertyRepairVO.setRepairStatus(ComPropertyRepairVO.status.dcl); |
| | | try { |
| | | comPropertyRepairVO.setRepairName(RSAUtils.decrypt(comPropertyRepairVO.getRepairName(), Constants.PRIVATE_KEY)); |
| | | comPropertyRepairVO.setRepairPhone(RSAUtils.decrypt(comPropertyRepairVO.getRepairPhone(), Constants.PRIVATE_KEY)); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return this.propertyService.comPropertyRepairInsert(comPropertyRepairVO); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comPropertyRepairVO 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @ApiOperation("小程序修改报修") |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody ComPropertyRepairVO comPropertyRepairVO) { |
| | | if(comPropertyRepairVO!=null&& StringUtils.isNotEmpty(comPropertyRepairVO.getFeedbackContent())){ |
| | | comPropertyRepairVO.setFeedbackBy(this.getUserId()); |
| | | comPropertyRepairVO.setFeedbackTime(DateUtil.date()); |
| | | comPropertyRepairVO.setRepairStatus(ComPropertyRepairVO.status.dpj); |
| | | } |
| | | if(comPropertyRepairVO!=null&&StringUtils.isNotEmpty(comPropertyRepairVO.getReplyContent())){ |
| | | comPropertyRepairVO.setReplyTime(DateUtil.date()); |
| | | comPropertyRepairVO.setRepairStatus(ComPropertyRepairVO.status.yjs); |
| | | } |
| | | return this.propertyService.comPropertyRepairUpdate(comPropertyRepairVO); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @ApiOperation("详情接口") |
| | | @PostMapping("/detail") |
| | | public R selectDetail(@RequestBody IDTO idto) { |
| | | return this.propertyService.comPropertyRepairSelectOne(idto.getId()); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @ApiOperation("详情接口") |
| | | @GetMapping("/{id}") |
| | | public R selectOne(@PathVariable("id") Long id) { |
| | | return this.propertyService.comPropertyRepairSelectOne(id); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @ApiOperation("详情接口") |
| | | @PostMapping("desensitize") |
| | | public R selectOneDesensitize(Long id) { |
| | | return this.propertyService.comPropertyRepairSelectOneDesensitize(id); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @ApiOperation("删除接口") |
| | | @GetMapping("del") |
| | | public R delete(@RequestParam("id") Long id) { |
| | | return this.propertyService.comPropertyRepairDelete(id); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | |
| | | 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.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.property.PagePropertyWorkerDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.property.ComPropertyWorkerVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * 物业公司工作人员(ComPropertyWorker)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2022-04-26 09:54:07 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = "物业工作人员") |
| | | @RestController |
| | | @RequestMapping("comPropertyWorker") |
| | | public class ComPropertyWorkerApi extends BaseController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @ApiOperation(value = "分页查询物业工作人员", response = ComPropertyWorkerVO.class) |
| | | @PostMapping("/page") |
| | | public R pagePropertyWorker(@RequestBody @Valid PagePropertyWorkerDTO pagePropertyWorkerDTO) { |
| | | return communityService.pagePropertyWorker(pagePropertyWorkerDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "物业工作人员详情", response = ComPropertyWorkerVO.class) |
| | | @ApiImplicitParam(name = "id", value = "物业工作人员id", required = true) |
| | | @GetMapping("/detail") |
| | | public R detailPropertyWorker(@RequestParam("id") Long id) { |
| | | return communityService.detailPropertyWorker(id); |
| | | } |
| | | } |
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.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActReserveCommitVO; |
| | | import com.panzhihua.common.model.vos.community.ComActReserveIndexVo; |
| | | import com.panzhihua.common.model.vos.community.reserve.ComActReserveAppletsVO; |
| | | import com.panzhihua.common.model.vos.community.reserve.ComActReserveDetailVO; |
| | | import com.panzhihua.common.model.vos.community.reserve.ComOperationDetailVO; |
| | | 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(value = "详情",response = ComActReserveDetailVO.class) |
| | | @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(value = "我的预约/登记",response = ComActReserveAppletsVO.class) |
| | | @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){ |
| | | cancelRecordDTO.setUserId(this.getUserId()); |
| | | return communityService.userCancelReserve(cancelRecordDTO); |
| | | } |
| | | |
| | | /** |
| | | * 预约详情操作记录 |
| | | */ |
| | | @ApiOperation(value = "预约详情操作记录",response = ComOperationDetailVO.class) |
| | | @PostMapping("/detailOperation") |
| | | public R reserveOperation(@RequestBody OperationDetailDTO comActReserveOperationRecordDO){ |
| | | comActReserveOperationRecordDO.setUserId(this.getUserId()); |
| | | return communityService.reserveOperation(comActReserveOperationRecordDO); |
| | | } |
| | | |
| | | @ApiOperation(value = "预约登记列表",response = ComActReserveIndexVo.class) |
| | | @GetMapping("/list") |
| | | public R list(@RequestParam("communityId") Long communityId){ |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if(loginUserInfo != null){ |
| | | communityId = loginUserInfo.getCommunityId(); |
| | | } |
| | | return communityService.reserveListApplets(communityId); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.sanshuo.*; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("sanshuo") |
| | | @Api(tags = "三说会堂小程序接口") |
| | | public class ComSanShuoApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @ApiOperation(value = "小程序获取可选择行业分中心列表",response = ComSanShuoIndustryCenterVO.class ) |
| | | @GetMapping("/industryCenter/appletsList") |
| | | public R industryCenterAppList(){ |
| | | return communityService.industryCenterAppList(); |
| | | } |
| | | |
| | | @ApiOperation(value = "小程序获取可选择行专家列表",response = ComSanshuoExpertVO.class ) |
| | | @GetMapping("/expert/appletsList") |
| | | public R expertAppList(@RequestParam (value = "type",required = false)Integer type,@RequestParam(value = "id",required = false)Long id){ |
| | | return communityService.expertAppList(type,id); |
| | | } |
| | | |
| | | @ApiOperation(value = "专家风采",response = ExpertShowVO.class) |
| | | @GetMapping("/expert/expertShow") |
| | | public R expertShow(){ |
| | | return communityService.expertShow(); |
| | | } |
| | | |
| | | @ApiOperation("专家详情") |
| | | @GetMapping("/expert/{id}") |
| | | public R expertDetail(@PathVariable("id")Long id){ |
| | | return communityService.expertDetail(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "事件类型列表",response = ComMediaTypeVO.class) |
| | | @GetMapping("/mediateType/list") |
| | | public R mediateTypeList(){ |
| | | return communityService.eventAppList(); |
| | | } |
| | | |
| | | @ApiOperation(value = "业务中心详情",response = ComSanShuoIndustryCenterVO.class) |
| | | @GetMapping("/industryCenter/detail") |
| | | public R industryCenterDetail(@RequestParam("id") Long id){ |
| | | return communityService.industryCenterDetail(id); |
| | | } |
| | | |
| | | @GetMapping("/expert/expertShowList") |
| | | @ApiOperation(value = "专家风采列表",response = ComSanshuoExpertVO.class) |
| | | public R expertShowList(@RequestParam(value = "level",required = false) @ApiParam("对应的level,1三说会堂2行业分中心3街道4社区")Integer level, |
| | | @RequestParam(value = "id",required = false) @ApiParam("id,level=1不传2行业分中心id 3街道id 4社区id")Long id){ |
| | | return communityService.expertShowList(level,id); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("专家详情展示") |
| | | @GetMapping("/expert/detail") |
| | | public R expertInfo(@RequestParam("id")Long id){ |
| | | return communityService.expertShowList(7,id ); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.sanshuo.*; |
| | | import com.panzhihua.common.service.community.CommunitySanShuoService; |
| | | import com.panzhihua.common.utlis.CopyUtil; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | import java.util.HashMap; |
| | | |
| | | import static java.util.Objects.nonNull; |
| | | |
| | | /** |
| | | * ClassName ComEventController |
| | | * Description 三说会堂事件表控制层 |
| | | * |
| | | * @author manailin |
| | | * @date 2022-09-07 11:23:51 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"三说会堂事件表控制层"}) |
| | | @RestController |
| | | @RequestMapping("/sanshuo/comEvent") |
| | | public class ComSanShuoEventController extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunitySanShuoService comEventService; |
| | | |
| | | |
| | | /** |
| | | * description 新增三说会堂事件表 |
| | | * |
| | | * @param comSanRequestVO 对象 |
| | | * @return R 新增结果对象 |
| | | * @author manailin |
| | | * @date 2022-09-07 11:23:51 |
| | | */ |
| | | @ApiOperation("新增三说会堂事件表") |
| | | @PostMapping("/add") |
| | | public R insertComEvent(@RequestBody @Valid ComSanRequestVO comSanRequestVO, @ApiIgnore BindingResult results) { |
| | | if (results.hasErrors()) { |
| | | return R.fail(results.getFieldError().getDefaultMessage()); |
| | | } |
| | | return comEventService.insertComEvent(comSanRequestVO); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * description 根据ID获取三说会堂事件表信息 |
| | | * |
| | | * @param id 主键id |
| | | * @return R<ComEvent> comEvent 对象 |
| | | * @author manailin |
| | | * @date 2022-09-07 11:23:51 |
| | | */ |
| | | @ApiOperation("根据ID获取三说会堂事件详情信息,返回事件信息和图片信息") |
| | | @GetMapping("/detail/{id}") |
| | | public R<HashMap> detail(@PathVariable(value = "id") String id) { |
| | | if (StringUtils.isEmpty(id)) { |
| | | throw new RuntimeException("参数不能为空"); |
| | | } |
| | | return comEventService.detail(id); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * description page 三说会堂事件表分页列表数据 |
| | | * |
| | | * @param comEventPageRequestVO 对象 |
| | | * @return PageResult<List < ComEvent>> 三说会堂事件表分页列表数据 |
| | | * @author manailin |
| | | * @date 2022-09-07 11:23:51 |
| | | */ |
| | | @ApiOperation(value = "三说会堂事件表分页列表数据", notes = "三说会堂事件表分页列表数据") |
| | | @PostMapping("/page") |
| | | public R page(@RequestBody ComEventPageRequestVO comEventPageRequestVO) { |
| | | log.info("================appId="+comEventPageRequestVO); |
| | | ComEventVO comEventVO = new ComEventVO(); |
| | | BeanUtils.copyProperties(comEventPageRequestVO,comEventVO); |
| | | comEventPageRequestVO.setCreateBy(getUserId()); |
| | | if (nonNull(comEventPageRequestVO.getAppId())){ |
| | | comEventVO.setAppId(comEventPageRequestVO.getAppId()); |
| | | } |
| | | return comEventService.page(comEventVO, comEventVO.getPageNo(), comEventVO.getPageSize()); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * description 修改三说会堂事件表状态 |
| | | * |
| | | * @param id 主键id |
| | | * @return Result 修改成功和失败 |
| | | * @author manailin |
| | | * @date 2022-09-07 11:23:51 |
| | | */ |
| | | @ApiOperation("取消申请") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long"), |
| | | }) |
| | | @PutMapping("/cancelRequest") |
| | | public R cancelRequest(@RequestParam("id") Long id) { |
| | | return comEventService.cancelRequest(id); |
| | | } |
| | | |
| | | /** |
| | | * description 修改三说会堂事件表状态 |
| | | * |
| | | * @param id 主键id |
| | | * @return Result 修改成功和失败 |
| | | * @author manailin |
| | | * @date 2022-09-07 11:23:51 |
| | | */ |
| | | @ApiOperation("专家受理") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "事件ID", required = true, dataType = "Long"), |
| | | @ApiImplicitParam(name = "specterId", value = "专家ID", required = true, dataType = "Long"), |
| | | }) |
| | | @PutMapping("/accept/Request") |
| | | public R acceptRequest( Long id, Long specterId) { |
| | | return comEventService.acceptRequest(id, specterId); |
| | | } |
| | | |
| | | /** |
| | | * description 修改三说会堂事件表状态 |
| | | * |
| | | * @param id 主键id |
| | | * @return Result 修改成功和失败 |
| | | * @author manailin |
| | | * @date 2022-09-07 11:23:51 |
| | | */ |
| | | @ApiOperation("专家不受理,转其他专家处理") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long"), |
| | | }) |
| | | @PutMapping("/reject/Request") |
| | | public R rejectRequest(@RequestParam("id") Long id) { |
| | | return comEventService.rejectRequest(id); |
| | | } |
| | | |
| | | /** |
| | | * description 专家调解处理 |
| | | * |
| | | * @param comEventConciliationVO 主键id |
| | | * @return Result 修改成功和失败 |
| | | * @author manailin |
| | | * @date 2022-09-07 11:23:51 |
| | | */ |
| | | @ApiOperation("专家调解处理") |
| | | @PutMapping("/conciliation/Request") |
| | | public R conciliationRequest(@RequestBody ComEventConciliationVO comEventConciliationVO) { |
| | | return comEventService.conciliationRequest(comEventConciliationVO); |
| | | } |
| | | |
| | | /** |
| | | * description 专家归档 |
| | | * |
| | | * @param comEventArchiveVO 归档对象 |
| | | * @return Result 修改成功和失败 |
| | | * @author manailin |
| | | * @date 2022-09-07 11:23:51 |
| | | */ |
| | | @ApiOperation("事件专家归档") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long"), |
| | | @ApiImplicitParam(name = "result", value = "归档结论", required = true, dataType = "String"), |
| | | }) |
| | | @PutMapping("/archive/Request") |
| | | public R archiveRequest(@RequestBody ComEventArchiveVO comEventArchiveVO) { |
| | | return comEventService.archiveRequest(comEventArchiveVO); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.ComSwDangerReportRectifyDTO; |
| | | import com.panzhihua.common.model.dtos.community.ComSwPatrolRecordAddDTO; |
| | | import com.panzhihua.common.model.dtos.community.ComSwPatrolRecordPageDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComSwDangerReportVO; |
| | | import com.panzhihua.common.model.vos.community.ComSwPatrolRecordVO; |
| | | import com.panzhihua.common.model.vos.community.ComSwSafetyWorkRecordVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.service.partybuilding.PartyBuildingService; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * @auther txb |
| | | * @create 2021-07-23 14:38:38 |
| | | * @describe 社区》安全工作》巡查记录前端控制器 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"社区管理/安全工作"}) |
| | | @RestController |
| | | @RequestMapping("/patrolRecord") |
| | | public class ComSwPatrolRecordApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @Resource |
| | | private PartyBuildingService partyBuildingService; |
| | | |
| | | /** |
| | | * 分页查询巡查记录 |
| | | * |
| | | * @param comSwPatrolRecordPageDTO |
| | | * 查询参数 |
| | | * @return 分页集合 |
| | | */ |
| | | @ApiOperation(value = "分页查询巡查记录", response = ComSwPatrolRecordVO.class) |
| | | @PostMapping("/app/pagePatrolRecord") |
| | | public R pagePatrolRecord(@RequestBody ComSwPatrolRecordPageDTO comSwPatrolRecordPageDTO) { |
| | | Long communityId = this.getCommunityId(); |
| | | if (!comSwPatrolRecordPageDTO.getSelectPerson().equals(1)) { |
| | | comSwPatrolRecordPageDTO.setPatrolPerson(String.valueOf(this.getLoginUserInfo().getPhone())); |
| | | } |
| | | comSwPatrolRecordPageDTO.setCommunityId(communityId); |
| | | comSwPatrolRecordPageDTO.setAreaCode(this.getAreaCode()); |
| | | return communityService.pagePatrolRecord(comSwPatrolRecordPageDTO); |
| | | } |
| | | |
| | | /** |
| | | * 新增巡查记录 |
| | | * |
| | | * @param comSwPatrolRecordAddDTO |
| | | * 新增参数 |
| | | * @return 新增结果 |
| | | */ |
| | | @ApiOperation(value = "新增巡查记录") |
| | | @PostMapping("/app/addPatrolRecord") |
| | | public R addPatrolRecord(@RequestBody ComSwPatrolRecordAddDTO comSwPatrolRecordAddDTO) { |
| | | Long communityId = this.getCommunityId(); |
| | | comSwPatrolRecordAddDTO.setCommunityId(communityId); |
| | | comSwPatrolRecordAddDTO.setCreateBy(this.getUserId()); |
| | | return communityService.addPatrolRecord(comSwPatrolRecordAddDTO); |
| | | } |
| | | |
| | | /** |
| | | * 根据巡查记录id查询详情 |
| | | * |
| | | * @param patrolRecordId |
| | | * 巡查记录id |
| | | * @return 巡查记录详情查询结果 |
| | | */ |
| | | @ApiOperation(value = "根据巡查记录id查询详情", response = ComSwPatrolRecordVO.class) |
| | | @GetMapping("/app/detailPatrolRecord") |
| | | public R detailPatrolRecord(@RequestParam(value = "patrolRecordId") Long patrolRecordId) { |
| | | return communityService.detailPatrolRecord(patrolRecordId); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询安全工作记录 |
| | | * |
| | | * @param comSwPatrolRecordPageDTO |
| | | * 查询参数 |
| | | * @return 安全工作记录分页集合 |
| | | */ |
| | | @ApiOperation(value = "分页查询安全工作记录", response = ComSwSafetyWorkRecordVO.class) |
| | | @PostMapping("/app/pageSafetyWorkRecord") |
| | | public R pageSafetyWorkRecord(@RequestBody ComSwPatrolRecordPageDTO comSwPatrolRecordPageDTO) { |
| | | Long communityId = this.getCommunityId(); |
| | | comSwPatrolRecordPageDTO.setCommunityId(communityId); |
| | | return communityService.pageSafetyWorkRecord(comSwPatrolRecordPageDTO); |
| | | } |
| | | |
| | | /** |
| | | * 根据安全工作记录id查询详情 |
| | | * |
| | | * @param safetyWorkRecordId |
| | | * 安全工作记录 |
| | | * @return 安全工作记录详情查询结果 |
| | | */ |
| | | @ApiOperation(value = "根据安全工作记录id查询详情", response = ComSwSafetyWorkRecordVO.class) |
| | | @GetMapping("/app/detailSafetyWorkRecord") |
| | | public R detailSafetyWorkRecord(@RequestParam(value = "safetyWorkRecordId") Long safetyWorkRecordId) { |
| | | Long communityId = this.getLoginUserInfo().getCommunityId(); |
| | | return communityService.detailSafetyWorkRecord(safetyWorkRecordId, communityId); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询隐患报告 |
| | | * |
| | | * @param comSwPatrolRecordPageDTO |
| | | * 查询参数 |
| | | * @return 隐患报告分页集合 |
| | | */ |
| | | @ApiOperation(value = "分页查询隐患报告", response = ComSwDangerReportVO.class) |
| | | @PostMapping("/app/pageDangerReport") |
| | | public R pageDangerReport(@RequestBody ComSwPatrolRecordPageDTO comSwPatrolRecordPageDTO) { |
| | | Long communityId = this.getCommunityId(); |
| | | comSwPatrolRecordPageDTO.setCommunityId(communityId); |
| | | comSwPatrolRecordPageDTO.setAreaCode(this.getAreaCode()); |
| | | return communityService.pageDangerReport(comSwPatrolRecordPageDTO); |
| | | } |
| | | |
| | | /** |
| | | * 根据隐患报告id查询详情 |
| | | * |
| | | * @param dangerReportId |
| | | * 隐患报告id |
| | | * @return 隐患报告详情查询结果 |
| | | */ |
| | | @ApiOperation(value = "根据隐患报告id查询详情", response = ComSwDangerReportVO.class) |
| | | @GetMapping("/app/detailDangerReport") |
| | | public R detailDangerReport(@RequestParam(value = "dangerReportId") Long dangerReportId) { |
| | | return communityService.detailDangerReport(dangerReportId); |
| | | } |
| | | |
| | | /** |
| | | * 根据巡查记录id查询隐患报告详情 |
| | | * |
| | | * @param patrolRecordId |
| | | * 巡查记录id |
| | | * @return 隐患报告详情查询结果 |
| | | */ |
| | | @ApiOperation(value = "根据巡查记录id查询隐患报告详情", response = ComSwDangerReportVO.class) |
| | | @GetMapping("/app/detailDangerReportByPrId") |
| | | public R detailDangerReportByPrId(@RequestParam(value = "patrolRecordId") Long patrolRecordId) { |
| | | return communityService.detailDangerReportByPrId(patrolRecordId); |
| | | } |
| | | |
| | | /** |
| | | * 整改隐患报告 |
| | | * |
| | | * @param comSwDangerReportRectifyDTO |
| | | * 隐患报告整改参数 |
| | | * @return 整改结果 |
| | | */ |
| | | @ApiOperation(value = "整改隐患报告") |
| | | @PostMapping("/app/rectifyDangerReport") |
| | | public R rectifyDangerReport(@RequestBody ComSwDangerReportRectifyDTO comSwDangerReportRectifyDTO) { |
| | | return communityService.rectifyDangerReport(comSwDangerReportRectifyDTO); |
| | | } |
| | | |
| | | /** |
| | | * 根据日期查询值班人员 |
| | | * |
| | | * @return 查询结果 |
| | | */ |
| | | @ApiOperation(value = "根据日期查询值班人员") |
| | | @GetMapping("/app/getRotaPersonByDate") |
| | | public R getRotaPersonByDate(@RequestParam(value = "rotaDate") String rotaDate) { |
| | | return communityService.getRotaPersonByDate(rotaDate,this.getCommunityId()); |
| | | } |
| | | |
| | | /** |
| | | * 根据日期查询值班领导 |
| | | * |
| | | * @return 查询结果 |
| | | */ |
| | | @ApiOperation(value = "根据日期查询值班领导") |
| | | @GetMapping("/app/getRotaLeaderByDate") |
| | | public R getRotaLeaderByDate(@RequestParam(value = "rotaDate") String rotaDate) { |
| | | return communityService.getRotaLeaderByDate(rotaDate,this.getCommunityId()); |
| | | } |
| | | |
| | | /** |
| | | * 选择人员 |
| | | * |
| | | * @param param |
| | | * 查询条件 |
| | | * @return 查询结果 |
| | | */ |
| | | @ApiOperation(value = "选择人员") |
| | | @PostMapping("/app/getTotlePerson") |
| | | public R getTotlePerson(@RequestParam(value = "param", required = false) String param) { |
| | | Long communityId = this.getLoginUserInfo().getCommunityId(); |
| | | return partyBuildingService.getTotlePerson(param, communityId); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import cn.binarywang.wx.miniapp.api.WxMaSecCheckService; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.panzhihua.applets.config.MinioUtil; |
| | | import com.panzhihua.applets.config.WxMaConfiguration; |
| | | import com.panzhihua.applets.umf.UmfPayUtil; |
| | | import com.panzhihua.applets.unionpay.*; |
| | | import com.panzhihua.common.constants.Constants; |
| | | import com.panzhihua.common.constants.FtpConstants; |
| | | import com.panzhihua.common.constants.UserConstants; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.bracelet.BraceletEarlyWarningDO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.Base64File; |
| | | import com.panzhihua.common.model.vos.community.WeatherVO; |
| | | import com.panzhihua.common.model.vos.user.UserPhoneVO; |
| | | import com.panzhihua.common.service.bracelet.CommunityBraceletService; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.*; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import net.coobird.thumbnailator.Thumbnails; |
| | | import org.apache.commons.io.FilenameUtils; |
| | | import org.apache.commons.lang3.RandomUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.data.redis.core.ValueOperations; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.time.LocalDateTime; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.concurrent.atomic.AtomicBoolean; |
| | | |
| | | import static com.panzhihua.common.utlis.FileTypeUploadUtils.assertAllowed; |
| | | import static com.panzhihua.common.utlis.PayUtil.makeUUID; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: 公共接口 |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-12-10 15:41 |
| | | **/ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/common/") |
| | | @Api(tags = {"公共接口"}) |
| | | public class CommonApi extends BaseController { |
| | | /** |
| | | * 允许的图片文件后缀 |
| | | */ |
| | | private static List<String> fileExtensionAllow = Arrays.asList("gif", "jpg", "png", "jpeg"); |
| | | /** |
| | | * 允许的视频文件后缀 |
| | | */ |
| | | private static List<String> videoExtensionAllow = Arrays.asList("mp4", "mov"); |
| | | @Resource |
| | | private StringRedisTemplate stringRedisTemplate; |
| | | // FTP 登录用户名 |
| | | @Value("${ftp.username}") |
| | | private String userName; |
| | | // FTP 登录密码 |
| | | @Value("${ftp.password}") |
| | | private String password; |
| | | // FTP 服务器地址IP地址 |
| | | @Value("${ftp.host}") |
| | | private String host; |
| | | // FTP 端口 |
| | | @Value("${ftp.port}") |
| | | private int port; |
| | | @Value("${ftp.url}") |
| | | private String url; |
| | | @Value("${minio.url}") |
| | | private String minUrl; |
| | | @Resource |
| | | private WxMaConfiguration wxMaConfiguration; |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @Resource |
| | | private CommunityBraceletService communityBraceletService; |
| | | @Resource |
| | | private MinioUtil minioUtil; |
| | | @Resource |
| | | private UmfPayUtil umfPayUtil; |
| | | |
| | | public static void main(String[] args) { |
| | | // int nextInt = RandomUtils.nextInt(99999, 1000000); |
| | | // System.out.println(nextInt); |
| | | String basicStr = |
| | | "2092261934651932672" + ":" + "de1c0dbb-9197-4724-9cc2-aa94e30a072f" + ":" + System.currentTimeMillis(); |
| | | String s = Base64.getEncoder().encodeToString(basicStr.getBytes()); |
| | | System.out.println(s); |
| | | |
| | | } |
| | | |
| | | @ApiOperation(value = "上传照片/视频 (jpg/jpeg/png/mp4/mov)") |
| | | @PostMapping(value = "uploadimage", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | | public R uploadImage(@RequestParam MultipartFile file, HttpServletRequest request) throws IOException { |
| | | // 微信图片内容校验 |
| | | WxMaSecCheckService wxMaSecCheckService = wxMaConfiguration.getMaService(this.getAppId()).getSecCheckService(); |
| | | String property = System.getProperty("user.dir"); |
| | | |
| | | String fileExtension = ".jpg"; |
| | | |
| | | String originName = file.getOriginalFilename(); |
| | | AtomicBoolean isVideo = new AtomicBoolean(false); |
| | | videoExtensionAllow.forEach(ext -> { |
| | | String originNameLowerCase = originName.toLowerCase(); |
| | | if (originNameLowerCase.endsWith("." + ext)) { |
| | | isVideo.set(true); |
| | | } |
| | | }); |
| | | if (isVideo.get()) { |
| | | fileExtension = ".mp4"; |
| | | } |
| | | |
| | | String fileName = property + File.separator + UUID.randomUUID().toString().replace("-", "") + fileExtension; |
| | | File file1 = new File(fileName); |
| | | |
| | | String name = file.getOriginalFilename(); |
| | | name = UUID.randomUUID().toString().replaceAll("-", "") + fileExtension; |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | InputStream is = file.getInputStream(); |
| | | file.transferTo(file1); |
| | | try { |
| | | // boolean b = wxMaSecCheckService.checkImage(file1); |
| | | boolean delete = file1.delete(); |
| | | log.info("临时文件删除【{}】", delete); |
| | | // if (!b) { |
| | | // return R.fail("图片内容违规"); |
| | | // } |
| | | } catch (Exception e) { |
| | | log.error("微信审核图片出错【{}】", e.getMessage()); |
| | | return R.fail("图片上传失败"); |
| | | // e.printStackTrace(); |
| | | } |
| | | sftp.uploadMore(FtpConstants.FTPFILEPATH_IDCARD, name, is); |
| | | sftp.logout(); |
| | | return R.ok(url + "/idcard/" + name); |
| | | } catch (Exception e) { |
| | | log.error("上传照片失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | |
| | | } |
| | | |
| | | @ApiOperation(value = "新上传照片接口") |
| | | @PostMapping(value = "/uploadimages", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | | public R uploadImages(@RequestParam MultipartFile file, HttpServletRequest request) { |
| | | try { |
| | | assertAllowed(file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION); |
| | | String extension = FilenameUtils.getExtension(file.getOriginalFilename()); |
| | | String name = UUID.randomUUID().toString().replaceAll("-", "") + "." + extension; |
| | | String imageUrl = minioUtil.upload(file, name); |
| | | return R.ok(imageUrl); |
| | | } catch (Exception e) { |
| | | log.error("上传照片失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "文件流上传接口") |
| | | @PostMapping(value = "/uploadImagesInputStream") |
| | | public R uploadImagesInputStream(@RequestBody Base64File file, HttpServletRequest request) { |
| | | if(StringUtils.isEmpty(file.getFile())){ |
| | | return R.fail("文件不能为Null"); |
| | | } |
| | | try { |
| | | String name = UUID.randomUUID().toString().replaceAll("-", "") + ".jpg"; |
| | | InputStream is = minioUtil.base64StrToInputStream(file.getFile().replace("data:image/png;base64,","").replace("data:image/jpg;base64,","").replace("data:image/jpeg;base64,","")); |
| | | String imageUrl = minioUtil.uploadInputStream(is, name); |
| | | return R.ok(imageUrl); |
| | | } catch (Exception e) { |
| | | log.error("上传照片失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "新上传照片压缩接口") |
| | | @PostMapping(value = "/uploadimagescompress", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | | public R uploadImagesComPress(@RequestParam MultipartFile file, HttpServletRequest request) { |
| | | try { |
| | | assertAllowed(file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION); |
| | | String extension = FilenameUtils.getExtension(file.getOriginalFilename()); |
| | | String uuid=UUID.randomUUID().toString().replaceAll("-", ""); |
| | | String name = uuid + "."+ extension; |
| | | String fileName = minioUtil.uploadRetFileName(file, name); |
| | | Thumbnails.of(file.getInputStream()).scale(0.5).outputQuality(0.71).outputFormat("jpg").toFile(uuid+"_compress"); |
| | | File file1=new File(uuid+"_compress.jpg"); |
| | | String imageUrl = minioUtil.uploadFile(file1, uuid+"_compress.jpg"); |
| | | //上传完压缩图后把原图清理,防止文件服务器资源爆满 |
| | | minioUtil.removeMinio(fileName); |
| | | return R.ok(imageUrl); |
| | | } catch (Exception e) { |
| | | log.error("上传照片失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "发送验证码") |
| | | @PostMapping(value = "smscode") |
| | | public R smscode(@RequestBody UserPhoneVO userPhoneVO) { |
| | | String newPhone = userPhoneVO.getNewPhone(); |
| | | if (ObjectUtils.isEmpty(newPhone)) { |
| | | return R.fail("新手机号不能为空"); |
| | | } |
| | | // todo 发送验证码接第三方 |
| | | int nextInt = RandomUtils.nextInt(99999, 1000000); |
| | | ValueOperations<String, String> valueOperations = stringRedisTemplate.opsForValue(); |
| | | valueOperations.set(UserConstants.PHONE_PUT + newPhone, nextInt + "", 3, TimeUnit.MINUTES); |
| | | return R.ok(nextInt); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取天气", response = WeatherVO.class) |
| | | @GetMapping(value = "/getWeather/noToken") |
| | | public R getWeather() { |
| | | // 获取请求url |
| | | String url = Constants.G_D_WEATHER_URL; |
| | | // 获取请求参数 |
| | | String param = "key=" + Constants.G_D_WEATHER_KEY + "&city=510400"; |
| | | String result = HttpUtils.sendGet(url, param); |
| | | return R.ok(JSON.parseObject(result)); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取安全知识培训跳转url") |
| | | @GetMapping(value = "getSafety") |
| | | public R getSafety() |
| | | { |
| | | return R.ok("https://pzh.axhpx.com/Wechat/"); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("uu洗车下单接口") |
| | | @GetMapping("/uuPay") |
| | | public R uuPay(@RequestParam("orderid") String orderid,@RequestParam("openid")String openid,@RequestParam("amount")String amount){ |
| | | Map map=umfPayUtil.pay(orderid, DateUtils.getCurrentDateString(),openid,amount); |
| | | return R.ok(map); |
| | | } |
| | | |
| | | @ApiOperation("无水洗车下单接口") |
| | | @GetMapping("/wsPay") |
| | | public R wsPay(@RequestParam("orderid") String orderid,@RequestParam("openid")String openid,@RequestParam("amount")String amount){ |
| | | Map map=umfPayUtil.pay2(orderid, DateUtils.getCurrentDateString(),openid,amount); |
| | | return R.ok(map); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @ApiOperation("uu洗车银联下单接口") |
| | | @GetMapping("/uuUnionpayPay") |
| | | public R uuUnionpayPay(@RequestParam("amount")String amount, |
| | | @RequestParam("productId")String productId, |
| | | @RequestParam("openId")String openId){ |
| | | |
| | | LocalDateTime time=DateUtils.getCurrentDate(); |
| | | String merOrderId= UnionpayContent.TOP4+time.format(DateUtils.format_ymdhms_yyyyMMddmmHHssSSS)+makeUUID(7); |
| | | String map= UnifiedOrder.sendOrder(amount,"uu洗车下单",productId,openId,time,merOrderId); |
| | | communityService.add(productId,merOrderId,amount); |
| | | return R.ok(map); |
| | | } |
| | | |
| | | @ApiOperation("无水洗车银联下单接口") |
| | | @GetMapping("/wsUnionpayPay") |
| | | public R wsUnionpayPay(@RequestParam("amount")String amount, |
| | | @RequestParam("productId")String productId, |
| | | @RequestParam("openId")String openId){ |
| | | LocalDateTime time=DateUtils.getCurrentDate(); |
| | | String merOrderId= UnionpayContent.TOP4+time.format(DateUtils.format_ymdhms_yyyyMMddmmHHssSSS)+makeUUID(7); |
| | | String map= UnifiedOrder.sendOrder(amount,"无水洗车下单",productId,openId,time,merOrderId); |
| | | communityService.add(productId,merOrderId,amount); |
| | | return R.ok(map); |
| | | } |
| | | |
| | | @ApiOperation("uu洗车银联退款接口") |
| | | @GetMapping("/uuUnionpayRefund") |
| | | public R uuUnionpayRefundPay(@RequestParam("refundAmount")String refundAmount, |
| | | @RequestParam("refundOrderId")String refundOrderId){ |
| | | String map= Refund.sendOrder(refundAmount,refundOrderId); |
| | | return R.ok(map); |
| | | } |
| | | |
| | | @ApiOperation("无水洗车银联退款接口") |
| | | @GetMapping("/wsUnionpayRefund") |
| | | public R wsUnionpayRefundPay(@RequestParam("refundAmount")String refundAmount, |
| | | @RequestParam("refundOrderId")String refundOrderId){ |
| | | String map= Refund.sendOrder(refundAmount,refundOrderId); |
| | | return R.ok(map); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("银联支付查询接口") |
| | | @GetMapping("/unionpayQuery") |
| | | public R unionpayRefundPay(@RequestParam("merOrderId")String merOrderId){ |
| | | String map= Query.query(merOrderId); |
| | | return R.ok(map); |
| | | } |
| | | |
| | | @ApiOperation("银联退款查询接口") |
| | | @GetMapping("/unionpayRefundQuery") |
| | | public R unionpayRefundQuery(@RequestParam("merOrderId")String merOrderId){ |
| | | String map= RefundQuery.refundQuery(merOrderId); |
| | | return R.ok(map); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取预警数据 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | @ApiOperation("微信手环人员处理工单列表") |
| | | @GetMapping("bracelet/getEarlyWarningList") |
| | | public R getList(@RequestParam("pageNum") Integer pageNum, |
| | | @RequestParam("pageSize") Integer pageSize, |
| | | @RequestParam("communityId") String communityId, |
| | | @RequestParam("disposeUserId") String disposeUserId, |
| | | @RequestParam("type") String type) |
| | | { |
| | | return communityBraceletService.getList(pageNum,pageSize,communityId,"",disposeUserId,type,"",""); |
| | | } |
| | | |
| | | /** |
| | | * 微信处理接口 |
| | | * @param braceletEarlyWarningDO |
| | | * @return |
| | | */ |
| | | @PostMapping("bracelet/WXdispose") |
| | | public R WXdispose(@RequestBody BraceletEarlyWarningDO braceletEarlyWarningDO) |
| | | { |
| | | if(StringUtils.isEmpty(braceletEarlyWarningDO.getDisposeText())) |
| | | { |
| | | return R.fail("处理内容不能为空"); |
| | | } |
| | | braceletEarlyWarningDO.setDisposeType("2"); |
| | | return communityBraceletService.WXdispose(braceletEarlyWarningDO); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.applets.weixin.CheckService; |
| | | import com.panzhihua.common.constants.Constants; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.common.PageComMngVolunteerOrgTeamDto; |
| | | import com.panzhihua.common.model.dtos.common.PageComMngVolunteerServiceTypeDto; |
| | | import com.panzhihua.common.model.dtos.common.PageComMngVolunteerSkillDto; |
| | | import com.panzhihua.common.model.dtos.community.*; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.common.ComMngVolunteerOrgTeamVo; |
| | | import com.panzhihua.common.model.vos.common.ComMngVolunteerServiceTypeVo; |
| | | import com.panzhihua.common.model.vos.common.ComMngVolunteerSkillVo; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.model.vos.neighbor.ActivityAnalysisVO; |
| | | import com.panzhihua.common.model.vos.user.SysUserNoticeVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.service.community.CommunityWestService; |
| | | import com.panzhihua.common.service.partybuilding.PartyBuildingService; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | import com.panzhihua.common.validated.PageGroup; |
| | | import io.swagger.annotations.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static org.apache.commons.lang3.ObjectUtils.isEmpty; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: 社区服务 |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-12-10 10:04 |
| | | **/ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/community/") |
| | | @Api(tags = {"社区服务"}) |
| | | public class CommunityApi extends BaseController { |
| | | @Resource |
| | | private CommunityService communityService; |
| | | @Resource |
| | | private CommunityWestService communityWestService; |
| | | @Resource |
| | | private UserService userService; |
| | | @Resource |
| | | private PartyBuildingService partyBuildingService; |
| | | @Resource |
| | | private CheckService checkService; |
| | | |
| | | @ApiOperation(value = "分页查询小区", response = ComMngStructAreaVO.class) |
| | | @PostMapping("pagearea") |
| | | public R pageArea(@RequestBody ComMngStructAreaVO comMngStructAreaVO) { |
| | | return communityService.pageArea(comMngStructAreaVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "新分页查询小区", response = ComMngVillageVO.class) |
| | | @PostMapping("pagevillage") |
| | | public R pageVillage(@RequestBody PageComMngVillageDTO pageComMngVillageDTO) { |
| | | return communityService.pageVillage(pageComMngVillageDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页获取社区动态", response = ComActDynVO.class) |
| | | @PostMapping("pagedynamic") |
| | | public R pageDynamic(@RequestBody ComActDynVO comActDynVO) { |
| | | // LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | // if (loginUserInfo != null) { |
| | | // comActDynVO.setCommunityId(loginUserInfo.getCommunityId()+""); |
| | | // } |
| | | comActDynVO.setIsTopping(null); |
| | | comActDynVO.setStatus(1); |
| | | Integer category = comActDynVO.getCategory(); |
| | | if (isNull(category)) { |
| | | comActDynVO.setCategory(1); |
| | | } |
| | | return communityService.pageDynamic(comActDynVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查项目活动") |
| | | @PostMapping("projectPageActivity") |
| | | public R projectPageActivity(@RequestBody ComActActivityVO comActActivityVO) { |
| | | Long projectId = comActActivityVO.getProjectId(); |
| | | if (isNull(projectId)) { |
| | | Long communityId = this.getCommunityId(); |
| | | comActActivityVO.setCommunityId(communityId); |
| | | } |
| | | // return communityService.pageActivity(ComActActivityVO); |
| | | return communityService.pageActivityCommunityBack(comActActivityVO); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "社区动态详情", response = ComActDynVO.class) |
| | | @GetMapping("detaildynamic") |
| | | @ApiImplicitParam(name = "id", value = "社区动态主键", required = true) |
| | | public R detailDynamic(@RequestParam("id") Long id) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | Long userId = null; |
| | | if (loginUserInfo != null) { |
| | | userId = loginUserInfo.getUserId(); |
| | | } |
| | | R r = communityService.detailDynamic(id); |
| | | if (R.isOk(r)) { |
| | | Object data = r.getData(); |
| | | ComActDynVO comActDynVO = JSONObject.parseObject(JSONObject.toJSONString(data), ComActDynVO.class); |
| | | if (userId != null) { |
| | | // 增加浏览记录 |
| | | R r1 = communityService.addDynamicUser(id, userId); |
| | | if (R.isOk(r1)) { |
| | | comActDynVO.setIsAdd(1); |
| | | } else { |
| | | comActDynVO.setIsAdd(0); |
| | | } |
| | | } |
| | | return R.ok(comActDynVO); |
| | | } |
| | | return r; |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询社区活动", response = ComActActivityVO.class) |
| | | @PostMapping("pageactivity") |
| | | public R pageActivity(@RequestBody ComActActivityVO comActActivityVO) |
| | | { |
| | | if(comActActivityVO.getCommunityId()<=0) |
| | | { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | comActActivityVO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | } |
| | | } |
| | | |
| | | comActActivityVO.setIsApplets(1); |
| | | Integer status = comActActivityVO.getStatus(); |
| | | if (null != status && status.intValue() == 4) { |
| | | comActActivityVO.setIsIng(1); |
| | | } |
| | | return communityService.pageActivity(comActActivityVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "社区活动/志愿者活动详情", response = ComActActivityVO.class) |
| | | @GetMapping("detailactivity") |
| | | @ApiImplicitParam(name = "id", value = "社区活动主键", required = true) |
| | | public R detailActivity(@RequestParam("id") Long id) { |
| | | Long userId = null; |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | userId = loginUserInfo.getUserId(); |
| | | } |
| | | return communityService.detailActivity(id, userId, null, null); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询活动评价记录", response = ComActActEvaluateVO.class) |
| | | @PostMapping("evaluate/page") |
| | | public R pageActivityEvaluates(@RequestBody ComActActEvaluateVO comActActEvaluateVO) { |
| | | return communityService.pageActivityEvaluates(comActActEvaluateVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "社区活动/志愿者活动签到") |
| | | @PostMapping("activity/sign-in") |
| | | public R activitySignIn(@RequestBody ComActActRegistVO comActActRegistVO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | comActActRegistVO.setUserId(loginUserInfo.getUserId()); |
| | | return communityService.activitySignIn(comActActRegistVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "社区活动/志愿者活动评价") |
| | | @PostMapping("activity/evaluate") |
| | | public R activityEvaluate(@RequestBody ComActActEvaluateVO comActActEvaluateVO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | comActActEvaluateVO.setUserId(loginUserInfo.getUserId()); |
| | | String openid = this.getLoginUserInfo().getOpenid(); |
| | | String appId = this.getAppId(); |
| | | // 微信内容审核 |
| | | String evaluateContent = comActActEvaluateVO.getEvaluateContent(); |
| | | if (StrUtil.isNotBlank(evaluateContent)) { |
| | | String result = checkService.checkMessageBy(evaluateContent, openid, appId); |
| | | if (StrUtil.isNotBlank(result)) { |
| | | return R.fail(501, "填写内容存在 " + result + " 违规信息"); |
| | | } |
| | | } |
| | | |
| | | //微信图片审核 |
| | | String photo = comActActEvaluateVO.getPhoto(); |
| | | if (StrUtil.isNotBlank(photo)) { |
| | | if (!checkService.checkImageBy(photo, appId)) { |
| | | return R.fail(501, "上传图片存在违规信息"); |
| | | } |
| | | } |
| | | return communityService.activityEvaluate(comActActEvaluateVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "我的评价", response = MyActivityEvaluateVO.class) |
| | | @GetMapping("activity/my-evaluate") |
| | | public R listMyActivityEvaluate(@RequestParam("activityId") Long activityId) { |
| | | return communityService.listMyActivityEvaluate(getUserId(), activityId); |
| | | } |
| | | |
| | | @ApiOperation(value = "报名/取消报名社区活动") |
| | | @PutMapping("signactivity") |
| | | public R signActivity(@RequestBody @Validated(AddGroup.class) SignactivityVO signactivityVO) { |
| | | Long userId = this.getUserId(); |
| | | Long activityId = signactivityVO.getActivityId(); |
| | | signactivityVO.setUserId(userId); |
| | | R r = communityService.signActivity(signactivityVO); |
| | | if (R.isOk(r) && signactivityVO.getType().intValue() == 1) { |
| | | R r2 = communityService.detailActivity(activityId, userId, null, null); |
| | | ComActActivityVO comActActivityVO = |
| | | JSONObject.parseObject(JSONObject.toJSONString(r2.getData()), ComActActivityVO.class); |
| | | Integer isVolunteer = JSONObject.parseObject(JSONObject.toJSONString(r.getData()), Integer.class); |
| | | SysUserNoticeVO sysUserNoticeVO = new SysUserNoticeVO(); |
| | | sysUserNoticeVO.setUserId(userId); |
| | | sysUserNoticeVO.setType(1); |
| | | sysUserNoticeVO.setTitle("报名成功"); |
| | | sysUserNoticeVO.setBusinessType(1); |
| | | sysUserNoticeVO.setBusinessTitle(comActActivityVO.getActivityName()); |
| | | Date beginAt = comActActivityVO.getBeginAt(); |
| | | sysUserNoticeVO.setBusinessContent(String.format("活动将于%tF %tT 开始,请按时参加", beginAt, beginAt)); |
| | | sysUserNoticeVO.setBusinessId(activityId); |
| | | sysUserNoticeVO.setStatus(0); |
| | | sysUserNoticeVO.setActivityType(comActActivityVO.getType()); |
| | | sysUserNoticeVO.setBusinessStatus(2); |
| | | R r1 = userService.addNotice(sysUserNoticeVO); |
| | | if (R.isOk(r1)) { |
| | | log.info("新增用户报名社区活动通知成功【{}】", JSONObject.toJSONString(sysUserNoticeVO)); |
| | | } |
| | | } |
| | | return r; |
| | | } |
| | | |
| | | @ApiOperation(value = "活动人员列表", response = ActivitySignVO.class) |
| | | @ApiImplicitParams({@ApiImplicitParam(name = "type", value = "人员类型 1 普通居民 2 志愿者", required = true), |
| | | @ApiImplicitParam(name = "id", value = "社区活动主键", required = true)}) |
| | | @GetMapping("listactivitysign") |
| | | public R listActivitySign(@RequestParam("id") Long id, @RequestParam("type") Integer type) { |
| | | ActivitySignVO activitySignVO = new ActivitySignVO(); |
| | | activitySignVO.setActivityId(id); |
| | | if (null == type || 0 == type || type > 2) { |
| | | return R.fail("人员类型错误"); |
| | | } |
| | | activitySignVO.setType(type); |
| | | return communityService.listActivitySign(activitySignVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "活动报名签到情况", response = ActivitySignInRecordVO.class) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "社区活动主键", required = true), |
| | | @ApiImplicitParam(name = "type", value = "活动类型,1.居民/志愿者活动 2.党员活动", required = true) |
| | | }) |
| | | @GetMapping("activity/sign-in/list") |
| | | public R listSignInRecord(@RequestParam("id") Long id, @RequestParam("type") Integer type) { |
| | | LoginUserInfoVO loginUserInfo = getLoginUserInfo(); |
| | | if (loginUserInfo.getIsCommunityWorker().intValue() != 1) { |
| | | return R.fail("非社区工作人员"); |
| | | } |
| | | if (type.intValue() == 1) { |
| | | return communityService.listSignInRecord(id); |
| | | } |
| | | return R.fail("type不存在"); |
| | | } |
| | | |
| | | @ApiOperation(value = "活动签到记录", response = ComActActRegistVO.class) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "活动主键", required = true), |
| | | @ApiImplicitParam(name = "type", value = "活动类型,1.居民/志愿者活动 2.党员活动", required = true), |
| | | @ApiImplicitParam(name = "userId", value = "用户id", required = true) |
| | | }) |
| | | @GetMapping("activity/regist/list") |
| | | public R listRegistRecord(@RequestParam("id") Long id, |
| | | @RequestParam("type") Integer type, |
| | | @RequestParam("userId") Long userId) { |
| | | if (type.intValue() == 1) { |
| | | return communityService.listRegistRecord(id, userId); |
| | | } |
| | | return R.fail("type不存在"); |
| | | } |
| | | |
| | | @ApiOperation(value = "活动邀请列表", response = ActivityInviteVO.class) |
| | | @PostMapping("activity/invite/list") |
| | | public R pageActivityInviteList(@RequestBody @Valid PageActivityInviteDTO pageActivityInviteDTO) { |
| | | return communityService.pageActivityInviteList(pageActivityInviteDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "添加邀请人员") |
| | | @PostMapping("activity/invite/add") |
| | | public R activityInviteAdd(@RequestBody @Valid List<ActivityInviteDTO> list) { |
| | | if (!isEmpty(list)) { |
| | | list.forEach(e -> e.setCreatedBy(this.getUserId())); |
| | | } else { |
| | | return R.fail("列表为空"); |
| | | } |
| | | return communityService.activityInviteAdd(list); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "删除邀请人员") |
| | | @ApiImplicitParam(name = "id", value = "邀请主键id", required = true) |
| | | @DeleteMapping("activity/invite/delete") |
| | | public R activityInviteDelete(@RequestParam("id") Long id) { |
| | | return communityService.activityInviteDelete(id); |
| | | } |
| | | |
| | | // @ApiOperation(value = "新增社区动态浏览记录") |
| | | // @PostMapping("dynamicuser") |
| | | // public R addDynamicUser(@RequestBody ComActDynVO comActDynVO){ |
| | | // Long id = comActDynVO.getId(); |
| | | // if (null==id||id==0) { |
| | | // return R.fail("社区动态不存在"); |
| | | // } |
| | | // Long userId = this.getUserId(); |
| | | // return communityService.addDynamicUser(id,userId); |
| | | // } |
| | | |
| | | @ApiOperation(value = "志愿者申请") |
| | | @PostMapping("volunteer") |
| | | public R addVolunteer(@RequestBody @Validated(AddGroup.class) ComMngVolunteerMngVO comMngVolunteerMngVO) { |
| | | comMngVolunteerMngVO.setState(1); |
| | | comMngVolunteerMngVO.setCommunityId(this.getCommunityId()); |
| | | comMngVolunteerMngVO.setSubmitUserId(this.getUserId()); |
| | | return communityService.addVolunteer(comMngVolunteerMngVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询志愿者团队", response = ComMngVolunteerMngVO.class) |
| | | @PostMapping("pagevolunteer") |
| | | public R pageVolunteer(@RequestBody @Validated(PageGroup.class) PageVolunteerDTO pageVolunteerDTO) { |
| | | ComMngVolunteerMngVO comMngVolunteerMngVO = new ComMngVolunteerMngVO(); |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | comMngVolunteerMngVO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | } else { |
| | | comMngVolunteerMngVO.setCommunityId(pageVolunteerDTO.getCommunityId()); |
| | | } |
| | | comMngVolunteerMngVO.setPageNum(pageVolunteerDTO.getPageNum()); |
| | | comMngVolunteerMngVO.setPageSize(pageVolunteerDTO.getPageSize()); |
| | | return communityService.pageVolunteer(comMngVolunteerMngVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "志愿者详情", response = ComMngVolunteerMngAppletsVO.class) |
| | | @GetMapping("volunteer") |
| | | public R detailVolunteer(@RequestParam("id") Long id) { |
| | | return communityService.detailVolunteer(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询志愿者组织列表", response = ComMngVolunteerOrgTeamVo.class) |
| | | @GetMapping("/volunteer/org/list") |
| | | public R listVolunteerOrgAdmin() { |
| | | PageComMngVolunteerOrgTeamDto orgTeamDto = new PageComMngVolunteerOrgTeamDto(); |
| | | orgTeamDto.setParentId(0L); |
| | | orgTeamDto.setCommunityId(this.getCommunityId()); |
| | | return communityService.listVolunteerOrgAdmin(orgTeamDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询志愿者服务类型列表", response = ComMngVolunteerServiceTypeVo.class) |
| | | @GetMapping("/volunteer/service/type/list") |
| | | public R listVolunteerServiceTypeAdmin() { |
| | | PageComMngVolunteerServiceTypeDto serviceTypeDto = new PageComMngVolunteerServiceTypeDto(); |
| | | serviceTypeDto.setCommunityId(this.getCommunityId()); |
| | | return communityService.listServiceTypeAdmin(serviceTypeDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询志愿者技能列表", response = ComMngVolunteerSkillVo.class) |
| | | @GetMapping("/volunteer/skill/list") |
| | | public R listVolunteerSkillAdmin() { |
| | | PageComMngVolunteerSkillDto volunteerSkillDto = new PageComMngVolunteerSkillDto(); |
| | | volunteerSkillDto.setCommunityId(this.getCommunityId()); |
| | | return communityService.listVolunteerSkillAdmin(volunteerSkillDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "车辆登记") |
| | | @PostMapping("car/register") |
| | | public R addComMngCar(@Validated(AddGroup.class) @RequestBody ComMngCarAppletDTO comMngCarAppletDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | Long communityId = loginUserInfo.getCommunityId(); |
| | | if (null != communityId && 0 != communityId) { |
| | | comMngCarAppletDTO.setCommunityId(communityId); |
| | | comMngCarAppletDTO.setAreaId(loginUserInfo.getAreaId()); |
| | | comMngCarAppletDTO.setUserName(loginUserInfo.getName()); |
| | | comMngCarAppletDTO.setUserId(loginUserInfo.getUserId()); |
| | | comMngCarAppletDTO.setMobile(loginUserInfo.getPhone()); |
| | | comMngCarAppletDTO.setSource(1); |
| | | } |
| | | return communityService.addComMngCarApplet(comMngCarAppletDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "登记车辆列表", response = ComMngCarVO.class) |
| | | @GetMapping("car/list") |
| | | public R comMngCarList() { |
| | | return communityService.userComMngCarList(this.getUserId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取树结构区域信息") |
| | | @GetMapping(value = "arealist") |
| | | public R getAllArea(@ApiParam(name = "城市编码:四川510000", |
| | | required = true) @RequestParam(value = "provinceAdcode") Integer provinceAdcode) { |
| | | return communityService.getCityTreeByProvinceCode(provinceAdcode, null); |
| | | } |
| | | |
| | | @ApiOperation(value = "社区详情", response = ComActVO.class) |
| | | @GetMapping("community") |
| | | public R detailCommunity() { |
| | | return communityService.detailCommunity(this.getCommunityId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询活动报名名单集合", response = ActivitySignVO.class) |
| | | @PostMapping("listactivitysign") |
| | | public R listActivitySign(@RequestBody ActivitySignVO activitySignVO) { |
| | | if (ObjectUtils.isEmpty(activitySignVO.getActivityId())) { |
| | | return R.fail("活动id主键不能为空"); |
| | | } |
| | | return communityService.listActivitySign(activitySignVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询社区列表") |
| | | @GetMapping("actList") |
| | | public R getWestCommunityLists() { |
| | | return communityService.getWestCommunityLists(this.getAreaCode()); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询街道", response = PageComStreetDTO.class) |
| | | @PostMapping("pagestreet") |
| | | public R pageStreet(@RequestBody PageComStreetDTO pageComStreetDTO) { |
| | | pageComStreetDTO.setAreaCode(this.getAreaCode()); |
| | | return communityService.pageStreet(pageComStreetDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增服务活动") |
| | | @PostMapping("activity") |
| | | public R addActivity(@RequestBody @Validated(AddGroup.class) ComActActivityVO comActActivityVO) { |
| | | Long communityId = this.getCommunityId(); |
| | | comActActivityVO.setCommunityId(communityId); |
| | | comActActivityVO.setUserId(this.getLoginUserInfo().getUserId()); |
| | | comActActivityVO.setStatus(2); |
| | | comActActivityVO.setHasPrize(0); |
| | | return communityService.addActivity(comActActivityVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "单位活动统计", response = ActivityAnalysisVO.class) |
| | | @GetMapping("activity/analysis") |
| | | public R activityUnitAnalysis(@RequestParam(value = "year", required = false) Integer year, |
| | | @RequestParam(value = "type", required = false) Integer type, |
| | | @RequestParam(value = "range", required = false) Integer range, |
| | | @RequestParam(value = "communityId", required = false) Long communityId, |
| | | @RequestParam(value = "page", required = false) Integer page, |
| | | @RequestParam(value = "size", required = false) Integer size, |
| | | @RequestParam(value = "belongTo", required = false) String belongTo, |
| | | @RequestParam(value = "unitId", required = false) Long unitId) { |
| | | return communityService.institutionalUnitServiceAnalysis(year, type, range, communityId, page, size, belongTo, unitId, this.getLoginUserInfo().getAccount()); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "分页查询服务范围数据", response = ComActColumnVO.class) |
| | | @PostMapping("comActColumn/queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | if (this.getLoginUserInfo().getStreetId() != null) { |
| | | commonPage.setStreetId(this.getLoginUserInfo().getStreetId()); |
| | | } else { |
| | | commonPage.setCommunityId(this.getCommunityId()); |
| | | } |
| | | return this.communityService.comActColumnSelectAll(commonPage); |
| | | } |
| | | |
| | | @ApiOperation(value = "街道详情", response = ComStreetVO.class) |
| | | @ApiImplicitParam(name = "id", value = "街道id", required = true) |
| | | @GetMapping("street") |
| | | public R detailStreet(@RequestParam("id") Long id) { |
| | | return communityWestService.detailStreet(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "根据id查询社区详情", response = ComActVO.class) |
| | | @ApiImplicitParam(name = "id", value = "社区id", required = true) |
| | | @GetMapping("detail") |
| | | public R detailCommunity(@RequestParam("id") Long id) { |
| | | return communityService.detailCommunity(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取问题清单,需求清单,报道服务活动数量",response = DataCount.class) |
| | | @GetMapping("/dataCount") |
| | | public R dataCount(){ |
| | | return communityService.dataCount(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import java.util.Objects; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | |
| | | 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.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.PageComCvtBusinessAppletsDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.PageClassifyMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.PagePopularMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.PageSearchDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComCvtBusinessDetailVO; |
| | | import com.panzhihua.common.model.vos.community.ComCvtBusinessVO; |
| | | import com.panzhihua.common.model.vos.community.convenient.ConvenientMerchantVO; |
| | | import com.panzhihua.common.model.vos.community.convenient.ConvenientProductLevelInfoVO; |
| | | import com.panzhihua.common.model.vos.community.convenient.ConvenientProductVO; |
| | | import com.panzhihua.common.model.vos.community.convenient.ConvenientServiceCategoryVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * @description: 社区便民服务商家接口 |
| | | * @author: Null |
| | | * @date: 2021/3/11 13:26 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"社区运营/便民服务"}) |
| | | @RestController |
| | | @RequestMapping("/convenient") |
| | | public class CommunityConvenientApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @Deprecated |
| | | @ApiOperation(value = "分页查询便民服务商家", response = ComCvtBusinessVO.class) |
| | | @PostMapping("/business/area/page") |
| | | public R pageComCvtBusiness(@RequestBody PageComCvtBusinessAppletsDTO comCvtBusinessAppletsDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | comCvtBusinessAppletsDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | } |
| | | return communityService.pageComCvtBusinessByServiceArea(comCvtBusinessAppletsDTO); |
| | | } |
| | | |
| | | @Deprecated |
| | | @ApiOperation(value = "查询便民服务商家详情", response = ComCvtBusinessDetailVO.class) |
| | | @GetMapping("/business/get") |
| | | public R getComCvtBusinessServeDetail(@RequestParam("id") Long id) { |
| | | return communityService.getComCvtBusinessServeDetail(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取商家数量大于0的服务类型", response = ConvenientServiceCategoryVO.class) |
| | | @GetMapping("/service-category/suitable") |
| | | public R getSuitableServiceCategories(@RequestParam("communityId") Long communityId) { |
| | | if (Objects.isNull(communityId)) { |
| | | return R.fail("社区id不能为空"); |
| | | } |
| | | return communityService.getSuitableServiceCategories(communityId,this.getAreaCode()); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页获取热门商家", response = ConvenientMerchantVO.class) |
| | | @PostMapping("/merchant/popular") |
| | | public R getPopularMerchants(@RequestBody @Valid PagePopularMerchantDTO pagePopularMerchantDTO) { |
| | | pagePopularMerchantDTO.setAreaCode(this.getAreaCode()); |
| | | return communityService.getPopularMerchants(pagePopularMerchantDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页获取服务类型下商家", response = ConvenientMerchantVO.class) |
| | | @PostMapping("/merchant/classify") |
| | | public R getClassifyMerchants(@RequestBody @Valid PageClassifyMerchantDTO pageClassifyMerchantDTO) { |
| | | pageClassifyMerchantDTO.setAreaCode(this.getAreaCode()); |
| | | return communityService.getClassifyMerchants(pageClassifyMerchantDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "商家详情", response = ConvenientMerchantVO.class) |
| | | @GetMapping("/merchant/detail") |
| | | public R getMerchantDetail(@RequestParam("merchantId") Long merchantId) { |
| | | return communityService.getMerchantDetail(merchantId); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取商家产品", response = ConvenientProductLevelInfoVO.class) |
| | | @GetMapping("/product/list") |
| | | public R getMerchantProduct(@RequestParam("merchantId") Long merchantId) { |
| | | return communityService.getMerchantProduct(merchantId); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取产品详情", response = ConvenientProductVO.class) |
| | | @GetMapping("/product/detail") |
| | | public R getProductDetail(@RequestParam("productId") Long productId) { |
| | | return communityService.getProductDetail(productId); |
| | | } |
| | | |
| | | @ApiOperation(value = "商家分页搜索", response = ConvenientMerchantVO.class) |
| | | @PostMapping("/merchant/search") |
| | | public R pageSearchMerchant(@RequestBody @Valid PageSearchDTO pageSearchDTO) { |
| | | return communityService.pageSearchMerchant(pageSearchDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "商品分页搜索", response = ConvenientProductVO.class) |
| | | @PostMapping("/product/search") |
| | | public R pageSearchProduct(@RequestBody @Valid PageSearchDTO pageSearchDTO) { |
| | | return communityService.pageSearchProduct(pageSearchDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "增加商家咨询量") |
| | | @GetMapping("/merchant/incr-consult") |
| | | public R incrMerchantConsult(@RequestParam("merchantId") Long merchantId) { |
| | | return communityService.consultMerchant(merchantId); |
| | | } |
| | | |
| | | @ApiOperation(value = "增加商家浏览量") |
| | | @GetMapping("/merchant/incr-view") |
| | | public R incrMerchantView(@RequestParam("merchantId") Long merchantId) { |
| | | return communityService.incrMerchantView(merchantId); |
| | | } |
| | | |
| | | @ApiOperation(value = "增加产品浏览量") |
| | | @GetMapping("/product/incr-view") |
| | | public R incrProductView(@RequestParam("productId") Long productId) { |
| | | return communityService.incrProductView(productId); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.PageQuestnaireDTO; |
| | | import com.panzhihua.common.model.dtos.community.integral.admin.AddComActIntegralUserDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.questnaire.QuestnaireListVo; |
| | | import com.panzhihua.common.model.vos.community.questnaire.UsersAnswerQuestnaireVO; |
| | | import com.panzhihua.common.model.vos.community.questnaire.UsersAnswerVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * @description: 社区通/调查问卷接口 |
| | | * @author: cedoo |
| | | * @date: 2021-4-8 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"社区通/调查问卷"}) |
| | | @RestController |
| | | @RequestMapping("/questnaire") |
| | | public class CommunityQuestnaireApi extends BaseController { |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @ApiOperation(value = "分页查询社区调查问卷", response = QuestnaireListVo.class) |
| | | @PostMapping("/pageUser") |
| | | public R pageUser(@RequestBody PageQuestnaireDTO pageQuestnaireDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if (loginUserInfo == null) { |
| | | return R.fail(401, "请先登录"); |
| | | } |
| | | pageQuestnaireDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | pageQuestnaireDTO.setUserId(loginUserInfo.getUserId()); |
| | | return communityService.pageQuestnaire(pageQuestnaireDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询调查问卷详情", response = UsersAnswerVO.class) |
| | | @GetMapping("/detail") |
| | | public R viewQuestnaire(@RequestParam("questId") Long questId) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if (loginUserInfo == null) { |
| | | return R.fail(401, "请先登录"); |
| | | } |
| | | return communityService.viewDetail(loginUserInfo.getUserId(), questId); |
| | | } |
| | | |
| | | @ApiOperation(value = "居民填写问卷调查问卷") |
| | | @PostMapping("/stat/answer") |
| | | public R usersAnswerQuestnaire(@RequestBody UsersAnswerQuestnaireVO usersAnswerQuestnaireVO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if (loginUserInfo == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | usersAnswerQuestnaireVO.setUserId(loginUserInfo.getUserId()); |
| | | // 填写调查问卷发放积分 |
| | | communityService.addIntegralTradeAdmin(new AddComActIntegralUserDTO(usersAnswerQuestnaireVO.getQuestId(), |
| | | AddComActIntegralUserDTO.integralType.cydcwj, loginUserInfo.getCommunityId(), loginUserInfo.getUserId())); |
| | | return communityService.usersAnsweQuestnaire(usersAnswerQuestnaireVO); |
| | | |
| | | } |
| | | |
| | | @ApiOperation(value = "添加浏览量") |
| | | @GetMapping("/add/view") |
| | | public R addView(@RequestParam("questId") Long questId) { |
| | | return communityService.addView(questId); |
| | | } |
| | | |
| | | @ApiOperation(value = "用户弹窗添加不在提醒接口") |
| | | @GetMapping("/add/noNotice") |
| | | public R addNoNotice(@RequestParam("questId") Long questId) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if (loginUserInfo == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | return communityService.addNoNotice(questId, loginUserInfo.getUserId()); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.switchs.SearchCommunityDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.switchs.CommunitySwitchAllAppletsVO; |
| | | import com.panzhihua.common.model.vos.community.switchs.StreetAllAppletsVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/switch/") |
| | | @Api(tags = {"切换社区模块"}) |
| | | public class CommunitySwitchApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @ApiOperation(value = "查询所有社区", response = StreetAllAppletsVO.class) |
| | | @GetMapping("/list/noToken") |
| | | public R list() { |
| | | return communityService.communitySwitchList(this.getAppId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "根据名字搜索社区", response = CommunitySwitchAllAppletsVO.class) |
| | | @GetMapping("/search/noToken") |
| | | public R search(@RequestParam(value = "name") String name) { |
| | | return communityService.communitySwitchSearchList(name,this.getAppId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "根据距离搜索社区", response = CommunitySwitchAllAppletsVO.class) |
| | | @PostMapping("/distance/noToken") |
| | | public R searchDistance(@RequestBody SearchCommunityDTO communityDTO) { |
| | | return communityService.communitySwitchSearchDistanceList(communityDTO); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.panzhihua.applets.weixin.CheckService; |
| | | import com.panzhihua.common.constants.Constants; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.*; |
| | | import com.panzhihua.common.model.dtos.community.integral.admin.AddComActIntegralUserDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActDiscussCommentVO; |
| | | import com.panzhihua.common.model.vos.community.ComActDiscussVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | import com.panzhihua.common.validated.PutGroup; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: 一起议 |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2021-01-22 15:30 |
| | | **/ |
| | | @Slf4j |
| | | @Api(tags = {"一起议"}) |
| | | @RestController |
| | | @RequestMapping("/") |
| | | public class DiscussApi extends BaseController { |
| | | @Resource |
| | | private CommunityService communityService; |
| | | @Resource |
| | | private CheckService checkService; |
| | | |
| | | @ApiOperation(value = "一起议-新增") |
| | | @PostMapping("discuss") |
| | | public R addDiscuss(@RequestBody @Validated(AddGroup.class) ComActDiscussDTO comActDiscussDTO) { |
| | | String openid = this.getLoginUserInfo().getOpenid(); |
| | | String appId = this.getAppId(); |
| | | // 微信内容审核 |
| | | String discussSubject = comActDiscussDTO.getDiscussSubject(); |
| | | if (StrUtil.isNotBlank(discussSubject)) { |
| | | String result = checkService.checkMessageBy(discussSubject, openid, appId); |
| | | if (StrUtil.isNotBlank(result)) { |
| | | return R.fail(501, "填写内容存在 " + result + " 违规信息"); |
| | | } |
| | | } |
| | | |
| | | //微信图片审核 |
| | | String photoPah = comActDiscussDTO.getPhotoPah(); |
| | | if (StrUtil.isNotBlank(photoPah)) { |
| | | if (!checkService.checkImageBy(photoPah, appId)) { |
| | | return R.fail(501, "上传图片存在违规信息"); |
| | | } |
| | | } |
| | | |
| | | Integer type = comActDiscussDTO.getType(); |
| | | String voteTitle = comActDiscussDTO.getVoteTitle(); |
| | | List<ComActDiscussOptionDTO> discussOptions = comActDiscussDTO.getDiscussOptions(); |
| | | if (type.equals(2)) { |
| | | if (ObjectUtils.isEmpty(voteTitle)) { |
| | | return R.fail("投票标题不能为空"); |
| | | } |
| | | if (ObjectUtils.isEmpty(discussOptions)) { |
| | | return R.fail("选项不能为空"); |
| | | } |
| | | if (discussOptions.size() < 2) { |
| | | return R.fail("请至少设置两个投票选项"); |
| | | } |
| | | //设置投票开始时间 nowDate |
| | | comActDiscussDTO.setStartTime(DateUtils.format(new Date(), DateUtils.ymdhms_format)); |
| | | } |
| | | String address = comActDiscussDTO.getAddress(); |
| | | if (ObjectUtils.isEmpty(address)) { |
| | | return R.fail("地址不能为空"); |
| | | } else if (address.contains("null")) { |
| | | comActDiscussDTO.setAddress(null); |
| | | } |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | Long userId = loginUserInfo.getUserId(); |
| | | Long communityId = loginUserInfo.getCommunityId(); |
| | | comActDiscussDTO.setUserId(userId); |
| | | comActDiscussDTO.setCommunityId(communityId); |
| | | comActDiscussDTO.setIsApplets(true); |
| | | comActDiscussDTO.setLoginUserInfo(loginUserInfo); |
| | | return communityService.addDiscuss(comActDiscussDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "一起议-分页查询", response = ComActDiscussVO.class) |
| | | @PostMapping("pagediscuss") |
| | | public R pageDiscuss(@RequestBody PageComActDiscussDTO pageComActDiscussDTO) { |
| | | if (Objects.isNull(pageComActDiscussDTO.getType())) { |
| | | return R.fail("查询类型不能为空"); |
| | | } |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | pageComActDiscussDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | pageComActDiscussDTO.setLoginUserId(loginUserInfo.getUserId()); |
| | | |
| | | Integer isMy = pageComActDiscussDTO.getIsMy(); |
| | | if (null != isMy && isMy.intValue() == 1) { |
| | | pageComActDiscussDTO.setUserId(loginUserInfo.getUserId()); |
| | | } |
| | | } |
| | | return communityService.pageDiscussApplets(pageComActDiscussDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "一起议-分页查询-脱敏", response = ComActDiscussVO.class) |
| | | @PostMapping("pageDiscussDesensitize") |
| | | public R pageDiscussDesensitize(@RequestBody PageComActDiscussDTO pageComActDiscussDTO) { |
| | | if (Objects.isNull(pageComActDiscussDTO.getType())) { |
| | | return R.fail("查询类型不能为空"); |
| | | } |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | pageComActDiscussDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | pageComActDiscussDTO.setLoginUserId(loginUserInfo.getUserId()); |
| | | |
| | | Integer isMy = pageComActDiscussDTO.getIsMy(); |
| | | if (null != isMy && isMy.intValue() == 1) { |
| | | pageComActDiscussDTO.setUserId(loginUserInfo.getUserId()); |
| | | } |
| | | } |
| | | return communityService.pageDiscussAppletsDesensitize(pageComActDiscussDTO); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "一起议-回复") |
| | | @PostMapping("discusscomment") |
| | | public R addDiscussComment(@RequestBody ComActDiscussCommentDTO comActDiscussCommentDTO) { |
| | | String comment = comActDiscussCommentDTO.getComment(); |
| | | if (ObjectUtils.isEmpty(comment)) { |
| | | return R.fail("回复不能为空"); |
| | | } |
| | | Long discussId = comActDiscussCommentDTO.getDiscussId(); |
| | | if (null == discussId || 0 == discussId) { |
| | | return R.fail("一起议主键不能为空"); |
| | | } |
| | | String result = checkService.checkMessageBy(comment, this.getLoginUserInfo().getOpenid(), this.getAppId()); |
| | | if (StrUtil.isNotBlank(result)) { |
| | | return R.fail(501, "填写内容存在 " + result + " 违规信息"); |
| | | } |
| | | comActDiscussCommentDTO.setUserId(this.getUserId()); |
| | | // 议事投票计算积分 |
| | | AddComActIntegralUserDTO integralUserDTO = new AddComActIntegralUserDTO(discussId, |
| | | AddComActIntegralUserDTO.integralType.cyystp, this.getCommunityId(), this.getUserId()); |
| | | integralUserDTO.setIsComment(1); |
| | | communityService.addIntegralTradeAdmin(integralUserDTO); |
| | | return communityService.addDiscussComment(comActDiscussCommentDTO); |
| | | |
| | | } |
| | | |
| | | @ApiOperation(value = "一起议-点赞、取消点赞") |
| | | @PutMapping("discussuser") |
| | | public R putDiscussUser(@RequestBody @Validated ComActDiscussUserDTO comActDiscussUserDTO) { |
| | | comActDiscussUserDTO.setUserId(this.getUserId()); |
| | | return communityService.putDiscussUser(comActDiscussUserDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "一起议-评论-点赞、取消点赞") |
| | | @PutMapping("discusscommentuser") |
| | | public R putDiscussCommentUser(@RequestBody @Validated ComActDiscussCommentUserDTO comActDiscussUserDTO) { |
| | | comActDiscussUserDTO.setUserId(this.getUserId()); |
| | | return communityService.putDiscussCommentUser(comActDiscussUserDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "一起议-详情", response = ComActDiscussVO.class) |
| | | @GetMapping("discuss") |
| | | @ApiImplicitParam(name = "id", value = "一起议主键", required = true) |
| | | public R detailDiscuss(@RequestParam("id") Long id) { |
| | | Long userId = 0L; |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | userId = loginUserInfo.getUserId(); |
| | | } |
| | | return communityService.detailDiscussApplets(id, userId); |
| | | } |
| | | |
| | | @ApiOperation(value = "一起议-详情-脱敏", response = ComActDiscussVO.class) |
| | | @GetMapping("discussDesensitize") |
| | | @ApiImplicitParam(name = "id", value = "一起议主键", required = true) |
| | | public R detailDiscussDesensitize(@RequestParam("id") Long id) { |
| | | Long userId = 0L; |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | userId = loginUserInfo.getUserId(); |
| | | } |
| | | return communityService.detailDiscussAppletsDesensitize(id, userId); |
| | | } |
| | | |
| | | @ApiOperation(value = "一起议-评论-分页查询", response = ComActDiscussCommentVO.class) |
| | | @PostMapping("pagediscusscomment") |
| | | public R pageDiscussComment(@RequestBody PageComActDiscussCommentDTO pageComActDiscussCommentDTO) { |
| | | Long id = pageComActDiscussCommentDTO.getId(); |
| | | if (null == id || 0 == id) { |
| | | return R.fail("一起议主键不能为空"); |
| | | } |
| | | Long userId = 0L; |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | userId = loginUserInfo.getUserId(); |
| | | } |
| | | pageComActDiscussCommentDTO.setLoginUserId(userId); |
| | | return communityService.pageDiscussCommentApplets(pageComActDiscussCommentDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "一起议-评论-分页查询-脱敏", response = ComActDiscussCommentVO.class) |
| | | @PostMapping("pageDiscussCommentDesensitize") |
| | | public R pageDiscussCommentDesensitize(@RequestBody PageComActDiscussCommentDTO pageComActDiscussCommentDTO) { |
| | | Long id = pageComActDiscussCommentDTO.getId(); |
| | | if (null == id || 0 == id) { |
| | | return R.fail("一起议主键不能为空"); |
| | | } |
| | | Long userId = 0L; |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | userId = loginUserInfo.getUserId(); |
| | | } |
| | | pageComActDiscussCommentDTO.setLoginUserId(userId); |
| | | return communityService.pageDiscussCommentAppletsDesensitize(pageComActDiscussCommentDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "一起议-评论-回复") |
| | | @PostMapping("discusscommentback") |
| | | public R addDiscussCommentBack(@RequestBody ComActDiscussCommentDTO comActDiscussCommentDTO) { |
| | | String comment = comActDiscussCommentDTO.getComment(); |
| | | if (ObjectUtils.isEmpty(comment)) { |
| | | return R.fail("回复不能为空"); |
| | | } |
| | | Long id = comActDiscussCommentDTO.getId(); |
| | | if (null == id || 0 == id) { |
| | | return R.fail("评论主键不能为空"); |
| | | } |
| | | String result = checkService.checkMessageBy(comment, this.getLoginUserInfo().getOpenid(), this.getAppId()); |
| | | if (StrUtil.isNotBlank(result)) { |
| | | return R.fail(501, "填写内容存在 " + result + " 违规信息"); |
| | | } |
| | | comActDiscussCommentDTO.setUserId(this.getUserId()); |
| | | return communityService.addDiscussCommentBack(comActDiscussCommentDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "一起议-投票") |
| | | @PostMapping("discussoptionuser") |
| | | public R addDiscussOptionUser(@RequestBody @Valid DiscussVoteOptionDTO discussVoteOptionDTO) { |
| | | List<ComActDiscussVoteOptionDTO> options = discussVoteOptionDTO.getOptions(); |
| | | if (options.isEmpty()) { |
| | | return R.fail("选项内容不能为空"); |
| | | } |
| | | discussVoteOptionDTO.setUserId(this.getUserId()); |
| | | options.forEach(option -> { |
| | | // 议事投票计算积分 |
| | | AddComActIntegralUserDTO integralUserDTO = new AddComActIntegralUserDTO(option.getId(), |
| | | AddComActIntegralUserDTO.integralType.cyystp, this.getCommunityId(), this.getUserId()); |
| | | integralUserDTO.setIsComment(2); |
| | | communityService.addIntegralTradeAdmin(integralUserDTO); |
| | | }); |
| | | return communityService.addDiscussOptionUser(discussVoteOptionDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "一起议-增加浏览量") |
| | | @PostMapping("discuss/increase-view-num") |
| | | public void increaseViewNum(@RequestParam("discussId") |
| | | @ApiParam(value = "一起议主键id", required = true) |
| | | Long discussId) { |
| | | communityService.increaseViewNum(discussId); |
| | | } |
| | | |
| | | @ApiOperation(value = "一起议-公布/编辑投票结果") |
| | | @PostMapping("discuss/edit-result") |
| | | public R editDiscussResult(@RequestBody @Validated(PutGroup.class) ComActDiscussDTO comActDiscussDTO) { |
| | | comActDiscussDTO.setUserId(this.getUserId()); |
| | | return communityService.editDiscussResult(comActDiscussDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "一起议-获取是否有发布权限", response = Boolean.class) |
| | | @GetMapping("discuss/permissions") |
| | | public R getDiscussPermissions() { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | ComActDiscussDTO comActDiscussDTO = new ComActDiscussDTO(); |
| | | comActDiscussDTO.setLoginUserInfo(loginUserInfo); |
| | | comActDiscussDTO.setIsApplets(true); |
| | | comActDiscussDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | return communityService.getDiscussPermissions(comActDiscussDTO); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.EldersAuthAddByFamilyDTO; |
| | | import com.panzhihua.common.model.dtos.community.EldersAuthTypeQueryDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageComEldersRecordsDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageEldersAuthDTO; |
| | | 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.vos.IPageVO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComEldersAuthElderlyDetailsVO; |
| | | import com.panzhihua.common.model.vos.community.EldersAuthDetailsVO; |
| | | import com.panzhihua.common.model.vos.community.EldersAuthVO; |
| | | import com.panzhihua.common.model.vos.elders.ComElderAuthUserAppVO; |
| | | import com.panzhihua.common.model.vos.elders.ComElderAuthUserDetailVO; |
| | | import com.panzhihua.common.model.vos.user.ComMngFamilyInfoVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.utlis.ClazzUtils; |
| | | import com.panzhihua.common.utlis.TencentUtils; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * |
| | | * @author cedoo email:cedoo(a)qq.com |
| | | * @version 1.0 |
| | | * @since 1.0 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/eldersauth") |
| | | @Api(tags = {"高龄认证"}) |
| | | public class EldersAuthApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService eldersAuthService; |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | /** |
| | | * 分页查找 |
| | | * |
| | | * @param pageEldersAuthDTO |
| | | * 查找高龄认证传递对象 |
| | | * @return 查找结果 |
| | | */ |
| | | @PostMapping("/page") |
| | | @ApiOperation(value = "查询高龄认证@已过期", response = EldersAuthVO.class) |
| | | R query(@Validated @RequestBody PageEldersAuthDTO pageEldersAuthDTO) { |
| | | ClazzUtils.setIfStringIsEmpty(pageEldersAuthDTO); |
| | | pageEldersAuthDTO.setSumitUserId(this.getUserId()); |
| | | return eldersAuthService.query(pageEldersAuthDTO); |
| | | } |
| | | |
| | | /** |
| | | * 查询高龄认证详细信息 |
| | | * |
| | | * @param id |
| | | * 高龄认证 id |
| | | * @return 查找结果 |
| | | */ |
| | | @GetMapping("/{id}") |
| | | @ApiOperation(value = "查询高龄认证详细信息@已过期", response = EldersAuthDetailsVO.class) |
| | | R<EldersAuthDetailsVO> details(@PathVariable("id") Long id) { |
| | | return eldersAuthService.eldersAuthDetails(id); |
| | | } |
| | | |
| | | @GetMapping("/family") |
| | | @ApiOperation(value = "我的家庭成员@已过期", response = R.class) |
| | | R<IPageVO<ComMngFamilyInfoVO>> family() { |
| | | return eldersAuthService.getMyfamilyElders(getUserId()); |
| | | } |
| | | |
| | | /** |
| | | * 新增高龄认证 |
| | | * |
| | | * @param eldersAuthAddByFamilyDTO |
| | | * 添加高龄认证传递对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/addByFamily") |
| | | @ApiOperation(value = "新增高龄认证", response = R.class) |
| | | R addByFamily(@RequestBody EldersAuthAddByFamilyDTO eldersAuthAddByFamilyDTO) { |
| | | eldersAuthAddByFamilyDTO.setSumitUserId(getUserId()); |
| | | eldersAuthAddByFamilyDTO.setUserId(getUserId()); |
| | | return eldersAuthService.addByFamilyUser(eldersAuthAddByFamilyDTO); |
| | | } |
| | | |
| | | @GetMapping("/authtype") |
| | | @ApiOperation(value = "查询社区认证方式", response = R.class) |
| | | R communityAuthtype() { |
| | | Long communityId = this.getCommunityId(); |
| | | EldersAuthTypeQueryDTO eldersAuthTypeQueryDTO = new EldersAuthTypeQueryDTO(); |
| | | eldersAuthTypeQueryDTO.setCommunityId(communityId); |
| | | return eldersAuthService.communityElderAuthType(eldersAuthTypeQueryDTO); |
| | | } |
| | | |
| | | @PostMapping("/getEidToken") |
| | | @ApiOperation(value = "高龄认证获取EidToken接口") |
| | | public R getEidToken(@RequestParam("authUserId") Long authUserId) { |
| | | if (authUserId == null) { |
| | | return R.fail("参数错误"); |
| | | } |
| | | |
| | | R isOk = eldersAuthService.getEldersAuthUserByApp(authUserId); |
| | | if (R.isOk(isOk)) { |
| | | ComElderAuthUserDetailVO authUserDetailVO = |
| | | JSONObject.parseObject(JSONObject.toJSONString(isOk.getData()), ComElderAuthUserDetailVO.class); |
| | | // 获取EidToken接口 |
| | | String result = TencentUtils.getEidToken(authUserDetailVO.getName(), authUserDetailVO.getIdCard()); |
| | | return R.ok(result); |
| | | } else { |
| | | log.error("查询老人信息失败,错误信息:" + isOk.getMsg()); |
| | | return isOk; |
| | | } |
| | | } |
| | | |
| | | @PostMapping("/getEidResult") |
| | | @ApiOperation(value = "高龄认证获取核验结果接口") |
| | | public R getEidResult(@Validated @RequestBody ComEldersAuthGetResultDTO authGetResultDTO) { |
| | | |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if (loginUserInfo == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | authGetResultDTO.setUserId(loginUserInfo.getUserId()); |
| | | |
| | | String result = TencentUtils.getEidResult(authGetResultDTO.getEidToken()); |
| | | JSONObject object = JSON.parseObject(result); |
| | | if (object == null) { |
| | | return R.fail("核验失败"); |
| | | } |
| | | |
| | | JSONObject textObject = object.getJSONObject("Text"); |
| | | |
| | | String code = textObject.getString("ErrCode"); |
| | | if (!code.equals("0")) { |
| | | log.error("人脸核验失败,错误原因:" + textObject.toJSONString()); |
| | | return R.fail("核验失败"); |
| | | } |
| | | |
| | | authGetResultDTO.setVerificationResult(object.toJSONString()); |
| | | return eldersAuthService.addEldersAuthByApp(authGetResultDTO); |
| | | } |
| | | |
| | | @PostMapping("/page/old") |
| | | @ApiOperation(value = "高龄认证分页接口", response = ComElderAuthUserAppVO.class) |
| | | public R pageElders(@RequestBody ComEldersAuthPageDTO authPageDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if (loginUserInfo == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | authPageDTO.setUserId(loginUserInfo.getUserId()); |
| | | authPageDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | return eldersAuthService.pageEldersByApp(authPageDTO); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @ApiOperation(value = "高龄认证添加老人接口") |
| | | public R addElders(@RequestBody ComEldersAuthUserAddAppDTO authUserAddAppDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if (loginUserInfo == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | authUserAddAppDTO.setUserId(loginUserInfo.getUserId()); |
| | | authUserAddAppDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | return eldersAuthService.addEldersByApp(authUserAddAppDTO); |
| | | } |
| | | |
| | | @PostMapping("/edit") |
| | | @ApiOperation(value = "高龄认证修改老人接口") |
| | | public R editElders(@RequestBody ComEldersAuthUserAddAppDTO authUserAddAppDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if (loginUserInfo == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | authUserAddAppDTO.setUserId(loginUserInfo.getUserId()); |
| | | authUserAddAppDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | return eldersAuthService.editEldersByApp(authUserAddAppDTO); |
| | | } |
| | | |
| | | /** |
| | | * 分页查找 |
| | | * |
| | | * @param pageComEldersRecordsDTO |
| | | * 查找高龄认证记录 |
| | | * @return 查找结果 |
| | | */ |
| | | @PostMapping("/records") |
| | | @ApiOperation(value = "生存认证记录", response = EldersAuthVO.class) |
| | | R query(@Validated @RequestBody PageComEldersRecordsDTO pageComEldersRecordsDTO) { |
| | | ClazzUtils.setIfStringIsEmpty(pageComEldersRecordsDTO); |
| | | LoginUserInfoVO loginUserInfoVO = this.getLoginUserInfo(); |
| | | pageComEldersRecordsDTO.setOperUserId(loginUserInfoVO.getUserId()); |
| | | pageComEldersRecordsDTO.setOperUserName(loginUserInfoVO.getNickName()); |
| | | return eldersAuthService.queryEldersRecord(pageComEldersRecordsDTO); |
| | | } |
| | | |
| | | /** |
| | | * 查询高龄老人库详细信息 |
| | | * |
| | | * @param id |
| | | * 高龄老人库 id |
| | | * @return 查找结果 |
| | | */ |
| | | @GetMapping("/records/{id}") |
| | | @ApiOperation(value = "认证详情详细信息") |
| | | R<ComEldersAuthElderlyDetailsVO> detail(@PathVariable("id") Long id) { |
| | | return eldersAuthService.comEldersAuthElderlyDetails(id); |
| | | } |
| | | |
| | | @GetMapping("/no/tips") |
| | | @ApiOperation(value = "高龄认证不再显示提示") |
| | | public R noTips() { |
| | | LoginUserInfoVO loginUserInfoVO = this.getLoginUserInfo(); |
| | | if (loginUserInfoVO == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | return userService.noTips(loginUserInfoVO.getUserId()); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.panzhihua.common.constants.Constants; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import com.panzhihua.applets.weixin.CheckService; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.ComOpsHouseDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageComOpsHouseDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComOpsHouseUndercarriageVO; |
| | | import com.panzhihua.common.model.vos.community.ComOpsHouseVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | import com.panzhihua.common.validated.PutGroup; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: 房屋租售 |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2021-01-22 15:30 |
| | | **/ |
| | | @Slf4j |
| | | @Api(tags = {"房屋租售"}) |
| | | @RestController |
| | | @RequestMapping("/") |
| | | public class HouseApi extends BaseController { |
| | | @Resource |
| | | private CommunityService communityService; |
| | | @Resource |
| | | private CheckService checkService; |
| | | |
| | | @ApiOperation(value = "房屋租售-新增") |
| | | @PostMapping("house") |
| | | public R addHouse(@RequestBody @Validated(AddGroup.class) ComOpsHouseDTO comOpsHouseDTO) { |
| | | // 微信内容审核 |
| | | String introduction = comOpsHouseDTO.getIntroduction(); |
| | | if (StrUtil.isNotBlank(introduction)) { |
| | | String result = checkService.checkMessageBy(introduction, this.getLoginUserInfo().getOpenid(),this.getAppId()); |
| | | if (StrUtil.isNotBlank(result)) { |
| | | return R.fail(501, "填写内容存在 " + result + " 违规信息"); |
| | | } |
| | | } |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | Long userId = loginUserInfo.getUserId(); |
| | | Long communityId = loginUserInfo.getCommunityId(); |
| | | comOpsHouseDTO.setUserId(userId); |
| | | comOpsHouseDTO.setCommunityId(communityId); |
| | | comOpsHouseDTO.setUserType(1); |
| | | return communityService.addOpsHouse(comOpsHouseDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "房屋租售-分页查询", response = ComOpsHouseVO.class) |
| | | @PostMapping("pagehouse") |
| | | public R pageHouse(@RequestBody PageComOpsHouseDTO pageComOpsHouseDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | Integer isMy = pageComOpsHouseDTO.getIsMy(); |
| | | if (null != isMy && isMy.equals(1)) { |
| | | pageComOpsHouseDTO.setUserId(loginUserInfo.getUserId()); |
| | | } |
| | | return communityService.pageOpsHouse(pageComOpsHouseDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "房屋租售-详情", response = ComOpsHouseVO.class) |
| | | @GetMapping("house") |
| | | @ApiImplicitParam(name = "id", value = "房屋租售主键", required = true) |
| | | public R detailHouse(@RequestParam("id") Long id) { |
| | | return communityService.detailOpsHouse(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "房屋租售-修改") |
| | | @PostMapping("putHouse") |
| | | public R updateHouse(@RequestBody @Validated(PutGroup.class) ComOpsHouseVO comOpsHouseVO) { |
| | | return communityService.putOpsHouseByApplets(comOpsHouseVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "房屋租售-删除") |
| | | @GetMapping("delHouse") |
| | | @ApiImplicitParam(name = "id", value = "房屋租售主键", required = true) |
| | | public R delHouse(@RequestParam("id") Long id) { |
| | | return communityService.deleteOpsHouse(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "房屋租售-上下架") |
| | | @PostMapping("undercarriageHouse") |
| | | public R undercarriageHouse(@RequestBody @Validated(PutGroup.class) ComOpsHouseUndercarriageVO comOpsHouseVO) { |
| | | return communityService.undercarriageHouse(comOpsHouseVO); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | |
| | | 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.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.AddIdentityAuthDTO; |
| | | import com.panzhihua.common.model.dtos.community.GetIdentityEidTokenDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageIdentityAuthRecordDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.IdentityAuthRecordDetailVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * @title: IdentityAuthApi 身份认证相关API |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 小程序端身份认证相关 |
| | | * @author: hans |
| | | * @date: 2021/09/01 16:00 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/identity-auth") |
| | | @Api(tags = {"身份认证"}) |
| | | public class IdentityAuthApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @ApiOperation(value = "查询社区身份认证方式", response = R.class) |
| | | @GetMapping("/mode") |
| | | public R getIdentityAuthMode(@RequestParam(value = "communityId") |
| | | @ApiParam(value = "社区id", required = true) |
| | | Long communityId, |
| | | @RequestParam(value = "identityAuthType") |
| | | @ApiParam(value = "身份认证类型", required = true) |
| | | Integer identityAuthType) { |
| | | return communityService.getIdentityAuthMode(communityId, identityAuthType); |
| | | } |
| | | |
| | | @ApiOperation(value = "身份认证获取EidToken接口") |
| | | @PostMapping("/getEidToken") |
| | | public R getEidToken(@RequestBody @Valid GetIdentityEidTokenDTO getIdentityEidTokenDTO) { |
| | | return communityService.getEidToken(getIdentityEidTokenDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增身份认证") |
| | | @PostMapping("/add") |
| | | public R addIdentityAuth(@RequestBody @Valid AddIdentityAuthDTO addIdentityAuthDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | addIdentityAuthDTO.setSubmitUserId(loginUserInfo.getUserId()); |
| | | addIdentityAuthDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | addIdentityAuthDTO.setAreaCode(this.getAreaCode()); |
| | | return communityService.addIdentityAuth(addIdentityAuthDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询身份认证记录", response = IdentityAuthRecordDetailVO.class) |
| | | @PostMapping("/record/page") |
| | | public R queryRecordWithPage(@RequestBody @Valid PageIdentityAuthRecordDTO pageIdentityAuthRecordDTO) { |
| | | pageIdentityAuthRecordDTO.setSubmitUserId(this.getUserId()); |
| | | return communityService.queryRecordWithPage(pageIdentityAuthRecordDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取身份认证详情", response = IdentityAuthRecordDetailVO.class) |
| | | @GetMapping("/detail") |
| | | public R retrieveIdentityAuthDetail(@RequestParam("authType") |
| | | @ApiParam(value = "身份认证类型(1.高龄认证 2.养老认证)", required = true, allowableValues = "1,2", example = "1") |
| | | Integer authType, |
| | | @RequestParam("identityAuthId") |
| | | @ApiParam(value = "身份认证id", required = true, example = "1") |
| | | Long identityAuthId) { |
| | | return communityService.retrieveIdentityAuthDetail(authType, identityAuthId); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.panzhihua.applets.weixin.CheckService; |
| | | import com.panzhihua.common.constants.Constants; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.CommonDTO; |
| | | import com.panzhihua.common.model.dtos.PageDTO; |
| | | import com.panzhihua.common.model.dtos.common.EditComActEasyPhotoHandlerDto; |
| | | import com.panzhihua.common.model.dtos.common.EvaluateEasyDto; |
| | | import com.panzhihua.common.model.dtos.common.PageComActEasyPhotoHandlerDto; |
| | | import com.panzhihua.common.model.dtos.community.ComActEasyPhotoCommentDTO; |
| | | import com.panzhihua.common.model.dtos.community.ComActEasyPhotoCommentUserDTO; |
| | | import com.panzhihua.common.model.dtos.community.NoticeReadDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageComActEasyPhotoCommentDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.advertisement.ComOpsAdvVO; |
| | | import com.panzhihua.common.model.vos.common.ComActEasyPhotoHandlerVo; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.model.vos.community.easyPhoto.BannerVO; |
| | | import com.panzhihua.common.model.vos.community.easyPhoto.ComActEasyPhotoClassifyVO; |
| | | import com.panzhihua.common.model.vos.user.NoticeUnReadVO; |
| | | import com.panzhihua.common.model.vos.user.SysUserAgreementVO; |
| | | import com.panzhihua.common.model.vos.user.SysUserNoticeVO; |
| | | import com.panzhihua.common.service.community.ComActEasyPhotoEvaluateFeign; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | import com.panzhihua.common.validated.PageGroup; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: 首页 |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-12-10 14:39 |
| | | **/ |
| | | @RestController |
| | | @RequestMapping("/index/") |
| | | @Api(tags = {"首页"}) |
| | | public class IndexApi extends BaseController { |
| | | @Resource |
| | | private CommunityService communityService; |
| | | @Resource |
| | | private UserService userService; |
| | | @Resource |
| | | private CheckService checkService; |
| | | @Resource |
| | | private ComActEasyPhotoEvaluateFeign easyPhotoEvaluateFeign; |
| | | |
| | | @ApiOperation(value = "分页展示社区随手拍", response = ComActEasyPhotoVO.class) |
| | | @PostMapping("pageeasyphoto") |
| | | public R pageEasyPhoto(@RequestBody ComActEasyPhotoVO comActEasyPhotoVO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | comActEasyPhotoVO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | comActEasyPhotoVO.setLogInUserId(loginUserInfo.getUserId()); |
| | | comActEasyPhotoVO.setIsDpcMember(loginUserInfo.getIsDpcMember()); |
| | | } |
| | | return communityService.pageEasyPhotoApplets(comActEasyPhotoVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页展示社区随手拍-脱敏", response = ComActEasyPhotoVO.class) |
| | | @PostMapping("pageEasyPhotoDesensitize") |
| | | public R pageEasyPhotoDesensitize(@RequestBody ComActEasyPhotoVO comActEasyPhotoVO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | comActEasyPhotoVO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | comActEasyPhotoVO.setLogInUserId(loginUserInfo.getUserId()); |
| | | comActEasyPhotoVO.setIsDpcMember(loginUserInfo.getIsDpcMember()); |
| | | } |
| | | return communityService.pageEasyPhotoAppletsDesensitize(comActEasyPhotoVO); |
| | | } |
| | | |
| | | @ApiOperation("上传随手拍") |
| | | @PostMapping("easyphoto") |
| | | public R addEasyPhoto(@RequestBody @Validated(AddGroup.class) ComActEasyPhotoVO comActEasyPhotoVO) { |
| | | // 微信内容审核 |
| | | String openid = this.getLoginUserInfo().getOpenid(); |
| | | String appId = this.getAppId(); |
| | | // 微信内容审核 |
| | | String detail = comActEasyPhotoVO.getDetail(); |
| | | if (StrUtil.isNotBlank(detail)) { |
| | | String result = checkService.checkMessageBy(detail, openid, appId); |
| | | if (StrUtil.isNotBlank(result)) { |
| | | return R.fail(501, "填写内容存在 " + result + " 违规信息"); |
| | | } |
| | | } |
| | | |
| | | //微信图片审核 |
| | | String photoPathList = comActEasyPhotoVO.getPhotoPathList(); |
| | | if (StrUtil.isNotBlank(photoPathList)) { |
| | | if (!checkService.checkImageBy(photoPathList, appId)) { |
| | | return R.fail(501, "上传图片存在违规信息"); |
| | | } |
| | | } |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | Long communityId = loginUserInfo.getCommunityId(); |
| | | if (null == communityId || 0 == communityId) { |
| | | return R.fail("用户未绑定社区"); |
| | | } |
| | | Long userId = loginUserInfo.getUserId(); |
| | | comActEasyPhotoVO.setCommunityId(communityId); |
| | | comActEasyPhotoVO.setSponsorId(userId); |
| | | comActEasyPhotoVO.setStatus(1); |
| | | return communityService.addEasyPhoto(comActEasyPhotoVO); |
| | | } |
| | | |
| | | /** |
| | | * description queryByPage 分页查询 |
| | | * |
| | | * @param comActEasyPhotoHandler 请求参数 |
| | | * @return 分页查询返回参数 |
| | | * @author lyq |
| | | * @date 2022-03-01 13:45:10 |
| | | */ |
| | | @ApiOperation(value = "查询处理列表", response = ComActEasyPhotoHandlerVo.class) |
| | | @PostMapping("/handleList") |
| | | public R handleList(@RequestBody PageComActEasyPhotoHandlerDto comActEasyPhotoHandler) { |
| | | comActEasyPhotoHandler.setUserId(this.getUserId()); |
| | | return this.communityService.queryEasyPhotoHandler(comActEasyPhotoHandler); |
| | | } |
| | | |
| | | /** |
| | | * description edit 编辑数据 |
| | | * |
| | | * @param comActEasyPhotoHandler 请求参数 |
| | | * @return 编辑结果 |
| | | * @author lyq |
| | | * @date 2022-03-01 13:45:10 |
| | | */ |
| | | @ApiOperation(value = "提交反馈") |
| | | @PostMapping("/editEasyPhotoHandler") |
| | | public R editEasyPhotoHandler(@RequestBody EditComActEasyPhotoHandlerDto comActEasyPhotoHandler) { |
| | | return this.communityService.editEasyPhotoHandler(comActEasyPhotoHandler); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询处理详情", response = ComActEasyPhotoHandlerVo.class) |
| | | @ApiImplicitParam(name = "id", value = "处理id", required = true) |
| | | @GetMapping("/easyPhotoHandler") |
| | | public R detailEasyPhotoHandler(@RequestParam("id") Long id) { |
| | | return this.communityService.detailEasyPhotoHandler(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询随手拍是否有活动", response = ComActEasyPhotoActivityVO.class) |
| | | @PostMapping("getEasyPhotoActivity") |
| | | public R getEasyPhotoActivity(@RequestBody CommonDTO commonDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | Long communityId = commonDTO.getCommunityId(); |
| | | if (loginUserInfo != null) { |
| | | communityId = loginUserInfo.getCommunityId(); |
| | | } |
| | | return communityService.getEasyPhotoActivity(communityId); |
| | | } |
| | | |
| | | @ApiOperation(value = "随手拍详情", response = ComActEasyPhotoVO.class) |
| | | @GetMapping("detaileasyphoto") |
| | | @ApiImplicitParam(name = "id", value = "随手拍主键") |
| | | public R detailEasyPhoto(@RequestParam("id") Long id) { |
| | | Long userId = 0L; |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | userId = loginUserInfo.getUserId(); |
| | | } |
| | | return communityService.detailEasyPhoto(id, userId); |
| | | } |
| | | @ApiOperation(value = "随手拍详情-脱敏", response = ComActEasyPhotoVO.class) |
| | | @GetMapping("detailEasyPhotoDesensitize") |
| | | @ApiImplicitParam(name = "id", value = "随手拍主键") |
| | | public R detailEasyPhotoDesensitize(@RequestParam("id") Long id) { |
| | | Long userId = 0L; |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | userId = loginUserInfo.getUserId(); |
| | | } |
| | | return communityService.detailEasyPhotoDesensitize(id, userId); |
| | | } |
| | | |
| | | @ApiOperation(value = "随手拍--评论--分页查询", response = ComActEasyPhotoCommentVO.class) |
| | | @PostMapping("pagecomacteasyphotocomment") |
| | | public R pageComActEasyPhotoComment(@RequestBody PageComActEasyPhotoCommentDTO pageComActEasyPhotoCommentDTO) { |
| | | Long userId = 0L; |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | userId = loginUserInfo.getUserId(); |
| | | } |
| | | pageComActEasyPhotoCommentDTO.setUserId(userId); |
| | | return communityService.pageComActEasyPhotoComment(pageComActEasyPhotoCommentDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "随手拍--评论--分页查询-脱敏", response = ComActEasyPhotoCommentVO.class) |
| | | @PostMapping("pageComActEasyPhotoCommentDesensitize") |
| | | public R pageComActEasyPhotoCommentDesensitize(@RequestBody PageComActEasyPhotoCommentDTO pageComActEasyPhotoCommentDTO) { |
| | | Long userId = 0L; |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | userId = loginUserInfo.getUserId(); |
| | | } |
| | | pageComActEasyPhotoCommentDTO.setUserId(userId); |
| | | return communityService.pageComActEasyPhotoCommentDesensitize(pageComActEasyPhotoCommentDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "随手拍--评论--新增评论") |
| | | @PostMapping("comacteasyphotocomment") |
| | | public R addComActEasyPhotoComment(@RequestBody ComActEasyPhotoCommentDTO comActEasyPhotoCommentDTO) { |
| | | // 微信内容审核 |
| | | String openid = this.getLoginUserInfo().getOpenid(); |
| | | String appId = this.getAppId(); |
| | | // 微信内容审核 |
| | | String comment = comActEasyPhotoCommentDTO.getComment(); |
| | | if (StrUtil.isNotBlank(comment)) { |
| | | String result = checkService.checkMessageBy(comment, openid, appId); |
| | | if (StrUtil.isNotBlank(result)) { |
| | | return R.fail(501, "填写内容存在 " + result + " 违规信息"); |
| | | } |
| | | } |
| | | comActEasyPhotoCommentDTO.setUserId(this.getUserId()); |
| | | return communityService.addComActEasyPhotoComment(comActEasyPhotoCommentDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "随手拍--评论--点赞/取消点赞") |
| | | @PostMapping("commentsign") |
| | | public R commentSign(@RequestBody ComActEasyPhotoCommentUserDTO comActEasyPhotoCommentUserDTO) { |
| | | comActEasyPhotoCommentUserDTO.setUserId(this.getUserId()); |
| | | return communityService.commentSign(comActEasyPhotoCommentUserDTO); |
| | | } |
| | | |
| | | @ApiOperation("点赞/取消点赞随手拍") |
| | | @PutMapping("easyphoto") |
| | | public R putEasyPhoto(@RequestBody ComActEasyPhotoVO comActEasyPhotoVO) { |
| | | Long id = comActEasyPhotoVO.getId(); |
| | | if (null == id || id == 0) { |
| | | return R.fail("随手拍主键不能为空"); |
| | | } |
| | | Integer haveGiveThumbsUp = comActEasyPhotoVO.getHaveGiveThumbsUp(); |
| | | if (null == haveGiveThumbsUp) { |
| | | return R.fail("操作类型不能为空"); |
| | | } |
| | | Long userId = this.getUserId(); |
| | | comActEasyPhotoVO.setSponsorId(userId); |
| | | return communityService.putEasyPhoto(comActEasyPhotoVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页展示社区微心愿", response = ComActMicroWishVO.class) |
| | | @PostMapping("pagemicrowish") |
| | | public R pageMicroWish(@RequestBody ComActMicroWishVO comActMicroWishVO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | comActMicroWishVO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | comActMicroWishVO.setResponsibleId(loginUserInfo.getUserId());// 责任人暂时放登录用户id |
| | | } |
| | | comActMicroWishVO.setIsApplets(1); |
| | | comActMicroWishVO.setIsPageMyWish(null); |
| | | return communityService.pageMicroWishApplets(comActMicroWishVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页展示社区微心愿-脱敏", response = ComActMicroWishVO.class) |
| | | @PostMapping("pageMicroWishDesensitize") |
| | | public R pageMicroWishDesensitize(@RequestBody ComActMicroWishVO comActMicroWishVO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | comActMicroWishVO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | comActMicroWishVO.setResponsibleId(loginUserInfo.getUserId());// 责任人暂时放登录用户id |
| | | } |
| | | comActMicroWishVO.setIsApplets(1); |
| | | comActMicroWishVO.setIsPageMyWish(null); |
| | | return communityService.pageMicroWishAppletsDesensitize(comActMicroWishVO); |
| | | } |
| | | |
| | | @ApiOperation("发布微心愿") |
| | | @PostMapping("microwish") |
| | | public R addMicroWish(@RequestBody @Validated(AddGroup.class) ComActMicroWishVO comActMicroWishVO) { |
| | | // 微信内容审核 |
| | | String msg = comActMicroWishVO.getDetail(); |
| | | if (StrUtil.isNotBlank(msg)) { |
| | | String result = checkService.checkMessageBy(msg, this.getLoginUserInfo().getOpenid(),this.getAppId()); |
| | | if (StrUtil.isNotBlank(result)) { |
| | | return R.fail(501, "填写内容存在 " + result + " 违规信息"); |
| | | } |
| | | } |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | Long communityId = loginUserInfo.getCommunityId(); |
| | | if (null == communityId || 0 == communityId) { |
| | | return R.fail("用户未绑定社区"); |
| | | } |
| | | Long userId = loginUserInfo.getUserId(); |
| | | String phone = loginUserInfo.getPhone(); |
| | | if (ObjectUtils.isEmpty(phone)) { |
| | | // return R.fail("用户绑定手机号后才能发布微心愿"); |
| | | phone = "18228784579"; |
| | | } |
| | | comActMicroWishVO.setSponsorPhone(phone); |
| | | comActMicroWishVO.setCommunityId(communityId); |
| | | comActMicroWishVO.setSponsorId(userId); |
| | | return communityService.addMicroWish(comActMicroWishVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "心愿详情", response = ComActMicroWishVO.class) |
| | | @GetMapping("microwish") |
| | | @ApiImplicitParam(name = "id", value = "微心愿主键") |
| | | public R detailMicroWish(@RequestParam("id") Long id) { |
| | | Long userId = 0L; |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | userId = loginUserInfo.getUserId(); |
| | | } |
| | | return communityService.detailMicroWish(id, userId); |
| | | } |
| | | |
| | | @ApiOperation(value = "心愿详情-脱敏", response = ComActMicroWishVO.class) |
| | | @GetMapping("microwishDesensitize") |
| | | @ApiImplicitParam(name = "id", value = "微心愿主键") |
| | | public R detailMicroWishDesensitize(@RequestParam("id") Long id) { |
| | | Long userId = 0L; |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | userId = loginUserInfo.getUserId(); |
| | | } |
| | | return communityService.detailMicroWishDesensitize(id, userId); |
| | | } |
| | | |
| | | @ApiOperation("点赞/取消点赞微心愿") |
| | | @PutMapping("microwish") |
| | | public R putMicroWish(@RequestBody ComActMicroWishVO comActMicroWishVO) { |
| | | Long id = comActMicroWishVO.getId(); |
| | | if (null == id || id == 0) { |
| | | return R.fail("微心愿主键不能为空"); |
| | | } |
| | | Long userId = this.getUserId(); |
| | | comActMicroWishVO.setSponsorId(userId);// 发起人字段暂时存放userId |
| | | return communityService.putMicroWish(comActMicroWishVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "首页广告banner", response = ComOpsAdvVO.class) |
| | | @GetMapping("listadvertisement/noToken") |
| | | public R listAdvertisement(@RequestParam(value = "type",required = false,defaultValue = "1") Integer type) { |
| | | return communityService.listAdvertisement(type); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页通知列表", response = SysUserNoticeVO.class) |
| | | @PostMapping("pagenotice") |
| | | public R pageNotice(@RequestBody @Validated(PageGroup.class) PageDTO pageDTO) { |
| | | Long userId = this.getUserId(); |
| | | pageDTO.setUserId(userId); |
| | | return userService.pageNotice(pageDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "通知已读") |
| | | @PutMapping("notice") |
| | | public R putNotice(@RequestBody NoticeReadDTO noticeReadDTO) { |
| | | Long userId = this.getUserId(); |
| | | noticeReadDTO.setUserId(userId); |
| | | return userService.putNotice(noticeReadDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "未读消息汇总", response = NoticeUnReadVO.class) |
| | | @GetMapping("noticeunreadnum") |
| | | public R noticeUnreadNum() { |
| | | Long userId = this.getUserId(); |
| | | return userService.noticeUnreadNum(userId); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取各种协议", response = SysUserAgreementVO.class) |
| | | @GetMapping("agreement") |
| | | @ApiImplicitParam(name = "type", value = "1居民端app协议 2网格员端app协议 3商家端app协议 4隐私政策") |
| | | public R agreement(@RequestParam("type") Integer type) { |
| | | return userService.agreement(type, this.getAppId()); |
| | | } |
| | | |
| | | @ApiOperation("发布留言") |
| | | @PostMapping("addmessage") |
| | | public R addMessage(@RequestBody @Validated(AddGroup.class) ComActMessageVO comActMessageVO) { |
| | | // 微信内容审核 |
| | | String msg = comActMessageVO.getMsgContent(); |
| | | if (StrUtil.isNotBlank(msg)) { |
| | | String result = checkService.checkMessageBy(msg, this.getLoginUserInfo().getOpenid(),this.getAppId()); |
| | | if (StrUtil.isNotBlank(result)) { |
| | | return R.fail(501, "填写内容存在 " + result + " 违规信息"); |
| | | } |
| | | } |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | Long communityId = loginUserInfo.getCommunityId(); |
| | | if (null == communityId || 0 == communityId) { |
| | | return R.fail("用户未绑定社区"); |
| | | } |
| | | Integer type = loginUserInfo.getType(); |
| | | if (null == type || (type != 1 && type != 2)) { |
| | | return R.fail("留言对象类型错误!"); |
| | | } |
| | | Long userId = loginUserInfo.getUserId(); |
| | | comActMessageVO.setCommunityId(communityId); |
| | | comActMessageVO.setUserId(userId); |
| | | comActMessageVO.setUserName(loginUserInfo.getName()); |
| | | comActMessageVO.setUserAccount(loginUserInfo.getAccount()); |
| | | comActMessageVO.setIspublic(1); |
| | | comActMessageVO.setStatus(1); |
| | | return communityService.addMessage(comActMessageVO); |
| | | } |
| | | |
| | | @ApiOperation("发布留言回复") |
| | | @PostMapping("addmessageback") |
| | | public R addMessageBack(@RequestBody @Validated(AddGroup.class) ComActMessageBackVO comActMessageBackVO) { |
| | | // 微信内容审核 |
| | | String msg = comActMessageBackVO.getMsgContent(); |
| | | if (StrUtil.isNotBlank(msg)) { |
| | | String result = checkService.checkMessageBy(msg, this.getLoginUserInfo().getOpenid(),this.getAppId()); |
| | | if (StrUtil.isNotBlank(result)) { |
| | | return R.fail(501, "填写内容存在 " + result + " 违规信息"); |
| | | } |
| | | } |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | Long communityId = loginUserInfo.getCommunityId(); |
| | | if (null == communityId || 0 == communityId) { |
| | | return R.fail("用户未绑定社区"); |
| | | } |
| | | Integer type = loginUserInfo.getType(); |
| | | if (null == type || (type != 1 && type != 2)) { |
| | | return R.fail("留言对象类型错误!"); |
| | | } |
| | | Long userId = loginUserInfo.getUserId(); |
| | | comActMessageBackVO.setCommunityId(communityId); |
| | | comActMessageBackVO.setUserId(userId); |
| | | comActMessageBackVO.setUserName(loginUserInfo.getName()); |
| | | comActMessageBackVO.setUserAccount(loginUserInfo.getAccount()); |
| | | comActMessageBackVO.setIspublic(1); |
| | | comActMessageBackVO.setStatus(1); |
| | | return communityService.addMessageBack(comActMessageBackVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页显示我的留言", response = ComActMessageVO.class) |
| | | @PostMapping("pagemymessage") |
| | | public R pageMyMessage(@RequestBody ComActMessageVO comActMessageVO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | Long communityId = loginUserInfo.getCommunityId(); |
| | | if (null == communityId || 0 == communityId) { |
| | | return R.fail("用户未绑定社区"); |
| | | } |
| | | comActMessageVO.setCommunityId(communityId); |
| | | comActMessageVO.setUserId(loginUserInfo.getUserId()); |
| | | return communityService.pageMyMessageApplets(comActMessageVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页显示居民给我的留言", response = ComActMessageVO.class) |
| | | @PostMapping("pagesendtomemessage") |
| | | public R pageSendToMessage(@RequestBody ComActMessageVO comActMessageVO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | Long communityId = loginUserInfo.getCommunityId(); |
| | | if (null == communityId || 0 == communityId) { |
| | | return R.fail("用户未绑定社区"); |
| | | } |
| | | comActMessageVO.setCommunityId(communityId); |
| | | comActMessageVO.setUserId(loginUserInfo.getUserId()); |
| | | comActMessageVO.setPhone(loginUserInfo.getPhone()); |
| | | return communityService.pageSendToMessageApplets(comActMessageVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页显示指定用户的留言", response = ComActMessageVO.class) |
| | | @PostMapping("pagemessagebyuser") |
| | | public R pageMessageByUser(@RequestBody ComActMessageVO comActMessageVO) { |
| | | return communityService.pageMessageByUser(comActMessageVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "留言详情", response = ComActMessageVO.class) |
| | | @GetMapping("detailmessage") |
| | | @ApiImplicitParam(name = "id", value = "随手拍主键") |
| | | public R detailMessage(@RequestParam("id") Long id) { |
| | | return communityService.detailMessage(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "首页商城开关接口") |
| | | @GetMapping("isShop") |
| | | public R isShop() { |
| | | return R.ok(Constants.IS_SHOP_OPEN); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取最新活动和用户最新收益", response = BannerVO.class) |
| | | @GetMapping("getUserReward") |
| | | public R getUserReward(@RequestParam("communityId") Long communityId) { |
| | | Long userId = 0L; |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | userId = loginUserInfo.getUserId(); |
| | | if (loginUserInfo.getCommunityId() != null) { |
| | | communityId = loginUserInfo.getCommunityId(); |
| | | } |
| | | } |
| | | return communityService.getUserReward(userId, communityId); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取首页弹窗接口", response = ComActEasyPhotoRewardVO.class) |
| | | @GetMapping("getUserRewards") |
| | | public R getUserRewards(@RequestParam("communityId") Long communityId) { |
| | | Long userId = 0L; |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | userId = loginUserInfo.getUserId(); |
| | | communityId = loginUserInfo.getCommunityId(); |
| | | } |
| | | return communityService.getUserRewards(userId, communityId); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取普达首页弹窗接口", response = ComActEasyPhotoRewardVO.class) |
| | | @GetMapping("getUserRewardsNew") |
| | | public R getUserRewardsNew(@RequestParam("communityId") Long communityId) { |
| | | Long userId = 0L; |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | userId = loginUserInfo.getUserId(); |
| | | communityId = loginUserInfo.getCommunityId(); |
| | | } |
| | | return communityService.getUserRewardsNew(userId, communityId); |
| | | } |
| | | |
| | | @ApiOperation(value = "读取用户随手拍奖励") |
| | | @PostMapping("readUserReward") |
| | | public R readUserReward() { |
| | | return communityService.readUserReward(this.getUserId(), this.getCommunityId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "随手拍分类列表", response = ComActEasyPhotoClassifyVO.class) |
| | | @GetMapping("easyphoto/classify/list") |
| | | public R easyPhotoClassifyList() { |
| | | return communityService.listPhotoClassify(this.getAreaCode()); |
| | | } |
| | | |
| | | @ApiOperation(value = "随手拍评价") |
| | | @PostMapping("easyphoto/whistle/evaluate") |
| | | public R evaluateEasyPhotoWhistle(@RequestBody EvaluateEasyDto whistleDto) { |
| | | whistleDto.setUserId(this.getUserId()); |
| | | return easyPhotoEvaluateFeign.evaluateEasyApplets(whistleDto); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.bracelet.BraceletEarlyWarningDO; |
| | | import com.panzhihua.common.model.dtos.community.PageActWorkGuideDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.JinhuiPageConvenientMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.PageConvenientMerchantDTO; |
| | | 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.convenient.ConvenientMerchantVO; |
| | | import com.panzhihua.common.model.vos.community.convenient.ConvenientServiceCategoryVO; |
| | | import com.panzhihua.common.model.vos.community.convenient.JinhuiConvenientMerchantVO; |
| | | import com.panzhihua.common.model.vos.jinhui.*; |
| | | import com.panzhihua.common.model.vos.user.SysUserNoticeVO; |
| | | import com.panzhihua.common.service.bracelet.CommunityBraceletService; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.service.jinhui.JinhuiCommunityService; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/jin_hui/") |
| | | @Api(tags = {"小程序-金汇社区api"}) |
| | | public class JinHuiCommnuityApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @Resource |
| | | private JinhuiCommunityService jinhuiCommunityService; |
| | | |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | @ApiOperation(value = "新增服务活动") |
| | | @PostMapping("add/activity") |
| | | public R addActivity(@RequestBody @Validated(AddGroup.class) ComActActivityVO comActActivityVO) { |
| | | Long communityId = this.getCommunityId(); |
| | | comActActivityVO.setCommunityId(communityId); |
| | | comActActivityVO.setUserId(this.getLoginUserInfo().getUserId()); |
| | | comActActivityVO.setStatus(2); |
| | | comActActivityVO.setHasPrize(0); |
| | | comActActivityVO.setHaveIntegralReward(0); |
| | | return communityService.addActivity(comActActivityVO); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "用户签到") |
| | | @PostMapping("activitySignIn") |
| | | public R jinhuiactivitySignIn(@RequestBody @Validated(AddGroup.class) ComActActRegistVO comActActRegistVO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | comActActRegistVO.setUserId(loginUserInfo.getUserId()); |
| | | return communityService.jinhuiActivitySignIn(comActActRegistVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "报名/取消报名社区活动") |
| | | @PutMapping("signactivity") |
| | | public R signActivity(@RequestBody @Validated(AddGroup.class) SignactivityVO signactivityVO) { |
| | | Long userId = this.getUserId(); |
| | | Long activityId = signactivityVO.getActivityId(); |
| | | signactivityVO.setUserId(userId); |
| | | R r = communityService.jinhuiSignActivity(signactivityVO); |
| | | if (R.isOk(r) && signactivityVO.getType().intValue() == 1) { |
| | | R r2 = communityService.detailActivity(activityId, userId, null, null); |
| | | ComActActivityVO comActActivityVO = |
| | | JSONObject.parseObject(JSONObject.toJSONString(r2.getData()), ComActActivityVO.class); |
| | | Integer isVolunteer = JSONObject.parseObject(JSONObject.toJSONString(r.getData()), Integer.class); |
| | | SysUserNoticeVO sysUserNoticeVO = new SysUserNoticeVO(); |
| | | sysUserNoticeVO.setUserId(userId); |
| | | sysUserNoticeVO.setType(1); |
| | | sysUserNoticeVO.setTitle("报名成功"); |
| | | sysUserNoticeVO.setBusinessType(1); |
| | | sysUserNoticeVO.setBusinessTitle(comActActivityVO.getActivityName()); |
| | | Date beginAt = comActActivityVO.getBeginAt(); |
| | | sysUserNoticeVO.setBusinessContent(String.format("活动将于%tF %tT 开始,请按时参加", beginAt, beginAt)); |
| | | sysUserNoticeVO.setBusinessId(activityId); |
| | | sysUserNoticeVO.setStatus(0); |
| | | sysUserNoticeVO.setActivityType(comActActivityVO.getType()); |
| | | sysUserNoticeVO.setBusinessStatus(2); |
| | | R r1 = userService.addNotice(sysUserNoticeVO); |
| | | if (R.isOk(r1)) { |
| | | log.info("新增用户报名社区活动通知成功【{}】", JSONObject.toJSONString(sysUserNoticeVO)); |
| | | } |
| | | } |
| | | return r; |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "获取个人金汇币总币", response = JinhuiCoinGeneralTableVO.class) |
| | | @GetMapping("goldCoin/getDetails") |
| | | public R coinTableGetDetails() { |
| | | return jinhuiCommunityService.coinTableGetDetails(this.getUserId() + ""); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "获取个人金汇币明细", response = JinhuiGoldCoinRecordVO.class) |
| | | @GetMapping("/record/getList") |
| | | public R recordGetList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize) { |
| | | return jinhuiCommunityService.recordGetList(pageNum, pageSize, this.getUserId() + ""); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取个人金汇币明细详情", response = JinhuiGoldCoinRecordVO.class) |
| | | @GetMapping("/jinhuiRecord/getDetails") |
| | | public R recordGetDetails(@RequestParam("id") String id) { |
| | | return jinhuiCommunityService.recordGetDetails(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除金汇币记录") |
| | | @PostMapping("/record/expurgateData") |
| | | public R recordExpurgateData(@RequestParam("id") String id) { |
| | | return jinhuiCommunityService.recordExpurgateData(id); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 办事指南_详情 |
| | | * |
| | | * @param workGuideId |
| | | * @return 详情 |
| | | */ |
| | | @ApiOperation(value = "办事指南_详情", response = ComActWorkGuideVO.class) |
| | | @GetMapping("/detailworkguide") |
| | | public R detailWorkGuide(@RequestParam("workGuideId") String workGuideId) { |
| | | return jinhuiCommunityService.detailWorkGuide(workGuideId, getCommunityId() + ""); |
| | | } |
| | | |
| | | /** |
| | | * 办事指南_分页 |
| | | * |
| | | * @param pageActWorkGuideDTO 查询参数 |
| | | * @return 分页集合 |
| | | */ |
| | | @ApiOperation(value = "办事指南_分页", response = ComActWorkGuideVO.class) |
| | | @PostMapping("/pageworkguide") |
| | | public R pageWorkGuide(@RequestBody PageActWorkGuideDTO pageActWorkGuideDTO) { |
| | | return jinhuiCommunityService.pageWorkGuide(pageActWorkGuideDTO); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除便民服务商家 |
| | | * |
| | | * @param merchantId |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "删除便民服务商家") |
| | | @DeleteMapping("/merchant/delete") |
| | | public R deleteMerchant(@RequestParam("merchantId") String merchantId) { |
| | | return jinhuiCommunityService.deleteMerchant(merchantId); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询便民服务商家 运营后台 |
| | | * |
| | | * @param pageConvenientMerchantDTO |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "分页查询便民服务商家", response = ConvenientMerchantVO.class) |
| | | @PostMapping("/merchant/page") |
| | | public R pageMerchant(@RequestBody JinhuiPageConvenientMerchantDTO pageConvenientMerchantDTO) |
| | | { |
| | | pageConvenientMerchantDTO.setAuditType("2"); |
| | | return jinhuiCommunityService.pageMerchant(pageConvenientMerchantDTO); |
| | | } |
| | | |
| | | /** |
| | | * 获取便民服务商家详情 |
| | | * |
| | | * @param merchantId |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取便民服务商家详情", response = ConvenientMerchantVO.class) |
| | | @GetMapping("/merchant/get") |
| | | public R getMerchant(@RequestParam("merchantId") String merchantId) { |
| | | return jinhuiCommunityService.getMerchant(merchantId); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 分页查询 商家类别 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取便民服务商家类别列表", response = ConvenientServiceCategoryVO.class) |
| | | @GetMapping("/getCategories") |
| | | public R getListCategories(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize) { |
| | | return jinhuiCommunityService.getListCategories(pageNum, pageSize); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "便民服务商家入驻") |
| | | @PostMapping("/merchant/addData") |
| | | public R merchantAddData(@RequestBody JinhuiConvenientMerchantVO item) |
| | | { |
| | | item.setAuditType("1"); |
| | | item.setCreatedBy(getUserId()+""); |
| | | return jinhuiCommunityService.merchantAddData(item); |
| | | } |
| | | |
| | | /*************************************************************************************************** |
| | | * |
| | | * |
| | | * 商家评论 |
| | | * |
| | | * |
| | | **************************************************************************************************/ |
| | | /** |
| | | * 商家评论列表 |
| | | * |
| | | * @param pageNum |
| | | * @param pageSize |
| | | * @param merchantId |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "商家评论列表", response = JinghuiMerchantEvaluateVO.class) |
| | | @GetMapping("/merchantEvaluate/getList") |
| | | public R merchantEvaluateGetList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize, |
| | | @RequestParam("merchantId") String merchantId) { |
| | | return jinhuiCommunityService.merchantEvaluateGetList(pageNum, pageSize, merchantId); |
| | | } |
| | | |
| | | /** |
| | | * 商家评论列单个详情 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "商家评论列单个详情", response = JinghuiMerchantEvaluateVO.class) |
| | | @GetMapping("/merchantEvaluate/getDetails") |
| | | public R merchantEvaluateGetDetails(@RequestParam("id") String id) { |
| | | return jinhuiCommunityService.merchantEvaluateGetDetails(id); |
| | | } |
| | | |
| | | /** |
| | | * 商家评论列添加 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "商家评论列添加") |
| | | @PostMapping("/merchantEvaluate/addData") |
| | | public R merchantEvaluateAddData(@RequestBody JinghuiMerchantEvaluateVO item) { |
| | | item.setUserId(getUserId()+""); |
| | | return jinhuiCommunityService.merchantEvaluateAddData(item); |
| | | } |
| | | |
| | | /** |
| | | * 商家评论列编辑 |
| | | * |
| | | * @param item |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "商家评论列编辑") |
| | | @PostMapping("/merchantEvaluate/editData") |
| | | public R merchantEvaluateEditData(@RequestBody JinghuiMerchantEvaluateVO item) { |
| | | return jinhuiCommunityService.merchantEvaluateEditData(item); |
| | | } |
| | | |
| | | /** |
| | | * 商家评论列删除 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "商家评论列删除") |
| | | @PostMapping("/merchantEvaluate/expurgateData") |
| | | public R merchantEvaluateExpurgateData(@RequestParam("id") String id) { |
| | | return jinhuiCommunityService.merchantEvaluateExpurgateData(id); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "办事指南列表-按分类查询", response = ComActWorkGuideAppletsVO.class) |
| | | @PostMapping("wx/list") |
| | | public R listWorkGuide(@RequestBody PageActWorkGuideDTO pageActWorkGuideDTO) { |
| | | return jinhuiCommunityService.listWorkGuide(pageActWorkGuideDTO); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "办事指南_分页", response = ComActWorkGuideVO.class) |
| | | @PostMapping("wx/pageworkguide") |
| | | public R detailWorkGuide(@RequestBody PageActWorkGuideDTO pageActWorkGuideDTO) { |
| | | return jinhuiCommunityService.pageWorkGuide(pageActWorkGuideDTO); |
| | | } |
| | | |
| | | |
| | | /************************************************************************************************ |
| | | * |
| | | * |
| | | * 金汇预约空间模块 |
| | | * |
| | | * |
| | | **********************************************************************************************/ |
| | | /** |
| | | * 金汇空间预约模块分页查询 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "金汇空间预约模块分页查询", response = JinhuiInterspaceVO.class) |
| | | @GetMapping("/interspaceGetList") |
| | | public R interspaceGetList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize, |
| | | @RequestParam(value = "intendantType", required = false) String intendantType) { |
| | | return jinhuiCommunityService.interspaceGetList(pageNum, pageSize, intendantType); |
| | | } |
| | | |
| | | /** |
| | | * 金汇空间预约模块单个详情 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "金汇空间详情", response = JinhuiInterspaceVO.class) |
| | | @GetMapping("/interspaceGetDetails") |
| | | public R interspaceGetDetails(@RequestParam("id") String id) { |
| | | return jinhuiCommunityService.interspaceGetDetails(id); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 空间预约分类分页查询 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "空间预约分类分页查询", response = JinhuiInterspaceTypeVO.class) |
| | | @GetMapping("/interspaceTypeGetList") |
| | | public R interspaceTypeGetList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize) |
| | | { |
| | | return jinhuiCommunityService.interspaceTypeGetList(pageNum,pageSize); |
| | | } |
| | | |
| | | |
| | | /*************************************************************************************************************** |
| | | * |
| | | * |
| | | * 空间预约申请 |
| | | * |
| | | * |
| | | **************************************************************************************************************/ |
| | | /** |
| | | * 空间预约申请分页查询 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "空间预约申请分页", response = JinhuiInterspaceApplyForVO.class) |
| | | @GetMapping("/applyFor/getList") |
| | | public R applyForGetList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize, |
| | | @RequestParam(value = "intendantType", required = false) String intendantType, |
| | | @RequestParam(value = "state", required = false) String state, |
| | | @RequestParam(value = "interspaceTime",required = false) String interspaceTime, |
| | | @RequestParam(value = "subscribeTimeFrame",required = false) String subscribeTimeFrame, |
| | | @RequestParam(value = "interspaceId",required = false) String interspaceId) { |
| | | return jinhuiCommunityService.applyForGetList(pageNum, pageSize, intendantType, |
| | | state,interspaceTime,subscribeTimeFrame,interspaceId); |
| | | } |
| | | |
| | | /** |
| | | * 空间预约申请详情 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "空间预约申请详情", response = JinhuiInterspaceApplyForVO.class) |
| | | @GetMapping("/applyFor/getDetails") |
| | | public R applyForGetDetails(@RequestParam("id") String id) |
| | | { |
| | | return jinhuiCommunityService.applyForGetDetails(id); |
| | | } |
| | | |
| | | /** |
| | | * 空间预约申请新增 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "空间预约申请新增") |
| | | @PostMapping("/applyFor/addData") |
| | | public R applyForAddData(@RequestBody JinhuiInterspaceApplyForVO item) |
| | | { |
| | | return jinhuiCommunityService.applyForAddData(item); |
| | | } |
| | | |
| | | /** |
| | | * 空间预约申请编辑 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "空间预约申请编辑") |
| | | @PostMapping("/applyFor/editData") |
| | | public R applyForEditData(@RequestBody JinhuiInterspaceApplyForVO item) |
| | | { |
| | | return jinhuiCommunityService.applyForEditData(item); |
| | | } |
| | | |
| | | /** |
| | | * 空间预约申请删除 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "空间预约申请删除") |
| | | @DeleteMapping("/applyFor/expurgateData") |
| | | public R applyForExpurgateData(@RequestParam("id") String id) |
| | | { |
| | | return jinhuiCommunityService.applyForExpurgateData(id); |
| | | } |
| | | |
| | | |
| | | /****************************************************************************************************************** |
| | | * |
| | | * |
| | | * 金汇微心愿 |
| | | * |
| | | * |
| | | ******************************************************************************************************************/ |
| | | /** |
| | | * 分页查询 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "金汇微心愿列表", response = JinhuiMicroVolunteeringVO.class) |
| | | @GetMapping("/volunteering/getList") |
| | | public R volunteeringGetList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize, |
| | | @RequestParam(value = "state", required = false)String state) |
| | | { |
| | | return jinhuiCommunityService.volunteeringGetList(pageNum,pageSize,getUserId()+"",state); |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "金汇微心愿详情", response = JinhuiMicroVolunteeringVO.class) |
| | | @GetMapping("/volunteering/getDetails") |
| | | public R volunteeringGetDetails(@RequestParam("id") String id) |
| | | { |
| | | return jinhuiCommunityService.volunteeringGetDetails(id); |
| | | } |
| | | /** |
| | | * 新增 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "金汇微心愿新增") |
| | | @PostMapping("/volunteering/addData") |
| | | public R volunteeringAddData(@RequestBody JinhuiMicroVolunteeringVO item) |
| | | { |
| | | item.setUserId(getUserId()+""); |
| | | return jinhuiCommunityService.volunteeringAddData(item); |
| | | } |
| | | |
| | | /** |
| | | * 编辑 |
| | | * @param item |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "金汇微心愿编辑") |
| | | @PostMapping("/volunteering/editData") |
| | | public R volunteeringEditData(@RequestBody JinhuiMicroVolunteeringVO item) |
| | | { |
| | | return jinhuiCommunityService.volunteeringEditData(item); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "金汇微心愿删除") |
| | | @DeleteMapping("/volunteering/expurgateData") |
| | | public R volunteeringExpurgateData(@RequestParam("id") String id) |
| | | { |
| | | return jinhuiCommunityService.volunteeringExpurgateData(id); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "金汇微心愿分类列表", response = JinhuiMicroVolunteeringTypeVO.class) |
| | | @GetMapping("/micro/type/getList") |
| | | public R volunteeringTypeGetList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize) { |
| | | return jinhuiCommunityService.volunteeringTypeGetList(pageNum, pageSize); |
| | | } |
| | | |
| | | /********************************************************************************************************* |
| | | * |
| | | * |
| | | * 金汇商城商品 |
| | | * |
| | | * |
| | | *********************************************************************************************************/ |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "金汇商城商品列表表", response = JinhuiShoppingVO.class) |
| | | @GetMapping("/shoppingGetList") |
| | | public R shoppingGetList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize, |
| | | @RequestParam(value = "goodName", required = false) String goodName, |
| | | @RequestParam(value = "id", required = false) String id) |
| | | { |
| | | return jinhuiCommunityService.shoppingGetList(pageNum,pageSize,goodName,"1",id); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "金汇商城商品详情", response = JinhuiShoppingVO.class) |
| | | @GetMapping("/shoppingGetDetails") |
| | | public R shoppingGetDetails(@RequestParam("id") String id) |
| | | { |
| | | return jinhuiCommunityService.shoppingGetDetails(id); |
| | | } |
| | | |
| | | |
| | | |
| | | /******************************************************************************************************** |
| | | * |
| | | * |
| | | * 金汇商城商品订单 |
| | | * |
| | | * |
| | | ********************************************************************************************************/ |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "订单列表", response = JinhuiShoppingOrderVO.class) |
| | | @GetMapping("/orderGetList") |
| | | public R orderGetList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize, |
| | | @RequestParam(value = "goodsId", required = false)String goodsId, |
| | | @RequestParam(value = "orderNumber", required = false)String orderNumber, |
| | | @RequestParam(value = "goodName", required = false)String goodName, |
| | | @RequestParam(value = "name", required = false)String name, |
| | | @RequestParam(value = "cancelType", required = false)String cancelType) |
| | | { |
| | | return jinhuiCommunityService.orderGetList(pageNum,pageSize,getUserId()+"", |
| | | goodsId,orderNumber,goodName,name,cancelType); |
| | | } |
| | | |
| | | /** |
| | | * 分页详情 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "订单详情", response = JinhuiShoppingOrderVO.class) |
| | | @GetMapping("/orderGetDetails") |
| | | public R orderGetDetails(@RequestParam("id") String id) |
| | | { |
| | | return jinhuiCommunityService.orderGetDetails(id); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "订单新增") |
| | | @PostMapping("/orderAddData") |
| | | public R orderAddData(@RequestBody JinhuiShoppingOrderVO item) |
| | | { |
| | | return jinhuiCommunityService.orderAddData(item); |
| | | } |
| | | |
| | | /** |
| | | * 取消 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "订单取消") |
| | | @GetMapping("/orderCancelOrder") |
| | | public R orderCancelOrder(@RequestParam("orderId") String orderId) |
| | | { |
| | | return jinhuiCommunityService.orderCancelOrder(orderId); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "订单删除") |
| | | @DeleteMapping("/orderExpurgateData") |
| | | public R orderExpurgateData(@RequestParam("id") String id) |
| | | { |
| | | return jinhuiCommunityService.orderExpurgateData(id); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "订单核销") |
| | | @GetMapping("/orderCheck") |
| | | public R orderEditData(@RequestParam("id") String id) |
| | | { |
| | | |
| | | if(StringUtils.isEmpty(id)) |
| | | { |
| | | return R.fail("订单id不能为空"); |
| | | } |
| | | |
| | | JinhuiShoppingOrderVO vo=new JinhuiShoppingOrderVO(); |
| | | vo.setId(id); |
| | | vo.setCancelType("1"); |
| | | vo.setCancelTime(new Date()); |
| | | return jinhuiCommunityService.orderEditData(vo); |
| | | } |
| | | |
| | | |
| | | /****************************************************************************************************** |
| | | * |
| | | * 金汇文章 |
| | | * |
| | | *******************************************************************************************************/ |
| | | /** |
| | | * 分页查询 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "金汇文章列表", response = JinhuiArticleManagementVO.class) |
| | | @GetMapping("/articleGetList") |
| | | public R articleGetList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize) |
| | | { |
| | | return jinhuiCommunityService.articleGetList(pageNum,pageSize,"1","1"); |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "金汇文章详情", response = JinhuiArticleManagementVO.class) |
| | | @GetMapping("/articleGetDetails") |
| | | public R articleGetDetails(@RequestParam("id") String id) |
| | | { |
| | | return jinhuiCommunityService.articleGetDetails(id); |
| | | } |
| | | |
| | | |
| | | |
| | | /************************************************************************************************************* |
| | | * |
| | | * 金汇体验活动 |
| | | * |
| | | ***************************************************************************************************************/ |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "体验活动列表", response = JinhuiExperienceActivityVO.class) |
| | | @GetMapping("/experienceGetList") |
| | | public R experienceGetList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize, |
| | | @RequestParam(value = "activityName", required = false) String activityName, |
| | | @RequestParam(value = "activityType", required = false) String activityType, |
| | | @RequestParam(value = "starTime", required = false) Date starTime, |
| | | @RequestParam(value = "endTime", required = false) Date endTime) |
| | | { |
| | | return jinhuiCommunityService.experienceGetList(pageNum,pageSize,activityName,activityType,starTime,endTime); |
| | | } |
| | | |
| | | /** |
| | | * 单个详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "体验活动单个详情", response = JinhuiExperienceActivityVO.class) |
| | | @GetMapping("/experienceGetDetails") |
| | | public R experienceGetDetails(@RequestParam("id") String id) |
| | | { |
| | | return jinhuiCommunityService.experienceGetDetails(id,getUserId()+""); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /******************************************************************************************************* |
| | | * |
| | | * 金汇报名体验 |
| | | * |
| | | *******************************************************************************************************/ |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "金汇报名体验列表", response = JinhuiApplyExperienceVO.class) |
| | | @GetMapping("/applyExperienceGetList") |
| | | public R applyExperienceGetList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize, |
| | | @RequestParam(value = "isFeedback", required = false) String isFeedback, |
| | | @RequestParam(value = "activityId", required = false) String activityId) |
| | | { |
| | | return jinhuiCommunityService.applyExperienceGetList(pageNum,pageSize,getUserId()+"",isFeedback,activityId); |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "金汇报名体验详情", response = JinhuiApplyExperienceVO.class) |
| | | @GetMapping("/applyExperienceGetDetails") |
| | | public R applyExperienceGetDetails(@RequestParam("id") String id) |
| | | { |
| | | return jinhuiCommunityService.applyExperienceGetDetails(id,null,null); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "金汇报名体验新增") |
| | | @PostMapping("/applyExperienceAddData") |
| | | public R applyExperienceAddData(@RequestBody JinhuiApplyExperienceVO item) |
| | | { |
| | | item.setUserId(getUserId()+""); |
| | | return jinhuiCommunityService.applyExperienceAddData(item); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 填写反馈接口 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "金汇报名体验填写反馈接口") |
| | | @GetMapping("/applyExperienceFilIn") |
| | | public R filIn(@RequestParam("activityId") String activityId, |
| | | @RequestParam("content") String content) |
| | | { |
| | | return jinhuiCommunityService.filIn(getUserId()+"",activityId,content); |
| | | } |
| | | |
| | | |
| | | /****************************************************************************************************** |
| | | * |
| | | * 金汇家园 |
| | | * |
| | | *******************************************************************************************************/ |
| | | /** |
| | | * 分页查询 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "金汇家园列表", response = JinhuiArticleManagementVO.class) |
| | | @GetMapping("/homeGetList") |
| | | public R homeGetList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize) |
| | | { |
| | | return jinhuiCommunityService.articleGetList(pageNum,pageSize,null,"2"); |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "金汇家园详情", response = JinhuiArticleManagementVO.class) |
| | | @GetMapping("/homeGetDetails") |
| | | public R homeGetDetails(@RequestParam("id") String id) |
| | | { |
| | | return jinhuiCommunityService.articleGetDetails(id); |
| | | } |
| | | |
| | | |
| | | /************************************************************************************************************ |
| | | * |
| | | * |
| | | * 用户提交办理 /JinhuiWorkGuide/ |
| | | * |
| | | * |
| | | *******************************************************************************************************/ |
| | | /** |
| | | * 分页查询 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "我的提交办事指南列表",response = JinhuiQuestnaireUserAnswerVO.class) |
| | | @GetMapping("/answer/getList") |
| | | public R answerGetList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize, |
| | | @RequestParam(value = "transactType", required = false) String transactType) |
| | | { |
| | | return jinhuiCommunityService.answerGetList(pageNum,pageSize,getUserId()+"",transactType); |
| | | } |
| | | |
| | | /** |
| | | * 获取详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "我的提交办事指南详情",response = JinhuiQuestnaireUserAnswerVO.class) |
| | | @GetMapping("/answer/getDetails") |
| | | public R answerGetDetails(@RequestParam("id") String id) |
| | | { |
| | | return jinhuiCommunityService.answerGetDetails(id); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "我的提交办事指南申请办理") |
| | | @PostMapping("/answer/addData") |
| | | public R answerAddData(@RequestBody JinhuiQuestnaireUserAnswerVO item) |
| | | { |
| | | item.setUserId(getUserId()+""); |
| | | item.setTransactType("0"); |
| | | return jinhuiCommunityService.answerAddData(item); |
| | | } |
| | | |
| | | /** |
| | | * 编辑 |
| | | * @param item |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "我的提交办事指南申请编辑") |
| | | @PostMapping("/answer/editData") |
| | | public R answerEditData(@RequestBody JinhuiQuestnaireUserAnswerVO item) |
| | | { |
| | | return jinhuiCommunityService.answerEditData(item); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "我的提交办事指南申请删除") |
| | | @DeleteMapping("/answer/expurgateData") |
| | | public R answerExpurgateData(@RequestParam("id") String id) |
| | | { |
| | | return jinhuiCommunityService.answerExpurgateData(id); |
| | | } |
| | | |
| | | |
| | | /**************************************************************************************************************** |
| | | * |
| | | * |
| | | * 金汇慈善公益 |
| | | * |
| | | * |
| | | ******************************************************************************************************************/ |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | |
| | | @ApiOperation(value = "金汇慈善公益列表",response = JinhuiCharityVO.class) |
| | | @GetMapping("/getCharityList") |
| | | public R getCharityList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize, |
| | | @RequestParam(value = "title", required = false) String title, |
| | | @RequestParam(value = "label", required = false) String label, |
| | | @RequestParam(value = "state", required = false) String state) |
| | | { |
| | | return jinhuiCommunityService.getCharityList(pageNum,pageSize,title,label,state); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "金汇慈善公益详情",response = JinhuiCharityVO.class) |
| | | @GetMapping("/getCharityDetails") |
| | | public R getCharityDetails(@RequestParam("id") String id) |
| | | { |
| | | return jinhuiCommunityService.getCharityDetails(id); |
| | | } |
| | | |
| | | |
| | | /****************************************************************************************************************** |
| | | * |
| | | * 手环处理 |
| | | * |
| | | *****************************************************************************************************************/ |
| | | |
| | | @Resource |
| | | private CommunityBraceletService communityBraceletService; |
| | | /** |
| | | * 微信处理接口 |
| | | * @param braceletEarlyWarningDO |
| | | * @return |
| | | */ |
| | | @PostMapping("/WXdispose") |
| | | public R WXdispose(@RequestBody BraceletEarlyWarningDO braceletEarlyWarningDO) |
| | | { |
| | | if(com.panzhihua.common.utlis.StringUtils.isEmpty(braceletEarlyWarningDO.getDisposeText())) |
| | | { |
| | | return R.fail("处理内容不能为空"); |
| | | } |
| | | braceletEarlyWarningDO.setDisposeType("2"); |
| | | return communityBraceletService.WXdispose(braceletEarlyWarningDO); |
| | | } |
| | | |
| | | /** |
| | | * 微信我的预警数据 |
| | | * @return |
| | | */ |
| | | @GetMapping("/braceletApi/getEarlyWarningList") |
| | | public R getList(@RequestParam("pageNum") Integer pageNum, |
| | | @RequestParam("pageSize") Integer pageSize, |
| | | @RequestParam(value = "equipmentNumber",required = false) String equipmentNumber, |
| | | @RequestParam(value = "type",required = false) String type, |
| | | @RequestParam(value = "userName",required = false) String userName, |
| | | @RequestParam(value = "phone",required = false) String phone) |
| | | { |
| | | return communityBraceletService.getList(pageNum,pageSize,getCommunityId()+"",equipmentNumber, |
| | | getUserId()+"",type,userName,phone); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.constants.Constants; |
| | | import com.panzhihua.common.utlis.RSAUtils; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | 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.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.applets.config.WxMaConfiguration; |
| | | import com.panzhihua.applets.model.vos.LoginRequest; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.exceptions.UnAuthenticationException; |
| | | import com.panzhihua.common.model.vos.LoginReturnVO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngStructAreaVO; |
| | | import com.panzhihua.common.model.vos.user.SysUserAgreementVO; |
| | | import com.panzhihua.common.model.vos.user.UuLoginVO; |
| | | import com.panzhihua.common.service.auth.TokenService; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.validated.PutGroup; |
| | | |
| | | import cn.binarywang.wx.miniapp.api.WxMaQrcodeService; |
| | | import cn.binarywang.wx.miniapp.api.WxMaService; |
| | | import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult; |
| | | import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo; |
| | | import cn.binarywang.wx.miniapp.bean.WxMaUserInfo; |
| | | import cn.hutool.core.codec.Base64; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import me.chanjar.weixin.common.error.WxErrorException; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: 登录 |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-11-19 16:35 |
| | | **/ |
| | | @Slf4j |
| | | @Api(tags = {"登录模块"}) |
| | | @RestController("/") |
| | | public class LoginApi extends BaseController { |
| | | @Resource |
| | | private UserService userService; |
| | | @Resource |
| | | private WxMaConfiguration wxMaConfiguration; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @ApiOperation(value = "登录", response = LoginReturnVO.class) |
| | | @PostMapping("login") |
| | | public R login(@RequestBody LoginRequest loginRequest) { |
| | | String code = loginRequest.getCode(); |
| | | if (ObjectUtils.isEmpty(code)) { |
| | | return R.fail("缺少登录参数"); |
| | | } |
| | | log.info(code); |
| | | WxMaService maService = wxMaConfiguration.getMaService(loginRequest.getAppid()); |
| | | WxMaJscode2SessionResult sessionInfo = null; |
| | | try { |
| | | sessionInfo = maService.getUserService().getSessionInfo(code); |
| | | } catch (Exception e) { |
| | | log.error("微信登录失败【{}】", e.getMessage()); |
| | | if (code.equals("22")) { |
| | | sessionInfo = new WxMaJscode2SessionResult(); |
| | | sessionInfo.setOpenid("88888888"); |
| | | sessionInfo.setSessionKey("9999999"); |
| | | } else { |
| | | return R.fail("微信登录失败"); |
| | | } |
| | | } |
| | | log.info("微信登录成功【{}】", JSONObject.toJSONString(sessionInfo)); |
| | | log.info("loginRequest参数【{}】", JSONObject.toJSONString(loginRequest)); |
| | | String openid = sessionInfo.getOpenid(); |
| | | String sessionKey = sessionInfo.getSessionKey(); |
| | | String unionid = sessionInfo.getUnionid(); |
| | | if (ObjectUtils.isEmpty(unionid)) { |
| | | unionid = "无"; |
| | | } |
| | | userService.addOrUpdate(openid, sessionKey, unionid,this.getAppId()); |
| | | return tokenService.loginApplets(openid,this.getAppId()); |
| | | } |
| | | @PostMapping("/loginTest") |
| | | public R loginTest(@RequestBody LoginRequest loginRequest){ |
| | | return tokenService.loginApplets(loginRequest.getCode(),this.getAppId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "H5登录", response = LoginReturnVO.class) |
| | | @PostMapping("loginH5") |
| | | public R loginH5(@RequestBody LoginRequest loginRequest) { |
| | | String code = loginRequest.getCode(); |
| | | if (ObjectUtils.isEmpty(code)) { |
| | | return R.fail("缺少登录参数"); |
| | | } |
| | | log.info(code); |
| | | WxMaService maService = wxMaConfiguration.getMaH5Service(); |
| | | WxMaJscode2SessionResult sessionInfo = null; |
| | | try { |
| | | sessionInfo = maService.getUserService().getSessionInfo(code); |
| | | } catch (Exception e) { |
| | | log.error("微信登录失败【{}】", e.getMessage()); |
| | | if (code.equals("22")) { |
| | | sessionInfo = new WxMaJscode2SessionResult(); |
| | | sessionInfo.setOpenid("88888888"); |
| | | sessionInfo.setSessionKey("9999999"); |
| | | } else { |
| | | return R.fail("微信登录失败"); |
| | | } |
| | | } |
| | | log.info("微信登录成功【{}】", JSONObject.toJSONString(sessionInfo)); |
| | | log.info("loginRequest参数【{}】", JSONObject.toJSONString(loginRequest)); |
| | | // 解密用户信息 |
| | | // WxMaUserInfo wxUserInfo = maService.getUserService().getUserInfo(sessionInfo.getSessionKey(), |
| | | // loginRequest.getEncryptedData(), loginRequest.getIv()); |
| | | // log.info("wxUserInfo信息【{}】", JSONObject.toJSONString(wxUserInfo)); |
| | | // if (null == wxUserInfo) { |
| | | // return R.fail("获取用户信息失败"); |
| | | // } |
| | | // String unionId = wxUserInfo.getUnionId(); |
| | | String unionId = sessionInfo.getUnionid(); |
| | | //通过unionId去匹配user |
| | | R r1 = userService.getUserInfoByUnionId(unionId); |
| | | if (R.isOk(r1)) { |
| | | LoginUserInfoVO loginUserInfoVO = JSONObject.parseObject(JSONObject.toJSONString(r1.getData()), LoginUserInfoVO.class); |
| | | return tokenService.loginApplets(loginUserInfoVO.getOpenid(),this.getAppId()); |
| | | } |
| | | return r1; |
| | | } |
| | | |
| | | @ApiOperation(value = "仁和区登录", response = LoginReturnVO.class) |
| | | @PostMapping("/renHe/login") |
| | | public R renHeLogin(@RequestBody LoginRequest loginRequest) { |
| | | String code = loginRequest.getCode(); |
| | | if (ObjectUtils.isEmpty(code)) { |
| | | return R.fail("缺少登录参数"); |
| | | } |
| | | log.info(code); |
| | | WxMaService maService = wxMaConfiguration.getMaRhService(); |
| | | WxMaJscode2SessionResult sessionInfo = null; |
| | | try { |
| | | sessionInfo = maService.getUserService().getSessionInfo(code); |
| | | } catch (Exception e) { |
| | | log.error("微信登录失败【{}】", e.getMessage()); |
| | | if (code.equals("22")) { |
| | | sessionInfo = new WxMaJscode2SessionResult(); |
| | | sessionInfo.setOpenid("88888888"); |
| | | sessionInfo.setSessionKey("9999999"); |
| | | } else { |
| | | return R.fail("微信登录失败"); |
| | | } |
| | | } |
| | | log.info("微信登录成功【{}】", JSONObject.toJSONString(sessionInfo)); |
| | | log.info("loginRequest参数【{}】", JSONObject.toJSONString(loginRequest)); |
| | | String openid = sessionInfo.getOpenid(); |
| | | String sessionKey = sessionInfo.getSessionKey(); |
| | | String unionid = sessionInfo.getUnionid(); |
| | | if (ObjectUtils.isEmpty(unionid)) { |
| | | unionid = "无"; |
| | | } |
| | | userService.addOrUpdate(openid, sessionKey, unionid,this.getAppId()); |
| | | return tokenService.loginApplets(openid,this.getAppId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "维护用户基本信息(昵称、性别、头像)") |
| | | @PostMapping("updateUserWeiXinInfo") |
| | | public R updateUserWeiXinInfo(@RequestBody LoginRequest loginRequest) { |
| | | Long userId = this.getUserId(); |
| | | if (userId == null) { |
| | | return R.fail(401, "请先登录"); |
| | | } |
| | | boolean empty2 = ObjectUtils.isEmpty(userId); |
| | | if (empty2) { |
| | | throw new UnAuthenticationException(); |
| | | } |
| | | WxMaUserInfo wxUserInfo = loginRequest.getUserInfo(); |
| | | if (null == wxUserInfo) { |
| | | return R.fail("缺少基本信息参数"); |
| | | } |
| | | String avatarUrl = wxUserInfo.getAvatarUrl(); |
| | | String gender = wxUserInfo.getGender(); |
| | | String nickName = wxUserInfo.getNickName(); |
| | | return userService.updateUserWeiXinInfo(userId, nickName, Integer.parseInt(gender), avatarUrl); |
| | | } |
| | | |
| | | @ApiOperation(value = "维护微信用户手机号") |
| | | @PostMapping("updateUserWeiXinPhone") |
| | | public R updateUserWeiXinPhone(@RequestBody LoginRequest loginRequest) { |
| | | String encryptedData = loginRequest.getEncryptedData(); |
| | | String iv = loginRequest.getIv(); |
| | | boolean empty = ObjectUtils.isEmpty(iv); |
| | | boolean empty1 = ObjectUtils.isEmpty(encryptedData); |
| | | if (empty || empty1) { |
| | | return R.fail("微信用户参数不全"); |
| | | } |
| | | WxMaService maService = wxMaConfiguration.getMaService(this.getAppId()); |
| | | Long userId = this.getUserId(); |
| | | R<LoginUserInfoVO> r = userService.getUserInfoByUserId(userId + ""); |
| | | LoginUserInfoVO loginUserInfoVO = r.getData(); |
| | | WxMaPhoneNumberInfo wxMaPhoneNumberInfo = |
| | | maService.getUserService().getPhoneNoInfo(loginUserInfoVO.getSessionKey(), encryptedData, iv); |
| | | if (ObjectUtils.isEmpty(wxMaPhoneNumberInfo) || ObjectUtils.isEmpty(wxMaPhoneNumberInfo.getPhoneNumber())) { |
| | | return R.fail("微信解析手机号失败"); |
| | | } |
| | | String purePhoneNumber = wxMaPhoneNumberInfo.getPurePhoneNumber(); |
| | | return userService.updateUserWeiXinPhone(userId, purePhoneNumber); |
| | | } |
| | | |
| | | @ApiOperation(value = "维护微信用户手机号") |
| | | @PostMapping("updateUserWeiXinPhone2") |
| | | public R updateUserWeiXinPhone2(@RequestBody LoginRequest loginRequest) { |
| | | String code = loginRequest.getCode(); |
| | | if (ObjectUtils.isEmpty(code)) { |
| | | return R.fail("缺少登录参数"); |
| | | } |
| | | log.info(code); |
| | | WxMaService maService = wxMaConfiguration.getMaService(this.getAppId()); |
| | | WxMaJscode2SessionResult sessionInfo = null; |
| | | try { |
| | | sessionInfo = maService.getUserService().getSessionInfo(code); |
| | | } catch (Exception e) { |
| | | log.error("微信登录失败【{}】", e.getMessage()); |
| | | if (code.equals("22")) { |
| | | sessionInfo = new WxMaJscode2SessionResult(); |
| | | sessionInfo.setOpenid("88888888"); |
| | | sessionInfo.setSessionKey("9999999"); |
| | | } else { |
| | | return R.fail("微信登录失败"); |
| | | } |
| | | } |
| | | log.info("微信登录成功【{}】", JSONObject.toJSONString(sessionInfo)); |
| | | |
| | | String encryptedData = loginRequest.getEncryptedData(); |
| | | String iv = loginRequest.getIv(); |
| | | boolean empty = ObjectUtils.isEmpty(iv); |
| | | boolean empty1 = ObjectUtils.isEmpty(encryptedData); |
| | | if (empty || empty1) { |
| | | return R.fail("微信用户参数不全"); |
| | | } |
| | | // WxMaService maService = wxMaConfiguration.getMaService(); |
| | | Long userId = this.getUserId(); |
| | | // R<LoginUserInfoVO> r = userService.getUserInfoByUserId(userId + ""); |
| | | // LoginUserInfoVO loginUserInfoVO = r.getData(); |
| | | WxMaPhoneNumberInfo wxMaPhoneNumberInfo = |
| | | maService.getUserService().getPhoneNoInfo(sessionInfo.getSessionKey(), encryptedData, iv); |
| | | if (ObjectUtils.isEmpty(wxMaPhoneNumberInfo) || ObjectUtils.isEmpty(wxMaPhoneNumberInfo.getPhoneNumber())) { |
| | | return R.fail("微信解析手机号失败"); |
| | | } |
| | | String purePhoneNumber = wxMaPhoneNumberInfo.getPurePhoneNumber(); |
| | | return userService.updateUserWeiXinPhone(userId, purePhoneNumber); |
| | | } |
| | | |
| | | @ApiOperation(value = "用户登出") |
| | | @PostMapping("logout") |
| | | public R updateUserWeiXinPhone() { |
| | | String token = this.getToken(); |
| | | boolean empty2 = ObjectUtils.isEmpty(token); |
| | | if (empty2) { |
| | | return R.ok(); |
| | | } |
| | | return tokenService.logout(token); |
| | | } |
| | | |
| | | @ApiOperation(value = "刷新token", response = LoginReturnVO.class) |
| | | @GetMapping("refreshToken") |
| | | @ApiImplicitParam(name = "refreshToken", value = "登录返回的刷新token") |
| | | public R refreshToken(@RequestParam("refreshToken") String refreshToken) { |
| | | return tokenService.refreshToken(refreshToken); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询社区") |
| | | @PostMapping("listcommunity") |
| | | public R listCommunity(@RequestBody ComActVO comActVO) { |
| | | return communityService.listCommunity(comActVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询小区", response = ComMngStructAreaVO.class) |
| | | @GetMapping("listarea") |
| | | @ApiImplicitParam(name = "communityId", value = "社区id", required = true) |
| | | public R listArea(@RequestParam("communityId") Long communityId) { |
| | | return communityService.listArea(communityId); |
| | | } |
| | | |
| | | @ApiOperation(value = "用户绑定社区、小区") |
| | | @PutMapping("putusercommunityarea") |
| | | public R putUserCommunityArea(@RequestBody @Validated(PutGroup.class) LoginUserInfoVO loginUserInfoVO) { |
| | | Long userId = this.getUserId(); |
| | | loginUserInfoVO.setUserId(userId); |
| | | return userService.putUserCommunityArea(loginUserInfoVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "用户协议和隐私政策", response = SysUserAgreementVO.class) |
| | | @GetMapping("useragreement") |
| | | public R userAgreement() { |
| | | int type = 1; |
| | | return userService.userAgreement(type,this.getAppId()); |
| | | } |
| | | @ApiOperation("uu洗车登录") |
| | | @PostMapping("uuLogin") |
| | | public R uuLogin(@RequestBody UuLoginVO uuLoginVO){ |
| | | return userService.uuLogin(uuLoginVO); |
| | | } |
| | | |
| | | @ApiOperation("uu洗车获取小程序码") |
| | | @ApiImplicitParam(name = "couponId", value = "优惠券id", required = true) |
| | | @GetMapping("uu/getQRCode") |
| | | public R uuLogin(@RequestParam("couponId") String couponId) { |
| | | try { |
| | | //i小懒 |
| | | WxMaQrcodeService wsCodeService = wxMaConfiguration.getMaService("wx98d62711dfbd8425").getQrcodeService(); |
| | | byte[] bytes = wsCodeService.createWxaCodeUnlimitBytes("couponId=" + couponId, |
| | | "pages/user/getCoupon/getCoupon", true, "release", 30, true, null, false); |
| | | String res = String.format("data:image/png;base64,%s", Base64.encode(bytes)); |
| | | |
| | | //花城 |
| | | WxMaQrcodeService uuCodeService = wxMaConfiguration.getMaService("wx118de8a734d269f0").getQrcodeService(); |
| | | byte[] hcBytes = uuCodeService.createWxaCodeUnlimitBytes("couponId=" + couponId, |
| | | "packageD/pages/user/getCoupon/getCoupon", true, "release", 30, true, null, false); |
| | | String hcRes = String.format("data:image/png;base64,%s", Base64.encode(hcBytes)); |
| | | |
| | | Map<String,String> retMap = new HashMap<>(); |
| | | retMap.put("ixiaolan",res); |
| | | retMap.put("huacheng",hcRes); |
| | | return R.ok(retMap); |
| | | } catch (Exception e) { |
| | | log.error("generate QRCode failed:" + e.getMessage()); |
| | | return R.fail("generate QRCode failed"); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation("天府通办登录") |
| | | @PostMapping("tfLogin") |
| | | public R tfLogin(@RequestBody UuLoginVO uuLoginVO){ |
| | | try { |
| | | log.info("天府通办登录【{}】", JSONObject.toJSONString(uuLoginVO.getMobile())); |
| | | String str=RSAUtils.decrypt(uuLoginVO.getMobile(), Constants.PRIVATE_KEY); |
| | | log.info("天府通办登录【{}】", JSONObject.toJSONString(str)); |
| | | uuLoginVO.setMobile(str); |
| | | //测试是否能正常添加用户 |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return R.fail(); |
| | | } |
| | | userService.tfLogin(uuLoginVO); |
| | | R r=tokenService.tfLogin(uuLoginVO.getMobile(),"Huacheng@123","wx118de8a734d269f0"); |
| | | return r; |
| | | } |
| | | @ApiOperation("用户授权") |
| | | @GetMapping("/accept") |
| | | public R accept(){ |
| | | return userService.accept(this.getUserId()); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.panzhihua.applets.weixin.CheckService; |
| | | import com.panzhihua.common.constants.Constants; |
| | | import com.panzhihua.common.constants.NeighborCircleConstants; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.neighbor.*; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.neighbor.*; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | 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; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-14 15:02:49 |
| | | * @describe 邻里圈模块API |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/neighbor/") |
| | | @Api(tags = {"邻里圈服务"}) |
| | | public class NeighborApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | @Resource |
| | | private CheckService checkService; |
| | | |
| | | @ApiOperation(value = "分页查询邻里圈列表", response = ComActNeighborCircleAppVO.class) |
| | | @PostMapping("pageApp") |
| | | public R pageNeighborByApp(@RequestBody ComActNeighborCircleAppDTO neighborCircleAppDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | neighborCircleAppDTO.setPhone(loginUserInfo.getPhone()); |
| | | neighborCircleAppDTO.setUserId(loginUserInfo.getUserId()); |
| | | } |
| | | return communityService.pageNeighborByApp(neighborCircleAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询可关联清单列表", response = ComActNeighborCircleAppVO.class) |
| | | @PostMapping("pageRelationList") |
| | | public R pageRelationList(@RequestBody ComActNeighborCircleAppDTO neighborCircleAppDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | neighborCircleAppDTO.setPhone(loginUserInfo.getPhone()); |
| | | neighborCircleAppDTO.setUserId(loginUserInfo.getUserId()); |
| | | neighborCircleAppDTO.setCheckUnitId(loginUserInfo.getCheckUnitId()); |
| | | } |
| | | return communityService.pageRelationList(neighborCircleAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "用户发布邻里圈审核") |
| | | @PostMapping("addNeighborByApp") |
| | | public R addNeighborByApp(@RequestBody AddComActNeighborCircleAppDTO addNeighborCircleAppDTO) { |
| | | LoginUserInfoVO loginUser = this.getLoginUserInfo(); |
| | | Long userId = loginUser.getUserId(); |
| | | Long communityId = loginUser.getCommunityId(); |
| | | if (userId == null) { |
| | | return R.fail("请重新登录"); |
| | | } |
| | | if (!this.getAppId().equals("wx118de8a734d269f0")){ |
| | | String releaseContent = addNeighborCircleAppDTO.getReleaseContent(); |
| | | if (StrUtil.isNotBlank(releaseContent)) { |
| | | String result = checkService.checkMessageBy(releaseContent, this.getLoginUserInfo().getOpenid(), this.getAppId()); |
| | | if (StrUtil.isNotBlank(result)) { |
| | | return R.fail(501, "填写内容存在 " + result + " 违规信息"); |
| | | } |
| | | } |
| | | /* String releaseImages = addNeighborCircleAppDTO.getReleaseImages(); |
| | | if (StrUtil.isNotBlank(releaseImages)) { |
| | | if (checkService.checkImageBy(releaseImages, this.getAppId())) { |
| | | return R.fail(501, "上传图片存在违规信息"); |
| | | } |
| | | }*/ |
| | | } |
| | | addNeighborCircleAppDTO.setUserId(userId); |
| | | if (StringUtils.isNotEmpty(loginUser.getPhone())) { |
| | | addNeighborCircleAppDTO.setPhone(this.getLoginUserInfo().getPhone()); |
| | | } |
| | | if (communityId != null) { |
| | | addNeighborCircleAppDTO.setCommunityId(communityId); |
| | | } |
| | | |
| | | //查询社区自动审核是否开着 |
| | | |
| | | if (this.getAppId().equals("wx118de8a734d269f0")) { |
| | | //花城直接通过 |
| | | addNeighborCircleAppDTO.setIsExamine(AddComActNeighborCircleAppDTO.isExamine.no); |
| | | addNeighborCircleAppDTO.setWxExamineResult(AddComActNeighborCircleAppDTO.isExamine.yes); |
| | | |
| | | } else { |
| | | //西区 |
| | | String key = NeighborCircleConstants.NEIGHBOR_CIRCLE_AUTO_EXAMINE; |
| | | R isOk = communityService.getSysConfValue(key + communityId, communityId); |
| | | if (R.isOk(isOk)) { |
| | | if (isOk.getData() != null) { |
| | | String value = isOk.getData().toString(); |
| | | if (value.equals("1")) { |
| | | addNeighborCircleAppDTO.setIsExamine(AddComActNeighborCircleAppDTO.isExamine.no); |
| | | String msg = addNeighborCircleAppDTO.getReleaseContent(); |
| | | if (StrUtil.isEmpty(checkService.checkMessageBy(msg, this.getLoginUserInfo().getOpenid(), this.getAppId()))) { |
| | | addNeighborCircleAppDTO.setWxExamineResult(AddComActNeighborCircleAppDTO.isExamine.yes); |
| | | } else { |
| | | addNeighborCircleAppDTO.setWxExamineResult(AddComActNeighborCircleAppDTO.isExamine.no); |
| | | } |
| | | } else { |
| | | addNeighborCircleAppDTO.setIsExamine(AddComActNeighborCircleAppDTO.isExamine.yes); |
| | | } |
| | | } else { |
| | | communityService.addSysConfValue(key + communityId, communityId, "社区邻里圈自动审核参数", "1"); |
| | | addNeighborCircleAppDTO.setIsExamine(AddComActNeighborCircleAppDTO.isExamine.no); |
| | | } |
| | | } else { |
| | | addNeighborCircleAppDTO.setIsExamine(AddComActNeighborCircleAppDTO.isExamine.yes); |
| | | } |
| | | } |
| | | |
| | | return communityService.addNeighborByApp(addNeighborCircleAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询邻里圈详情", response = ComActNeighborCircleDetailAppVO.class) |
| | | @PostMapping("detail") |
| | | public R neighborDetailByApp(@RequestBody ComActNeighborCircleDetailAppDTO neighborCircleAppDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | neighborCircleAppDTO.setUserId(loginUserInfo.getUserId()); |
| | | } |
| | | // Long userId = this.getLoginUserInfo().getUserId(); |
| | | // if(userId == null){ |
| | | // return R.fail("请先登录"); |
| | | // } |
| | | // neighborCircleAppDTO.setUserId(userId); |
| | | return communityService.neighborDetailByApp(neighborCircleAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询用户邻里圈审核列表", response = ComActNeighborCircleAppVO.class) |
| | | @PostMapping("user/page") |
| | | public R neighborExamineByApp(@RequestBody ComActNeighborCircleAppDTO neighborCircleAppDTO) { |
| | | Long userId = this.getLoginUserInfo().getUserId(); |
| | | if (userId == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | neighborCircleAppDTO.setUserId(userId); |
| | | return communityService.neighborExamineByApp(neighborCircleAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "邻里圈点赞") |
| | | @PostMapping("fabulous") |
| | | public R neighborFabulousByApp(@RequestBody ComActNeighborFabulousAppDTO fabulousAppDTO) { |
| | | Long userId = this.getLoginUserInfo().getUserId(); |
| | | if (userId == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | fabulousAppDTO.setUserId(userId); |
| | | return communityService.neighborFabulousByApp(fabulousAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "邻里圈转发") |
| | | @PostMapping("forward") |
| | | public R neighborForwardByApp(@RequestBody ComActNeighborForwardAppDTO forwardAppDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | forwardAppDTO.setUserId(loginUserInfo.getUserId()); |
| | | } |
| | | // Long userId = this.getLoginUserInfo().getUserId(); |
| | | // if(userId == null){ |
| | | // return R.fail("请先登录"); |
| | | // } |
| | | // forwardAppDTO.setUserId(userId); |
| | | return communityService.neighborForwardByApp(forwardAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "邻里圈评论") |
| | | @PostMapping("comment") |
| | | public R neighborCommentByApp(@RequestBody ComActNeighborCommentAppDTO commentAppDTO) { |
| | | Long userId = this.getLoginUserInfo().getUserId(); |
| | | if (userId == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | String content = commentAppDTO.getContent(); |
| | | if (StrUtil.isNotBlank(content)) { |
| | | String result = checkService.checkMessageBy(content, this.getLoginUserInfo().getOpenid(), this.getAppId()); |
| | | if (StrUtil.isNotBlank(result)) { |
| | | return R.fail(501, "填写内容存在 " + result + " 违规信息"); |
| | | } |
| | | } |
| | | commentAppDTO.setUserId(userId); |
| | | return communityService.neighborCommentByApp(commentAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "邻里圈回复") |
| | | @PostMapping("reply") |
| | | public R neighborReplyByApp(@RequestBody ComActNeighborReplyAppDTO replyAppDTO) { |
| | | Long userId = this.getLoginUserInfo().getUserId(); |
| | | if (userId == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | String content = replyAppDTO.getContent(); |
| | | if (StrUtil.isNotBlank(content)) { |
| | | String result = checkService.checkMessageBy(content, this.getLoginUserInfo().getOpenid(), this.getAppId()); |
| | | if (StrUtil.isNotBlank(result)) { |
| | | return R.fail(501, "填写内容存在 " + result + " 违规信息"); |
| | | } |
| | | } |
| | | replyAppDTO.setUserId(userId); |
| | | return communityService.neighborReplyByApp(replyAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "邻里圈取消点赞") |
| | | @PostMapping("cancel/fabulous") |
| | | public R neighborFabulousCancelByApp(@RequestBody ComActNeighborFabulousAppDTO fabulousAppDTO) { |
| | | Long userId = this.getLoginUserInfo().getUserId(); |
| | | if (userId == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | fabulousAppDTO.setUserId(userId); |
| | | return communityService.neighborFabulousCancelByApp(fabulousAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "邻里圈添加浏览记录") |
| | | @PostMapping("add/browse") |
| | | public R neighborAddBrowseByApp(@RequestBody ComActNeighborAddBrowseAppDTO addBrowseAppDTO) { |
| | | Long userId = this.getLoginUserInfo().getUserId(); |
| | | if (userId == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | addBrowseAppDTO.setUserId(userId); |
| | | return communityService.neighborAddBrowseByApp(addBrowseAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询评论下所有回复", response = ComActNeighborCommentReplyAppVO.class) |
| | | @PostMapping("comment/reply") |
| | | public R neighborCommentReplyByApp(@RequestBody ComActNeighborCommentReplyAppDTO commentReplyAppDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | commentReplyAppDTO.setUserId(loginUserInfo.getUserId()); |
| | | } |
| | | // Long userId = this.getLoginUserInfo().getUserId(); |
| | | // if(userId == null){ |
| | | // return R.fail("请先登录"); |
| | | // } |
| | | // commentReplyAppDTO.setUserId(userId); |
| | | return communityService.neighborCommentReplyByApp(commentReplyAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询社区邻里圈话题列表", response = ComActNeighborCircleTopicAppVO.class) |
| | | @GetMapping("topic/list") |
| | | public R getNeighborTopicByApp( |
| | | @RequestParam(value = "name", defaultValue = "", required = false) String name) { |
| | | return communityService.getNeighborTopicByApp(name); |
| | | } |
| | | |
| | | @ApiOperation(value = "用户删除邻里圈") |
| | | @PostMapping("delete") |
| | | public R deleteNeighborByApp(@RequestBody DeleteNeighborCircleAppDTO circleTopicAppDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo == null) { |
| | | return R.fail(401, "请先登录"); |
| | | } |
| | | circleTopicAppDTO.setUserId(loginUserInfo.getUserId()); |
| | | circleTopicAppDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | return communityService.deleteNeighborByApp(circleTopicAppDTO); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询邻里圈列表 |
| | | * |
| | | * @param neighborCircleAppDTO 请求参数 |
| | | * @return 邻里圈列表 |
| | | */ |
| | | @ApiOperation(value = "新版接单问题", response = ComActNeighborCircleAppVO.class) |
| | | @PostMapping("selectSolve") |
| | | public R selectSolve(@RequestBody ComActNeighborCircleAppDTO neighborCircleAppDTO) { |
| | | neighborCircleAppDTO.setUserId(this.getUserId()); |
| | | return communityService.selectSolve(neighborCircleAppDTO); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param editNeighborCircleAdminVO |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "接单 反馈", response = ComActNeighborCircleAppVO.class) |
| | | @PostMapping("update") |
| | | public R order(@RequestBody EditNeighborCircleAdminVO editNeighborCircleAdminVO) { |
| | | return this.communityService.order(editNeighborCircleAdminVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "服务统计", response = ServiceStaticsVO.class) |
| | | @PostMapping("/serviceStatic") |
| | | public R serviceStatic(@RequestBody ServiceStaticDTO serviceStaticDTO) { |
| | | return this.communityService.serviceStatic(serviceStaticDTO); |
| | | } |
| | | |
| | | /** |
| | | * 求助我的问题数量统计 |
| | | * |
| | | * @param type |
| | | * @param phone |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "求助我的问题数量统计") |
| | | @GetMapping("/selectCount") |
| | | public R selectCount(@RequestParam("type") Integer type, @RequestParam(value = "phone", required = false) String phone, @RequestParam("communityId") Long communityId) { |
| | | return this.communityService.selectCount(type, phone, communityId); |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.panzhihua.applets.weixin.CheckService; |
| | | import com.panzhihua.common.constants.Constants; |
| | | import com.panzhihua.common.constants.NeighborCircleConstants; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.neighbor.*; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleAppVO; |
| | | import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleDetailAppVO; |
| | | import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleTopicAppVO; |
| | | import com.panzhihua.common.model.vos.neighbor.ComActNeighborCommentReplyAppVO; |
| | | import com.panzhihua.common.service.community.CommunityWestService; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | 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; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-14 15:02:49 |
| | | * @describe 邻里圈模块API |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/neighborWest/") |
| | | @Api(tags = {"邻里圈服务"}) |
| | | public class NeighborWestApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityWestService communityWestService; |
| | | @Resource |
| | | private CheckService checkService; |
| | | |
| | | @ApiOperation(value = "分页查询邻里圈列表", response = ComActNeighborCircleAppVO.class) |
| | | @PostMapping("pageApp") |
| | | public R pageNeighborByApp(@RequestBody ComActNeighborCircleAppDTO neighborCircleAppDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | neighborCircleAppDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | neighborCircleAppDTO.setUserId(loginUserInfo.getUserId()); |
| | | } |
| | | return communityWestService.pageNeighborByApp(neighborCircleAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "用户发布邻里圈审核") |
| | | @PostMapping("addNeighborByApp") |
| | | public R addNeighborByApp(@RequestBody AddComActNeighborCircleAppDTO addNeighborCircleAppDTO) { |
| | | LoginUserInfoVO loginUser = this.getLoginUserInfo(); |
| | | Long userId = loginUser.getUserId(); |
| | | Long communityId = loginUser.getCommunityId(); |
| | | |
| | | if (userId == null) { |
| | | return R.fail("请重新登录"); |
| | | } |
| | | addNeighborCircleAppDTO.setUserId(userId); |
| | | String openid = this.getLoginUserInfo().getOpenid(); |
| | | String appId = this.getAppId(); |
| | | // 微信内容审核 |
| | | String releaseContent = addNeighborCircleAppDTO.getReleaseContent(); |
| | | if (StrUtil.isNotBlank(releaseContent)) { |
| | | String result = checkService.checkMessageBy(releaseContent, openid, appId); |
| | | if (StrUtil.isNotBlank(result)) { |
| | | return R.fail(501, "填写内容存在 " + result + " 违规信息"); |
| | | } |
| | | } |
| | | |
| | | //微信图片审核 |
| | | String releaseImages = addNeighborCircleAppDTO.getReleaseImages(); |
| | | if (StrUtil.isNotBlank(releaseImages)) { |
| | | if (!checkService.checkImageBy(releaseImages, appId)) { |
| | | return R.fail(501, "上传图片存在违规信息"); |
| | | } |
| | | } |
| | | |
| | | if (StringUtils.isNotEmpty(loginUser.getPhone())) { |
| | | addNeighborCircleAppDTO.setPhone(this.getLoginUserInfo().getPhone()); |
| | | } |
| | | if (communityId != null) { |
| | | addNeighborCircleAppDTO.setCommunityId(communityId); |
| | | } |
| | | |
| | | if(this.getAppId().equals("wx118de8a734d269f0")){ |
| | | //花城直接通过 |
| | | addNeighborCircleAppDTO.setIsExamine(AddComActNeighborCircleAppDTO.isExamine.no); |
| | | addNeighborCircleAppDTO.setWxExamineResult(AddComActNeighborCircleAppDTO.isExamine.yes); |
| | | }else { |
| | | //查询社区自动审核是否开着 |
| | | String key = NeighborCircleConstants.NEIGHBOR_CIRCLE_AUTO_EXAMINE; |
| | | R isOk = communityWestService.getSysConfValue(key + communityId, communityId); |
| | | if (R.isOk(isOk)) { |
| | | if (isOk.getData() != null) { |
| | | String value = isOk.getData().toString(); |
| | | if (value.equals("1")) { |
| | | addNeighborCircleAppDTO.setIsExamine(AddComActNeighborCircleAppDTO.isExamine.no); |
| | | String msg = addNeighborCircleAppDTO.getReleaseContent(); |
| | | if (StrUtil.isEmpty(checkService.checkMessageBy(msg,this.getLoginUserInfo().getOpenid(),this.getAppId()))) { |
| | | addNeighborCircleAppDTO.setWxExamineResult(AddComActNeighborCircleAppDTO.isExamine.yes); |
| | | } else { |
| | | addNeighborCircleAppDTO.setWxExamineResult(AddComActNeighborCircleAppDTO.isExamine.no); |
| | | } |
| | | } else { |
| | | addNeighborCircleAppDTO.setIsExamine(AddComActNeighborCircleAppDTO.isExamine.yes); |
| | | } |
| | | } else { |
| | | communityWestService.addSysConfValue(key + communityId, communityId, "社区邻里圈自动审核参数", "1"); |
| | | addNeighborCircleAppDTO.setIsExamine(AddComActNeighborCircleAppDTO.isExamine.no); |
| | | } |
| | | } else { |
| | | addNeighborCircleAppDTO.setIsExamine(AddComActNeighborCircleAppDTO.isExamine.yes); |
| | | } |
| | | } |
| | | |
| | | |
| | | return communityWestService.addNeighborByApp(addNeighborCircleAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询邻里圈详情", response = ComActNeighborCircleDetailAppVO.class) |
| | | @PostMapping("detail") |
| | | public R neighborDetailByApp(@RequestBody ComActNeighborCircleDetailAppDTO neighborCircleAppDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | neighborCircleAppDTO.setUserId(loginUserInfo.getUserId()); |
| | | } |
| | | // Long userId = this.getLoginUserInfo().getUserId(); |
| | | // if(userId == null){ |
| | | // return R.fail("请先登录"); |
| | | // } |
| | | // neighborCircleAppDTO.setUserId(userId); |
| | | return communityWestService.neighborDetailByApp(neighborCircleAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询用户邻里圈审核列表", response = ComActNeighborCircleAppVO.class) |
| | | @PostMapping("user/page") |
| | | public R neighborExamineByApp(@RequestBody ComActNeighborCircleAppDTO neighborCircleAppDTO) { |
| | | Long userId = this.getLoginUserInfo().getUserId(); |
| | | if (userId == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | neighborCircleAppDTO.setUserId(userId); |
| | | return communityWestService.neighborExamineByApp(neighborCircleAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "邻里圈点赞") |
| | | @PostMapping("fabulous") |
| | | public R neighborFabulousByApp(@RequestBody ComActNeighborFabulousAppDTO fabulousAppDTO) { |
| | | Long userId = this.getLoginUserInfo().getUserId(); |
| | | if (userId == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | fabulousAppDTO.setUserId(userId); |
| | | return communityWestService.neighborFabulousByApp(fabulousAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "邻里圈转发") |
| | | @PostMapping("forward") |
| | | public R neighborForwardByApp(@RequestBody ComActNeighborForwardAppDTO forwardAppDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | forwardAppDTO.setUserId(loginUserInfo.getUserId()); |
| | | } |
| | | // Long userId = this.getLoginUserInfo().getUserId(); |
| | | // if(userId == null){ |
| | | // return R.fail("请先登录"); |
| | | // } |
| | | // forwardAppDTO.setUserId(userId); |
| | | return communityWestService.neighborForwardByApp(forwardAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "邻里圈评论") |
| | | @PostMapping("comment") |
| | | public R neighborCommentByApp(@RequestBody ComActNeighborCommentAppDTO commentAppDTO) { |
| | | Long userId = this.getLoginUserInfo().getUserId(); |
| | | if (userId == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | commentAppDTO.setUserId(userId); |
| | | String openid = this.getLoginUserInfo().getOpenid(); |
| | | String appId = this.getAppId(); |
| | | // 微信内容审核 |
| | | String content = commentAppDTO.getContent(); |
| | | if (StrUtil.isNotBlank(content)) { |
| | | String result = checkService.checkMessageBy(content, openid, appId); |
| | | if (StrUtil.isNotBlank(result)) { |
| | | return R.fail(501, "填写内容存在 " + result + " 违规信息"); |
| | | } |
| | | } |
| | | return communityWestService.neighborCommentByApp(commentAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "邻里圈回复") |
| | | @PostMapping("reply") |
| | | public R neighborReplyByApp(@RequestBody ComActNeighborReplyAppDTO replyAppDTO) { |
| | | Long userId = this.getLoginUserInfo().getUserId(); |
| | | if (userId == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | replyAppDTO.setUserId(userId); |
| | | return communityWestService.neighborReplyByApp(replyAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "邻里圈取消点赞") |
| | | @PostMapping("cancel/fabulous") |
| | | public R neighborFabulousCancelByApp(@RequestBody ComActNeighborFabulousAppDTO fabulousAppDTO) { |
| | | Long userId = this.getLoginUserInfo().getUserId(); |
| | | if (userId == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | fabulousAppDTO.setUserId(userId); |
| | | return communityWestService.neighborFabulousCancelByApp(fabulousAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "邻里圈添加浏览记录") |
| | | @PostMapping("add/browse") |
| | | public R neighborAddBrowseByApp(@RequestBody ComActNeighborAddBrowseAppDTO addBrowseAppDTO) { |
| | | Long userId = this.getLoginUserInfo().getUserId(); |
| | | if (userId == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | addBrowseAppDTO.setUserId(userId); |
| | | return communityWestService.neighborAddBrowseByApp(addBrowseAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询评论下所有回复", response = ComActNeighborCommentReplyAppVO.class) |
| | | @PostMapping("comment/reply") |
| | | public R neighborCommentReplyByApp(@RequestBody ComActNeighborCommentReplyAppDTO commentReplyAppDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | commentReplyAppDTO.setUserId(loginUserInfo.getUserId()); |
| | | } |
| | | // Long userId = this.getLoginUserInfo().getUserId(); |
| | | // if(userId == null){ |
| | | // return R.fail("请先登录"); |
| | | // } |
| | | // commentReplyAppDTO.setUserId(userId); |
| | | return communityWestService.neighborCommentReplyByApp(commentReplyAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询社区邻里圈话题列表", response = ComActNeighborCircleTopicAppVO.class) |
| | | @GetMapping("topic/list") |
| | | public R getNeighborTopicByApp(@RequestParam("communityId") Long communityId |
| | | , @RequestParam(value = "isZero", defaultValue = "2", required = false) Integer isZero |
| | | , @RequestParam(value = "name", defaultValue = "", required = false) String name) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | communityId = loginUserInfo.getCommunityId(); |
| | | } |
| | | if (isZero == null) { |
| | | isZero = 2; |
| | | } |
| | | return communityWestService.getNeighborTopicByApp(communityId, isZero, name); |
| | | } |
| | | |
| | | @ApiOperation(value = "用户新增邻里圈话题") |
| | | @PostMapping("topic/add") |
| | | public R addNeighborTopicByApp(@RequestBody AddNeighborCircleTopicAppDTO circleTopicAppDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo == null) { |
| | | return R.fail(401, "请先登录"); |
| | | } |
| | | circleTopicAppDTO.setUserId(loginUserInfo.getUserId()); |
| | | circleTopicAppDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | return communityWestService.addNeighborTopicByApp(circleTopicAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "用户删除邻里圈") |
| | | @PostMapping("delete") |
| | | public R deleteNeighborByApp(@RequestBody DeleteNeighborCircleAppDTO circleTopicAppDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo == null) { |
| | | return R.fail(401, "请先登录"); |
| | | } |
| | | circleTopicAppDTO.setUserId(loginUserInfo.getUserId()); |
| | | circleTopicAppDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | return communityWestService.deleteNeighborByApp(circleTopicAppDTO); |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.panzhihua.common.constants.Constants; |
| | | import com.panzhihua.common.interfaces.OperLog; |
| | | import com.panzhihua.common.model.dtos.common.PageComPbCheckUnitDto; |
| | | import com.panzhihua.common.model.dtos.community.PageMemberForInviteDTO; |
| | | import com.panzhihua.common.model.vos.common.ComPbCheckUnitVo; |
| | | import com.panzhihua.common.model.vos.grid.EventGridCommunityAdminVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.service.partybuilding.ComPbCheckUnitFeign; |
| | | import com.panzhihua.common.service.partybuilding.PartyBuildingWestService; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.applets.weixin.CheckService; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.partybuilding.ActivitySignUpDTO; |
| | | import com.panzhihua.common.model.dtos.partybuilding.ComListPartyDTO; |
| | | import com.panzhihua.common.model.dtos.partybuilding.ComPbActivityDTO; |
| | | import com.panzhihua.common.model.dtos.partybuilding.PageComPbServiceTeamDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.partybuilding.*; |
| | | import com.panzhihua.common.model.vos.user.SysUserNoticeVO; |
| | | import com.panzhihua.common.service.partybuilding.PartyBuildingService; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: 党群服务 |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-12-02 16:19 |
| | | **/ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/partybuilding/") |
| | | @Api(tags = {"党群服务"}) |
| | | public class PartyBuildingApi extends BaseController { |
| | | @Resource |
| | | private PartyBuildingService partyBuildingService; |
| | | @Resource |
| | | private PartyBuildingWestService partyBuildingWestService; |
| | | @Resource |
| | | private UserService userService; |
| | | @Resource |
| | | private CheckService checkService; |
| | | @Resource |
| | | private ComPbCheckUnitFeign pbCheckUnitFeign; |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | public static void main(String[] args) { |
| | | Date date = new Date(); |
| | | String dateFormat = String.format("%tF %tT ", date, date); |
| | | System.out.println(dateFormat); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页党建动态/政策文件", response = PartyBuildingComPbDynVO.class) |
| | | @PostMapping("pagedynamic") |
| | | public R pageYnamic(@RequestBody PartyBuildingComPbDynVO partyBuildingComPbDynVO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | partyBuildingComPbDynVO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | } |
| | | Integer type = partyBuildingComPbDynVO.getType(); |
| | | if (ObjectUtils.isEmpty(type)) { |
| | | return R.fail("类型不能为空"); |
| | | } |
| | | partyBuildingComPbDynVO.setStatus(2); |
| | | return partyBuildingWestService.pageYnamic(partyBuildingComPbDynVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询党员活动", response = PageActivityMembersVO.class) |
| | | @PostMapping("pageactivity") |
| | | public R pageActivity(@RequestBody PartyBuildingActivityVO partyBuildingActivityVO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | partyBuildingActivityVO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | } |
| | | // Long communityId = this.getCommunityId(); |
| | | // partyBuildingActivityVO.setCommunityId(communityId); |
| | | Integer status = partyBuildingActivityVO.getStatus(); |
| | | if (null != status && status.intValue() == 4) { |
| | | partyBuildingActivityVO.setIsAppliets(1); |
| | | } |
| | | return partyBuildingService.pageActivity(partyBuildingActivityVO); |
| | | } |
| | | |
| | | // @ApiOperation(value = "增加阅读记录") |
| | | // @PostMapping("adddynuser") |
| | | // public R addDynUser(@RequestBody PartyBuildingComPbDynVO partyBuildingComPbDynVO) { |
| | | // Long id = partyBuildingComPbDynVO.getId(); |
| | | // if (ObjectUtils.isEmpty(id)||0==id) { |
| | | // return R.fail("主键id不能为空"); |
| | | // } |
| | | // Long userId = this.getUserId(); |
| | | // ComPbDynUserVO comPbDynUserVO=new ComPbDynUserVO(); |
| | | // comPbDynUserVO.setCreateAt(new Date()); |
| | | // comPbDynUserVO.setDynId(id); |
| | | // comPbDynUserVO.setUserId(userId); |
| | | // return partyBuildingService.addDynUser(comPbDynUserVO); |
| | | // } |
| | | |
| | | @ApiOperation(value = "动态/政策文件详情", response = PartyBuildingComPbDynVO.class) |
| | | @GetMapping("infodynamic") |
| | | public R infoYnamic(@RequestParam("id") Long id) { |
| | | R r = partyBuildingWestService.infoYnamic(id); |
| | | if (R.isOk(r)) { |
| | | if (ObjectUtils.isEmpty(id) || 0 == id) { |
| | | return R.fail("主键id不能为空"); |
| | | } |
| | | Long userId = null; |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | userId = loginUserInfo.getUserId(); |
| | | } |
| | | |
| | | PartyBuildingComPbDynVO partyBuildingComPbDynVO = |
| | | JSONObject.parseObject(JSONObject.toJSONString(r.getData()), PartyBuildingComPbDynVO.class); |
| | | if (userId != null) { |
| | | ComPbDynUserVO comPbDynUserVO = new ComPbDynUserVO(); |
| | | comPbDynUserVO.setCreateAt(new Date()); |
| | | comPbDynUserVO.setDynId(id); |
| | | comPbDynUserVO.setUserId(userId); |
| | | R r1 = partyBuildingWestService.addDynUser(comPbDynUserVO); |
| | | if (R.isOk(r1)) { |
| | | partyBuildingComPbDynVO.setIsAdd(1); |
| | | } else { |
| | | partyBuildingComPbDynVO.setIsAdd(0); |
| | | } |
| | | } else { |
| | | partyBuildingComPbDynVO.setIsAdd(0); |
| | | } |
| | | return R.ok(partyBuildingComPbDynVO); |
| | | } |
| | | return r; |
| | | } |
| | | |
| | | @ApiOperation(value = "分页党委查询", response = PartyCommitteeVO.class) |
| | | @PostMapping("pagepartycommittee") |
| | | public R pagePartyCommittee(@RequestBody PartyCommitteeVO partyCommitteeVO) { |
| | | // Long communityId =this.getCommunityId(); |
| | | // partyCommitteeVO.setCommunityId(communityId); |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | partyCommitteeVO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | } |
| | | return partyBuildingService.pagePartyCommittee(partyCommitteeVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "活动详情", response = PartyBuildingActivityVO.class) |
| | | @GetMapping("activityinfo") |
| | | public R activityinfo(@RequestParam("id") Long id) { |
| | | Long userId = this.getUserId(); |
| | | return partyBuildingService.activityinfo(id, userId); |
| | | } |
| | | |
| | | @ApiOperation(value = "党员活动人员参入列表", response = PartyBuildingMemberVO.class) |
| | | @GetMapping("listpartybuildingmember") |
| | | public R listPartyBuildingMember(@RequestParam("id") Long id) { |
| | | return partyBuildingService.listPartyBuildingMember(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "报名、取消报名党员活动") |
| | | @PutMapping("activitysignup") |
| | | public R putActivitySignUp(@RequestBody @Validated ActivitySignUpDTO activitySignUpDTO) { |
| | | Long userId = this.getUserId(); |
| | | activitySignUpDTO.setUserId(userId); |
| | | Long id = activitySignUpDTO.getId(); |
| | | R r = partyBuildingService.putActivitySignUp(activitySignUpDTO); |
| | | if (R.isOk(r) && activitySignUpDTO.getType().intValue() == 1) { |
| | | R r2 = partyBuildingService.activityinfo(id, userId); |
| | | PartyBuildingActivityVO partyBuildingActivityVO = |
| | | JSONObject.parseObject(JSONObject.toJSONString(r2.getData()), PartyBuildingActivityVO.class); |
| | | SysUserNoticeVO sysUserNoticeVO = new SysUserNoticeVO(); |
| | | sysUserNoticeVO.setUserId(userId); |
| | | sysUserNoticeVO.setType(1); |
| | | sysUserNoticeVO.setTitle("报名成功"); |
| | | sysUserNoticeVO.setBusinessType(2); |
| | | sysUserNoticeVO.setBusinessTitle(partyBuildingActivityVO.getName()); |
| | | Date activityTimeBegin = partyBuildingActivityVO.getActivityTimeBegin(); |
| | | sysUserNoticeVO |
| | | .setBusinessContent(String.format("活动将于 %tF %tT 开始,请按时参加", activityTimeBegin, activityTimeBegin)); |
| | | sysUserNoticeVO.setBusinessId(id); |
| | | sysUserNoticeVO.setStatus(0); |
| | | sysUserNoticeVO.setBusinessStatus(2); |
| | | R r1 = userService.addNotice(sysUserNoticeVO); |
| | | if (R.isOk(r1)) { |
| | | log.info("新增用户报名党建活动通知成功【{}】", JSONObject.toJSONString(sysUserNoticeVO)); |
| | | } |
| | | } |
| | | return r; |
| | | } |
| | | |
| | | @ApiOperation(value = "创建党员活动") |
| | | @PostMapping("activityinfo") |
| | | public R addActivityinfo(@RequestBody @Validated(AddGroup.class) ComPbActivityDTO comPbActivityDTO) { |
| | | // 微信内容审核 |
| | | String msg = comPbActivityDTO.getRichText(); |
| | | if (StrUtil.isNotBlank(msg)) { |
| | | String result = checkService.checkMessageBy(msg, this.getLoginUserInfo().getOpenid(),this.getAppId()); |
| | | if (StrUtil.isNotBlank(result)) { |
| | | return R.fail(501, "填写内容存在 " + result + " 违规信息"); |
| | | } |
| | | } |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | Long userId = loginUserInfo.getUserId(); |
| | | Long communityId = loginUserInfo.getCommunityId(); |
| | | comPbActivityDTO.setCreateBy(userId); |
| | | comPbActivityDTO.setCommunityId(communityId); |
| | | Date date = new Date(); |
| | | comPbActivityDTO.setReleaseTime(date); |
| | | Date activityTimeBegin = comPbActivityDTO.getActivityTimeBegin(); |
| | | Date activityTimeEnd = comPbActivityDTO.getActivityTimeEnd(); |
| | | boolean before = activityTimeEnd.before(activityTimeBegin); |
| | | if (before) { |
| | | return R.fail("活动结束时间不能早于开始时间"); |
| | | } |
| | | // 1 待发布 2 未开始 3 报名中 4 进行中 5 已结束 6 已取消 |
| | | int status = 2; |
| | | Date enrollTimeBegin = comPbActivityDTO.getEnrollTimeBegin(); |
| | | Date enrollTimeEnd = comPbActivityDTO.getEnrollTimeEnd(); |
| | | if (enrollTimeEnd.before(enrollTimeBegin)) { |
| | | return R.fail("报名结束时间不能早于报名开始时间"); |
| | | } |
| | | if (enrollTimeBegin.before(date)) { |
| | | status = 3; |
| | | } |
| | | comPbActivityDTO.setStatus(status); |
| | | return partyBuildingService.addActivityApplets(comPbActivityDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询服务团队成员", response = ComPbServiceTeamVO.class) |
| | | @PostMapping("pageserviceteam") |
| | | public R pageServiceTeam(@RequestBody PageComPbServiceTeamDTO pageComPbServiceTeamDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | pageComPbServiceTeamDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | } |
| | | // pageComPbServiceTeamDTO.setCommunityId(this.getCommunityId()); |
| | | return partyBuildingService.pageServiceTeam(pageComPbServiceTeamDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "社区所有启用的党组织列表", response = PartyOrganizationVO.class) |
| | | @PostMapping("listpartyorganization") |
| | | public R listPartyOrganization(@RequestBody ComListPartyDTO comListPartyDTO) { |
| | | // Long communityId = this.getCommunityId(); |
| | | // log.info("社区所有党组织社区id【{}】", communityId); |
| | | // if(communityId != null){ |
| | | // comListPartyDTO.setCommunityId(communityId); |
| | | // } |
| | | return partyBuildingService.listPartyOrganizationByApp(comListPartyDTO); |
| | | } |
| | | |
| | | @OperLog(operModul = "党员管理", operType = 2) |
| | | @ApiOperation(value = "编辑党员") |
| | | @PutMapping("updatepartybuildingmember") |
| | | public R updatePartyBuildingMember(@RequestBody PartyBuildingMemberVO partyBuildingMemberVO) { |
| | | return partyBuildingService.updatePartyBuildingMember(partyBuildingMemberVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询社区下所有党员报到单位", response = ComPbCheckUnitVo.class) |
| | | @PostMapping("/comPbCheckUnit/list") |
| | | public R getPbCheckUnitList(@RequestBody PageComPbCheckUnitDto comPbCheckUnit) { |
| | | if (comPbCheckUnit.getCommunityId() == null) { |
| | | comPbCheckUnit.setCommunityId(this.getCommunityId()); |
| | | } |
| | | return pbCheckUnitFeign.queryByList(comPbCheckUnit); |
| | | } |
| | | |
| | | @OperLog(operModul = "党员管理", operType = 1) |
| | | @ApiOperation(value = "新增党员") |
| | | @PostMapping("addpartybuildingmember") |
| | | public R addPartyBuildingMember(@RequestBody PartyBuildingMemberVO partyBuildingMemberVO) { |
| | | Long userId = this.getUserId(); |
| | | partyBuildingMemberVO.setUserId(userId); |
| | | R r = partyBuildingService.addPartyBuildingMember(partyBuildingMemberVO); |
| | | if (R.isOk(r)) { |
| | | R r1 = userService.updateUserPartyStatus(this.getUserId()); |
| | | } |
| | | return r; |
| | | } |
| | | |
| | | @OperLog(operModul = "党员管理", operType = 1) |
| | | @ApiOperation(value = "分页查询党员列表",response = PartyBuildingMemberVO.class) |
| | | @PostMapping("/page/member") |
| | | public R pageMember(@RequestBody PartyBuildingMemberVO partyBuildingMemberVO) { |
| | | //partyBuildingMemberVO.setCommunityId(this.getCommunityId()); |
| | | return partyBuildingService.getPagePbMember(partyBuildingMemberVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询注册党员列表",response = PartyBuildingMemberVO.class) |
| | | @PostMapping("/page/registerMember") |
| | | public R pageRegisterMember(@RequestBody PageMemberForInviteDTO pageMemberForInviteDTO) { |
| | | pageMemberForInviteDTO.setAppid(this.getAppId()); |
| | | return partyBuildingService.pageRegisterMember(pageMemberForInviteDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询所有社区列表", response = EventGridCommunityAdminVO.class) |
| | | @GetMapping("/community/list") |
| | | public R getCommunityLists() { |
| | | return communityService.getCommunityLists(); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询当前用户党员信息") |
| | | @GetMapping("/getPartyMember") |
| | | public R getPartyMember(@RequestParam("type")Integer type){ |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if (StrUtil.isEmpty(loginUserInfo.getPhone())){ |
| | | return R.fail("请先实名认证"); |
| | | } |
| | | return partyBuildingService.getPartyMember(loginUserInfo.getPhone(),type); |
| | | } |
| | | @ApiOperation(value = "查询报道单位详情") |
| | | @GetMapping("/comPbCheckUnit/detailByPhone") |
| | | public R detailById(@RequestParam("phone") String phone) { |
| | | return partyBuildingService.detailByPhone(phone); |
| | | } |
| | | @ApiOperation(value = "党员详情",response =PartyBuildingMemberVO.class) |
| | | @GetMapping("/memberDetail") |
| | | public R memberDetail(@RequestParam("id")Long id){ |
| | | return partyBuildingService.memberDetail(id); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.panzhihua.common.constants.Constants; |
| | | import com.panzhihua.common.interfaces.OperLog; |
| | | import com.panzhihua.common.model.dtos.common.PageComPbCheckUnitDto; |
| | | import com.panzhihua.common.model.vos.common.ComPbCheckUnitVo; |
| | | import com.panzhihua.common.model.vos.partybuilding.*; |
| | | import com.panzhihua.common.service.partybuilding.ComPbCheckUnitFeign; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.applets.weixin.CheckService; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.partybuilding.ActivitySignUpDTO; |
| | | import com.panzhihua.common.model.dtos.partybuilding.ComListPartyDTO; |
| | | import com.panzhihua.common.model.dtos.partybuilding.ComPbActivityDTO; |
| | | import com.panzhihua.common.model.dtos.partybuilding.PageComPbServiceTeamDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.user.SysUserNoticeVO; |
| | | import com.panzhihua.common.service.partybuilding.PartyBuildingWestService; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: 党群服务 |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-12-02 16:19 |
| | | **/ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/partybuildingWest/") |
| | | @Api(tags = {"党群服务"}) |
| | | public class PartyBuildingWestApi extends BaseController { |
| | | @Resource |
| | | private PartyBuildingWestService partyBuildingWestService; |
| | | @Resource |
| | | private UserService userService; |
| | | @Resource |
| | | private CheckService checkService; |
| | | @Resource |
| | | private ComPbCheckUnitFeign pbCheckUnitFeign; |
| | | |
| | | public static void main(String[] args) { |
| | | Date date = new Date(); |
| | | String dateFormat = String.format("%tF %tT ", date, date); |
| | | System.out.println(dateFormat); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页党建动态/政策文件", response = PartyBuildingComPbDynVO.class) |
| | | @PostMapping("pagedynamic") |
| | | public R pageYnamic(@RequestBody PartyBuildingComPbDynVO partyBuildingComPbDynVO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | partyBuildingComPbDynVO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | } |
| | | Integer type = partyBuildingComPbDynVO.getType(); |
| | | if (ObjectUtils.isEmpty(type)) { |
| | | return R.fail("类型不能为空"); |
| | | } |
| | | partyBuildingComPbDynVO.setStatus(2); |
| | | return partyBuildingWestService.pageYnamic(partyBuildingComPbDynVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询党员活动", response = PageActivityMembersVO.class) |
| | | @PostMapping("pageactivity") |
| | | public R pageActivity(@RequestBody PartyBuildingActivityVO partyBuildingActivityVO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | partyBuildingActivityVO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | } |
| | | // Long communityId = this.getCommunityId(); |
| | | // partyBuildingActivityVO.setCommunityId(communityId); |
| | | Integer status = partyBuildingActivityVO.getStatus(); |
| | | if (null != status && status.intValue() == 4) { |
| | | partyBuildingActivityVO.setIsAppliets(1); |
| | | } |
| | | return partyBuildingWestService.pageActivity(partyBuildingActivityVO); |
| | | } |
| | | |
| | | // @ApiOperation(value = "增加阅读记录") |
| | | // @PostMapping("adddynuser") |
| | | // public R addDynUser(@RequestBody PartyBuildingComPbDynVO partyBuildingComPbDynVO) { |
| | | // Long id = partyBuildingComPbDynVO.getId(); |
| | | // if (ObjectUtils.isEmpty(id)||0==id) { |
| | | // return R.fail("主键id不能为空"); |
| | | // } |
| | | // Long userId = this.getUserId(); |
| | | // ComPbDynUserVO comPbDynUserVO=new ComPbDynUserVO(); |
| | | // comPbDynUserVO.setCreateAt(new Date()); |
| | | // comPbDynUserVO.setDynId(id); |
| | | // comPbDynUserVO.setUserId(userId); |
| | | // return partyBuildingService.addDynUser(comPbDynUserVO); |
| | | // } |
| | | |
| | | @ApiOperation(value = "动态/政策文件详情", response = PartyBuildingComPbDynVO.class) |
| | | @GetMapping("infodynamic") |
| | | public R infoYnamic(@RequestParam("id") Long id) { |
| | | R r = partyBuildingWestService.infoYnamic(id); |
| | | if (R.isOk(r)) { |
| | | if (ObjectUtils.isEmpty(id) || 0 == id) { |
| | | return R.fail("主键id不能为空"); |
| | | } |
| | | Long userId = null; |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | userId = loginUserInfo.getUserId(); |
| | | } |
| | | |
| | | PartyBuildingComPbDynVO partyBuildingComPbDynVO = |
| | | JSONObject.parseObject(JSONObject.toJSONString(r.getData()), PartyBuildingComPbDynVO.class); |
| | | if (userId != null) { |
| | | ComPbDynUserVO comPbDynUserVO = new ComPbDynUserVO(); |
| | | comPbDynUserVO.setCreateAt(new Date()); |
| | | comPbDynUserVO.setDynId(id); |
| | | comPbDynUserVO.setUserId(userId); |
| | | R r1 = partyBuildingWestService.addDynUser(comPbDynUserVO); |
| | | if (R.isOk(r1)) { |
| | | partyBuildingComPbDynVO.setIsAdd(1); |
| | | } else { |
| | | partyBuildingComPbDynVO.setIsAdd(0); |
| | | } |
| | | } else { |
| | | partyBuildingComPbDynVO.setIsAdd(0); |
| | | } |
| | | return R.ok(partyBuildingComPbDynVO); |
| | | } |
| | | return r; |
| | | } |
| | | |
| | | @ApiOperation(value = "分页党委查询", response = PartyCommitteeVO.class) |
| | | @PostMapping("pagepartycommittee") |
| | | public R pagePartyCommittee(@RequestBody PartyCommitteeVO partyCommitteeVO) { |
| | | // Long communityId =this.getCommunityId(); |
| | | // partyCommitteeVO.setCommunityId(communityId); |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | partyCommitteeVO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | } |
| | | return partyBuildingWestService.pagePartyCommittee(partyCommitteeVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "活动详情", response = PartyBuildingActivityVO.class) |
| | | @GetMapping("activityinfo") |
| | | public R activityinfo(@RequestParam("id") Long id) { |
| | | Long userId = this.getUserId(); |
| | | return partyBuildingWestService.activityinfo(id, userId); |
| | | } |
| | | |
| | | @ApiOperation(value = "党员活动人员参入列表", response = PartyBuildingMemberVO.class) |
| | | @GetMapping("listpartybuildingmember") |
| | | public R listPartyBuildingMember(@RequestParam("id") Long id) { |
| | | return partyBuildingWestService.listPartyBuildingMember(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "报名、取消报名党员活动") |
| | | @PutMapping("activitysignup") |
| | | public R putActivitySignUp(@RequestBody @Validated ActivitySignUpDTO activitySignUpDTO) { |
| | | Long userId = this.getUserId(); |
| | | activitySignUpDTO.setUserId(userId); |
| | | Long id = activitySignUpDTO.getId(); |
| | | R r = partyBuildingWestService.putActivitySignUp(activitySignUpDTO); |
| | | if (R.isOk(r) && activitySignUpDTO.getType().intValue() == 1) { |
| | | R r2 = partyBuildingWestService.activityinfo(id, userId); |
| | | PartyBuildingActivityVO partyBuildingActivityVO = |
| | | JSONObject.parseObject(JSONObject.toJSONString(r2.getData()), PartyBuildingActivityVO.class); |
| | | SysUserNoticeVO sysUserNoticeVO = new SysUserNoticeVO(); |
| | | sysUserNoticeVO.setUserId(userId); |
| | | sysUserNoticeVO.setType(1); |
| | | sysUserNoticeVO.setTitle("报名成功"); |
| | | sysUserNoticeVO.setBusinessType(2); |
| | | sysUserNoticeVO.setBusinessTitle(partyBuildingActivityVO.getName()); |
| | | Date activityTimeBegin = partyBuildingActivityVO.getActivityTimeBegin(); |
| | | sysUserNoticeVO |
| | | .setBusinessContent(String.format("活动将于 %tF %tT 开始,请按时参加", activityTimeBegin, activityTimeBegin)); |
| | | sysUserNoticeVO.setBusinessId(id); |
| | | sysUserNoticeVO.setStatus(0); |
| | | sysUserNoticeVO.setBusinessStatus(2); |
| | | R r1 = userService.addNotice(sysUserNoticeVO); |
| | | if (R.isOk(r1)) { |
| | | log.info("新增用户报名党建活动通知成功【{}】", JSONObject.toJSONString(sysUserNoticeVO)); |
| | | } |
| | | } |
| | | return r; |
| | | } |
| | | |
| | | @ApiOperation(value = "创建党员活动") |
| | | @PostMapping("activityinfo") |
| | | public R addActivityinfo(@RequestBody @Validated(AddGroup.class) ComPbActivityDTO comPbActivityDTO) { |
| | | // 微信内容审核 |
| | | String msg = comPbActivityDTO.getRichText(); |
| | | if (StrUtil.isNotBlank(msg)) { |
| | | String result = checkService.checkMessageBy(msg, this.getLoginUserInfo().getOpenid(),this.getAppId()); |
| | | if (StrUtil.isNotBlank(result)) { |
| | | return R.fail(501, "填写内容存在 " + result + " 违规信息"); |
| | | } |
| | | } |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | Long userId = loginUserInfo.getUserId(); |
| | | Long communityId = loginUserInfo.getCommunityId(); |
| | | comPbActivityDTO.setCreateBy(userId); |
| | | comPbActivityDTO.setCommunityId(communityId); |
| | | Date date = new Date(); |
| | | comPbActivityDTO.setReleaseTime(date); |
| | | Date activityTimeBegin = comPbActivityDTO.getActivityTimeBegin(); |
| | | Date activityTimeEnd = comPbActivityDTO.getActivityTimeEnd(); |
| | | boolean before = activityTimeEnd.before(activityTimeBegin); |
| | | if (before) { |
| | | return R.fail("活动结束时间不能早于开始时间"); |
| | | } |
| | | // 1 待发布 2 未开始 3 报名中 4 进行中 5 已结束 6 已取消 |
| | | int status = 2; |
| | | Date enrollTimeBegin = comPbActivityDTO.getEnrollTimeBegin(); |
| | | Date enrollTimeEnd = comPbActivityDTO.getEnrollTimeEnd(); |
| | | if (enrollTimeEnd.before(enrollTimeBegin)) { |
| | | return R.fail("报名结束时间不能早于报名开始时间"); |
| | | } |
| | | if (enrollTimeBegin.before(date)) { |
| | | status = 3; |
| | | } |
| | | comPbActivityDTO.setStatus(status); |
| | | return partyBuildingWestService.addActivityApplets(comPbActivityDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询服务团队成员", response = ComPbServiceTeamVO.class) |
| | | @PostMapping("pageserviceteam") |
| | | public R pageServiceTeam(@RequestBody PageComPbServiceTeamDTO pageComPbServiceTeamDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | pageComPbServiceTeamDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | } |
| | | // pageComPbServiceTeamDTO.setCommunityId(this.getCommunityId()); |
| | | return partyBuildingWestService.pageServiceTeam(pageComPbServiceTeamDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "社区所有启用的党组织列表", response = PartyOrganizationVO.class) |
| | | @PostMapping("listpartyorganization") |
| | | public R listPartyOrganization(@RequestBody ComListPartyDTO comListPartyDTO) { |
| | | // Long communityId = this.getCommunityId(); |
| | | // log.info("社区所有党组织社区id【{}】", communityId); |
| | | // if(communityId != null){ |
| | | // comListPartyDTO.setCommunityId(communityId); |
| | | // } |
| | | return partyBuildingWestService.listPartyOrganizationByApp(comListPartyDTO); |
| | | } |
| | | |
| | | @OperLog(operModul = "党员管理", operType = 2) |
| | | @ApiOperation(value = "编辑党员") |
| | | @PutMapping("updatepartybuildingmember") |
| | | public R updatePartyBuildingMember(@RequestBody PartyBuildingMemberVO partyBuildingMemberVO) { |
| | | if(partyBuildingMemberVO.getIsPb()!=null){ |
| | | Long id = partyBuildingMemberVO.getId(); |
| | | if(partyBuildingMemberVO.getIsPb()==1){ |
| | | if (null == id || 0 == id) { |
| | | return partyBuildingWestService.addPartyBuildingMember(partyBuildingMemberVO); |
| | | } |
| | | return partyBuildingWestService.updatePartyBuildingMember(partyBuildingMemberVO); |
| | | } |
| | | return partyBuildingWestService.deleteprepartybuildingmember(id); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询社区下所有党员报到单位", response = ComPbCheckUnitVo.class) |
| | | @PostMapping("/comPbCheckUnit/list") |
| | | public R getPbCheckUnitList(@RequestBody PageComPbCheckUnitDto comPbCheckUnit) { |
| | | if(comPbCheckUnit.getCommunityId() == null){ |
| | | comPbCheckUnit.setCommunityId(this.getCommunityId()); |
| | | } |
| | | return pbCheckUnitFeign.queryByList(comPbCheckUnit); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.rentHouse.RentingHourseOrderVO; |
| | | import com.panzhihua.common.model.vos.community.rentHouse.WxPayNotifyOrderVO; |
| | | import com.panzhihua.common.model.vos.community.rentHouse.WxPayOrderVO; |
| | | 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.beans.BeanUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 房屋租赁-房屋订单表(RentingHourseOrder)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-11-23 10:46:57 |
| | | */ |
| | | @RestController |
| | | @Slf4j |
| | | @Api(tags = {"房屋租赁普通订单相关接口"}) |
| | | @RequestMapping("rentingHourseOrder") |
| | | public class RentingHourseOrderApi extends BaseController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @ApiOperation(value = "分页查询所有数据",response = RentingHourseOrderVO.class) |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | commonPage.setCommunityId(this.getCommunityId()); |
| | | return communityService.selectRentingHourseOrderAll(commonPage); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @ApiOperation(value = "分页查询所有数据") |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable("id") Long id) { |
| | | return communityService.selectRentingHourseOrderOne(id); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param rentingHourseOrder 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @ApiOperation("创建订单") |
| | | @PostMapping |
| | | public R insert(@RequestBody RentingHourseOrderVO rentingHourseOrder) { |
| | | rentingHourseOrder.setCommunityId(this.getCommunityId()); |
| | | return communityService.insertRentingHourseOrder(rentingHourseOrder); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param rentingHourseOrdervo 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody RentingHourseOrderVO rentingHourseOrdervo) { |
| | | return communityService.updateRentingHourseOrder(rentingHourseOrdervo); |
| | | } |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @ApiOperation("删除") |
| | | @GetMapping("del") |
| | | public R delete(@RequestParam("id") Long id) { |
| | | return communityService.deleteRentingHourseOrder(id); |
| | | } |
| | | |
| | | /** |
| | | * 支付回调处理订单状态以及房屋状态 |
| | | */ |
| | | @ApiOperation("支付回调处理订单状态以及房屋状态") |
| | | @PostMapping("/wxNotify") |
| | | public R wxNotify(@RequestBody WxPayNotifyOrderVO wxPayNotifyOrderVO){ |
| | | return communityService.wxNotifyRentingHourseOrder(wxPayNotifyOrderVO); |
| | | } |
| | | |
| | | /** |
| | | * 支付付款 |
| | | */ |
| | | @ApiOperation("支付付款") |
| | | @PostMapping("/wxPay") |
| | | public R wxPay(@RequestBody WxPayOrderVO wxPayOrderVO){ |
| | | return communityService.wxPayRentingHourseOrder(wxPayOrderVO); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.rentHouse.RentingHoursePreOrderVO; |
| | | 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.beans.BeanUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 房屋租赁-房屋定金订单表(RentingHoursePreOrder)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-11-23 10:47:54 |
| | | */ |
| | | @RestController |
| | | @Slf4j |
| | | @Api(tags = {"房屋租赁定金订单相关接口"}) |
| | | @RequestMapping("rentingHoursePreOrder") |
| | | public class RentingHoursePreOrderApi extends BaseController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @ApiOperation(value = "分页查询",response = RentingHoursePreOrderVO.class) |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | commonPage.setCommunityId(this.getCommunityId()); |
| | | return communityService.selectAllRentingHoursePreOrder(commonPage); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @ApiOperation(value = "详情",response = RentingHoursePreOrderVO.class) |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable("id") Long id) { |
| | | return communityService.selectOneRentingHoursePreOrder(id); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param rentingHoursePreOrderVO 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @ApiOperation(value = "创建定金订单") |
| | | @PostMapping |
| | | public R insert(@RequestBody RentingHoursePreOrderVO rentingHoursePreOrderVO) { |
| | | rentingHoursePreOrderVO.setCommunityId(this.getCommunityId()); |
| | | return communityService.insertRentingHoursePreOrder(rentingHoursePreOrderVO); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param rentingHoursePreOrderVO 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @ApiOperation("修改") |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody RentingHoursePreOrderVO rentingHoursePreOrderVO) { |
| | | return communityService.updateRentingHoursePreOrder(rentingHoursePreOrderVO); |
| | | } |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @ApiOperation("删除数据") |
| | | @GetMapping("del") |
| | | public R delete(@RequestParam("id") Long id) { |
| | | return communityService.deleteRentingHoursePreOrder(id); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import java.util.Objects; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | |
| | | import org.springframework.validation.annotation.Validated; |
| | | 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.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.exceptions.ServiceException; |
| | | import com.panzhihua.common.model.dtos.community.rentingHouses.NearbyDTO; |
| | | import com.panzhihua.common.model.dtos.community.rentingHouses.PageRentingHouseRegisterDTO; |
| | | import com.panzhihua.common.model.dtos.community.rentingHouses.ReleaseOrCancelHouseDTO; |
| | | import com.panzhihua.common.model.dtos.community.rentingHouses.RentingHouseRegisterDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.rentingHouses.RentingHouseRegisterVO; |
| | | import com.panzhihua.common.model.vos.community.rentingHouses.RentingHousesConfigVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.utlis.TencentUtils; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | import com.panzhihua.common.validated.PutGroup; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * @title: RentingHousesApi |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 房屋租赁相关接口 |
| | | * @author: hans |
| | | * @date: 2021/11/24 10:18 |
| | | */ |
| | | @RestController |
| | | @Slf4j |
| | | @Api(tags = {"房屋租赁相关接口"}) |
| | | @RequestMapping("/renting/houses") |
| | | public class RentingHousesApi extends BaseController { |
| | | |
| | | private static final int NOT_COMMUNITY_WORKER = 2; |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | @ApiOperation("新增房源信息") |
| | | @PostMapping("/register") |
| | | public R registerRentingHouse(@RequestBody @Validated(AddGroup.class) RentingHouseRegisterDTO registerDTO) { |
| | | LoginUserInfoVO loginUserInfo = getLoginUserInfo(); |
| | | checkIsCommunityWorker(loginUserInfo); |
| | | registerDTO.setUserId(loginUserInfo.getUserId()); |
| | | registerDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | return communityService.registerRentingHouse(registerDTO); |
| | | } |
| | | |
| | | @ApiOperation("编辑房源信息") |
| | | @PostMapping("/update") |
| | | public R updateRentingHouse(@RequestBody @Validated(PutGroup.class) RentingHouseRegisterDTO registerDTO) { |
| | | LoginUserInfoVO loginUserInfo = getLoginUserInfo(); |
| | | checkIsCommunityWorker(loginUserInfo); |
| | | registerDTO.setUserId(loginUserInfo.getUserId()); |
| | | registerDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | return communityService.updateRentingHouse(registerDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "工作人员-分页获取房源信息", response = RentingHouseRegisterVO.class) |
| | | @PostMapping("/pageAdmin") |
| | | public R pageRentingHouse(@RequestBody @Valid PageRentingHouseRegisterDTO pageRegisterDTO) { |
| | | LoginUserInfoVO loginUserInfo = getLoginUserInfo(); |
| | | pageRegisterDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | return communityService.pageRentingHouse(pageRegisterDTO); |
| | | } |
| | | |
| | | @ApiOperation("发布/取消发布 房源信息") |
| | | @PutMapping("/releaseOrCancel") |
| | | public R releaseOrCancelHouse(@RequestBody @Valid ReleaseOrCancelHouseDTO releaseOrCancelHouseDTO) { |
| | | LoginUserInfoVO loginUserInfo = getLoginUserInfo(); |
| | | checkIsCommunityWorker(loginUserInfo); |
| | | return communityService.releaseOrCancelHouse(releaseOrCancelHouseDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取详情-房源信息", response = RentingHouseRegisterVO.class) |
| | | @GetMapping("/get") |
| | | @ApiImplicitParam(name = "registerId", value = "房源登记id", required = true) |
| | | public R getRentingHouse(@RequestParam("registerId") Long registerId) { |
| | | LoginUserInfoVO loginUserInfoSureNoLogin = getLoginUserInfoSureNoLogin(); |
| | | Integer isLandlord = 2; |
| | | R rentingHouseR = communityService.getRentingHouse(registerId); |
| | | if (R.isOk(rentingHouseR)) { |
| | | RentingHouseRegisterVO houseRegisterVO = JSONObject.parseObject(JSONObject.toJSONString(rentingHouseR.getData()), RentingHouseRegisterVO.class); |
| | | if (Objects.nonNull(loginUserInfoSureNoLogin)) { |
| | | String userId = loginUserInfoSureNoLogin.getUserId().toString(); |
| | | R<LoginUserInfoVO> infoVOR = userService.getUserInfoByUserId(userId); |
| | | if (R.isOk(infoVOR)) { |
| | | LoginUserInfoVO loginUserInfoVO = JSONObject.parseObject(JSONObject.toJSONString(infoVOR.getData()), LoginUserInfoVO.class); |
| | | if (houseRegisterVO.getHourseIdCard().equals(loginUserInfoVO.getIdCard())) { |
| | | isLandlord = 1; |
| | | } |
| | | } |
| | | } |
| | | houseRegisterVO.setIsLandlord(isLandlord); |
| | | return R.ok(houseRegisterVO); |
| | | } |
| | | return rentingHouseR; |
| | | } |
| | | @ApiOperation("房源认证获取eidToken") |
| | | @GetMapping("/getEidToken") |
| | | public R getEidToken(@RequestParam("registerId") Long registerId){ |
| | | R r=communityService.getRentingHouse(registerId); |
| | | if(R.isOk(r)){ |
| | | RentingHouseRegisterVO registerVO=JSONObject.parseObject(JSONObject.toJSONString(r.getData()),RentingHouseRegisterVO.class); |
| | | String result=TencentUtils.getEidToken(registerVO.getHourseOwnerName(),registerVO.getHourseIdCard()); |
| | | return R.ok(result); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | @ApiOperation("房源认证") |
| | | @GetMapping("/auth") |
| | | public R authHouse(@RequestParam("registerId") Long registerId,@RequestParam("result")String result){ |
| | | R r=communityService.getRentingHouse(registerId); |
| | | if(R.isOk(r)){ |
| | | String response=TencentUtils.getEidResult(result); |
| | | JSONObject object = JSON.parseObject(response); |
| | | if (object == null) { |
| | | return R.fail("核验失败"); |
| | | } |
| | | JSONObject textObject = object.getJSONObject("Text"); |
| | | |
| | | String code = textObject.getString("ErrCode"); |
| | | if (!code.equals("0")) { |
| | | log.error("人脸核验失败,错误原因:" + textObject.toJSONString()); |
| | | return R.fail("核验失败"); |
| | | } |
| | | RentingHouseRegisterDTO registerDTO=new RentingHouseRegisterDTO(); |
| | | registerDTO.setId(registerId); |
| | | registerDTO.setAuthStatus(2); |
| | | registerDTO.setDetailStatus(2); |
| | | registerDTO.setHourseOwnerUserId(getUserId()); |
| | | return communityService.updateRentingHouse(registerDTO); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | /** |
| | | * 附近的房源 |
| | | */ |
| | | @ApiOperation(value = "附近的房源",response =RentingHouseRegisterVO.class) |
| | | @PostMapping("/nearby") |
| | | public R nearby(@RequestBody NearbyDTO nearbyDTO){ |
| | | LoginUserInfoVO loginUserInfoSureNoLogin = getLoginUserInfoSureNoLogin(); |
| | | if (Objects.nonNull(loginUserInfoSureNoLogin)) { |
| | | nearbyDTO.setCommunityId(loginUserInfoSureNoLogin.getCommunityId()); |
| | | } |
| | | return communityService.nearby(nearbyDTO); |
| | | } |
| | | |
| | | /** |
| | | * 小程序分页获取房源信息 |
| | | * @param pageRegisterDTO |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "小程序分页获取房源信息",response =RentingHouseRegisterVO.class) |
| | | @PostMapping("/houseList") |
| | | public R pageRentingHouseApplet(@RequestBody PageRentingHouseRegisterDTO pageRegisterDTO) { |
| | | Integer isMy = pageRegisterDTO.getIsMy(); |
| | | if (Objects.nonNull(isMy) && isMy.intValue() == 1) { |
| | | pageRegisterDTO.setCurrentUserId(getUserId()); |
| | | } |
| | | return communityService.pageRentingHouseApplet(pageRegisterDTO); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "获取房屋租赁配置",response = RentingHousesConfigVO.class) |
| | | @GetMapping("/getConfig") |
| | | @ApiImplicitParam(name = "type", value = "配置类型(1.房屋租赁合同 2.租赁合同变更协议 3.定金协议 4.房屋委托代理合同" + |
| | | "5.平台须知 6.房源标签)", required = true) |
| | | public R getRentingHouseConfig(@RequestParam("type") Integer type) { |
| | | return communityService.getRentingHouseConfig(type); |
| | | } |
| | | |
| | | @ApiOperation("删除房源信息") |
| | | @DeleteMapping("/delete") |
| | | @ApiImplicitParam(name = "registerId", value = "房源登记id", required = true) |
| | | public R deleteRentingHouse(@RequestParam("registerId") Long registerId) { |
| | | LoginUserInfoVO loginUserInfo = getLoginUserInfo(); |
| | | checkIsCommunityWorker(loginUserInfo); |
| | | return communityService.deleteRentingHouse(registerId); |
| | | } |
| | | |
| | | private void checkIsCommunityWorker(LoginUserInfoVO loginUserInfo) { |
| | | if (loginUserInfo.getIsCommunityWorker().intValue() == NOT_COMMUNITY_WORKER) { |
| | | throw new ServiceException("401", "暂无权限"); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import java.util.List; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.applets.config.WxMaProperties; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.shop.*; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.shop.*; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-14 15:02:49 |
| | | * @describe 商城模块API |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/shop/") |
| | | @Api(tags = {"商城服务"}) |
| | | public class ShopApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | @Resource |
| | | private WxMaProperties properties; |
| | | |
| | | @ApiOperation(value = "分页查询店铺", response = PageShopStoreVO.class) |
| | | @PostMapping("pageshopstore") |
| | | public R pageShopStore(@RequestBody PageComShopStoreDTO comShopStoreDTO) { |
| | | PageComShopSysConfDTO pageComShopSysConfDTO = new PageComShopSysConfDTO(); |
| | | R conf = communityService.pageShopSysConf(pageComShopSysConfDTO); |
| | | if (R.isOk(conf) && conf.getData() != null) { |
| | | ComShopSysConfVO comShopSysConfVO = |
| | | JSONObject.parseObject(JSONObject.toJSONString(conf.getData()), ComShopSysConfVO.class); |
| | | if ("1".equals(comShopSysConfVO.getVal()) && "1".equals(comShopSysConfVO.getEnabled())) { |
| | | return R.ok(); |
| | | } |
| | | } |
| | | return communityService.pageShopStore(comShopStoreDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询店铺详情", response = PageShopStoreVO.class) |
| | | @PostMapping("shopstoredetail") |
| | | public R shopStoreDetail(@RequestBody PageComShopStoreDTO comShopStoreDTO) { |
| | | if (comShopStoreDTO == null || comShopStoreDTO.getStoreId() == null) { |
| | | return R.fail("参数错误"); |
| | | } |
| | | return communityService.shopStoreDetail(comShopStoreDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询商品列表", response = ComShopGoodsVO.class) |
| | | @PostMapping("pageShopGoods") |
| | | public R pageShopGoods(@RequestBody ComShopGoodsDTO comShopGoodsDTO) { |
| | | return communityService.pageShopGoods(comShopGoodsDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询商品详情", response = ComShopGoodsVO.class) |
| | | @PostMapping("shopGoodsDetail") |
| | | @ApiImplicitParam(name = "goodsId", value = "商品id", required = true) |
| | | public R shopGoodsDetail(@RequestParam("goodsId") Long goodsId) { |
| | | return communityService.shopGoodsDetail(goodsId); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询用户购物车列表", response = ComShopCartVO.class) |
| | | @PostMapping("shopCartList") |
| | | public R shopCartList() { |
| | | Long userId = this.getUserId(); |
| | | if (userId == null) { |
| | | return R.fail("请重新登陆"); |
| | | } |
| | | return communityService.shopCartList(userId); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询用户购物车商品数量") |
| | | @PostMapping("shopCartUserTotal") |
| | | public R shopCartUserTotal() { |
| | | Long userId = this.getUserId(); |
| | | if (userId == null) { |
| | | return R.fail("请重新登陆"); |
| | | } |
| | | PageComShopSysConfDTO pageComShopSysConfDTO = new PageComShopSysConfDTO(); |
| | | R conf = communityService.pageShopSysConf(pageComShopSysConfDTO); |
| | | if (R.isOk(conf) && conf.getData() != null) { |
| | | ComShopSysConfVO comShopSysConfVO = |
| | | JSONObject.parseObject(JSONObject.toJSONString(conf.getData()), ComShopSysConfVO.class); |
| | | if ("1".equals(comShopSysConfVO.getVal()) && "1".equals(comShopSysConfVO.getEnabled())) { |
| | | return R.ok(0); |
| | | } |
| | | } |
| | | return communityService.shopCartUserTotal(userId); |
| | | } |
| | | |
| | | @ApiOperation(value = "购物车添加") |
| | | @PostMapping("shopAddCart") |
| | | public R shopAddCart(@RequestBody ComShopCartDTO comShopCartDTO) { |
| | | Long userId = this.getUserId(); |
| | | if (userId == null) { |
| | | return R.fail("请重新登陆"); |
| | | } |
| | | comShopCartDTO.setUserId(userId); |
| | | return communityService.shopAddCart(comShopCartDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "购物车修改") |
| | | @PostMapping("shopEditNubCart") |
| | | public R shopEditNubCart(@RequestBody ComShopEditNubCartDTO shopEditNubCartDTO) { |
| | | return communityService.shopEditNubCart(shopEditNubCartDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "购物车删除") |
| | | @PostMapping("shopDelCart") |
| | | public R shopDelCart(@RequestBody List<Long> Ids) { |
| | | return communityService.shopDelCart(Ids); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询用户收货地址列表", response = ComShopUserAddressVO.class) |
| | | @PostMapping("shopUserAddressList") |
| | | public R shopUserAddressList(@RequestBody PageComShopAddressDTO comShopAddressDTO) { |
| | | Long userId = this.getUserId(); |
| | | if (userId == null) { |
| | | return R.fail("请重新登陆"); |
| | | } |
| | | comShopAddressDTO.setUserId(userId); |
| | | return communityService.shopUserAddressList(comShopAddressDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "添加用户收货地址列表") |
| | | @PostMapping("shopAddUserAddress") |
| | | public R shopAddUserAddress(@RequestBody ComShopAddressDTO comShopAddressDTO) { |
| | | Long userId = this.getUserId(); |
| | | if (userId == null) { |
| | | return R.fail("请重新登陆"); |
| | | } |
| | | comShopAddressDTO.setUserId(userId); |
| | | return communityService.shopAddUserAddress(comShopAddressDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "修改用户收货地址列表") |
| | | @PostMapping("shopEditUserAddress") |
| | | public R shopEditUserAddress(@RequestBody ComShopAddressDTO comShopAddressDTO) { |
| | | Long userId = this.getUserId(); |
| | | if (userId == null) { |
| | | return R.fail("请重新登陆"); |
| | | } |
| | | comShopAddressDTO.setUserId(userId); |
| | | return communityService.shopEditUserAddress(comShopAddressDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除用户收货地址列表") |
| | | @PostMapping("shopDelUserAddress") |
| | | @ApiImplicitParam(name = "addressId", value = "收货地址id", required = true) |
| | | public R shopDelUserAddress(@RequestParam("addressId") Long addressId) { |
| | | return communityService.shopDelUserAddress(addressId); |
| | | } |
| | | |
| | | @ApiOperation(value = "订单预览", response = ComShopOrderPreviewVO.class) |
| | | @PostMapping("orderPreview") |
| | | public R orderPreview(@RequestBody ComShopOrderPreviewDTO orderPreviewDTO) { |
| | | Long userId = this.getUserId(); |
| | | if (userId == null) { |
| | | return R.fail("请重新登陆"); |
| | | } |
| | | orderPreviewDTO.setUserId(userId); |
| | | return communityService.orderPreview(orderPreviewDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "创建订单", response = ComShopOrderVO.class) |
| | | @PostMapping("orderCreate") |
| | | public R orderCreate(@RequestBody ComShopOrderCreateDTO orderCreateDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if (loginUserInfo == null) { |
| | | return R.fail("请重新登陆"); |
| | | } |
| | | orderCreateDTO.setUserId(loginUserInfo.getUserId()); |
| | | orderCreateDTO.setPhone(loginUserInfo.getPhone()); |
| | | orderCreateDTO.setOpenId(loginUserInfo.getOpenid()); |
| | | return communityService.orderCreate(orderCreateDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询订单列表", response = ComShopOrderPageVO.class) |
| | | @PostMapping("pageOrderList") |
| | | public R pageOrderList(@RequestBody PageComOrderListDTO comOrderListDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if (loginUserInfo == null) { |
| | | return R.fail("请重新登陆"); |
| | | } |
| | | comOrderListDTO.setUserId(loginUserInfo.getUserId()); |
| | | return communityService.pageOrderList(comOrderListDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询订单详情", response = ComShopOrderPageVO.class) |
| | | @PostMapping("orderDetail") |
| | | @ApiImplicitParam(name = "orderId", value = "订单id", required = true) |
| | | public R orderDetail(@RequestParam("orderId") Long orderId) { |
| | | return communityService.orderDetail(orderId); |
| | | } |
| | | |
| | | @ApiOperation(value = "取消订单") |
| | | @PostMapping("orderCancel") |
| | | public R orderCancel(@RequestBody ComShopOrderQueryDTO comShopOrderQueryDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if (loginUserInfo == null) { |
| | | return R.fail("请重新登陆"); |
| | | } |
| | | return communityService.orderCancel(comShopOrderQueryDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除订单") |
| | | @PostMapping("orderDelete") |
| | | @ApiImplicitParam(name = "orderId", value = "订单id", required = true) |
| | | public R orderDelete(@RequestParam("orderId") Long orderId) { |
| | | return communityService.orderDelete(orderId); |
| | | } |
| | | |
| | | @ApiOperation(value = "订单确认收货") |
| | | @PostMapping("orderConfirm") |
| | | public R orderConfirm(@RequestBody ComShopOrderQueryDTO comShopOrderQueryDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if (loginUserInfo == null) { |
| | | return R.fail("请重新登陆"); |
| | | } |
| | | return communityService.orderConfirm(comShopOrderQueryDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "统计当前用户订单", response = OrderStatisticsVO.class) |
| | | @PostMapping("orderStatistics") |
| | | public R orderStatistics() { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if (loginUserInfo == null) { |
| | | return R.fail("请重新登陆"); |
| | | } |
| | | return communityService.orderStatistics(loginUserInfo.getUserId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "小程序微信调起支付") |
| | | @PostMapping("wxpay") |
| | | public R wxPay(@RequestBody OrderPayDTO orderPayDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if (loginUserInfo == null) { |
| | | return R.fail("请重新登陆"); |
| | | } |
| | | orderPayDTO.setOpenId(loginUserInfo.getOpenid()); |
| | | return communityService.wxPay(orderPayDTO); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.panzhihua.applets.weixin.CheckService; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.convenient.ConvenientMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.PageConvenientServiceCategoryDTO; |
| | | import com.panzhihua.common.model.dtos.shop.*; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.convenient.ConvenientElevatingPointOrderVO; |
| | | import com.panzhihua.common.model.vos.community.convenient.ConvenientElevatingPointVO; |
| | | import com.panzhihua.common.model.vos.community.convenient.ConvenientMerchantVO; |
| | | import com.panzhihua.common.model.vos.community.convenient.ConvenientServiceCategoryVO; |
| | | import com.panzhihua.common.model.vos.shop.*; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | import com.panzhihua.common.validated.PutGroup; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @auther yh |
| | | * @create 2022-11-08 17:25:45 |
| | | * @describe 商城模块API |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/shopFlower/") |
| | | @Api(tags = {"花城商城服务"}) |
| | | public class ShopFlowerApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | @Resource |
| | | private CheckService checkService; |
| | | |
| | | |
| | | @ApiOperation(value = "查询便民服务商家详情", response = ConvenientMerchantVO.class) |
| | | @GetMapping("/merchant/getMerchantByUserId") |
| | | public R getMerchant(@RequestParam("userId") Long userId) { |
| | | return communityService.getMerchantByUserId(userId); |
| | | } |
| | | |
| | | @ApiOperation(value = "编辑便民服务商家") |
| | | @PutMapping("/merchant/put") |
| | | public R putMerchant(@RequestBody @Validated(PutGroup.class) ConvenientMerchantDTO convenientMerchantDTO) { |
| | | convenientMerchantDTO.setUpdatedBy(this.getUserId()); |
| | | return communityService.putMerchant(convenientMerchantDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询商品列表", response = ComShopFlowerGoodsVO.class) |
| | | @PostMapping("pageShopGoods") |
| | | public R pageShopGoods(@RequestBody ComShopFlowerGoodsDTO comShopGoodsDTO) { |
| | | return communityService.pageShopFlowerGoodsByApp(comShopGoodsDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询商品详情", response = ComShopFlowerGoodsVO.class) |
| | | @GetMapping("shopGoodsDetail") |
| | | @ApiImplicitParam(name = "goodsId", value = "商品id", required = true) |
| | | public R shopGoodsDetail(@RequestParam("goodsId") Long goodsId) { |
| | | return communityService.shopFlowerGoodsDetail(goodsId); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除商品") |
| | | @DeleteMapping("/goods/delete") |
| | | public R deleteShopGoods(@RequestParam("goodsId") Long goodsId) { |
| | | return communityService.deleteFlowerShopGoods(goodsId); |
| | | } |
| | | |
| | | @ApiOperation(value = "商品上下架") |
| | | @ApiImplicitParams({@ApiImplicitParam(name = "id", value = "商品Id"), |
| | | @ApiImplicitParam(name = "status", value = "1.上架 2.下架 ")}) |
| | | @GetMapping("/goods/changeStatus") |
| | | public R changeStatus(@RequestParam("id") Long id, @RequestParam("status") Integer status) { |
| | | return communityService.changeFlowerStatus(id, status); |
| | | } |
| | | |
| | | @ApiOperation(value = "编辑商品") |
| | | @PostMapping("/goods/edit/{id}") |
| | | public R editShopGoods(@PathVariable("id") Long id, |
| | | @RequestBody @Validated(AddGroup.class) AddShopFlowerGoodsVO addShopGoodsVO) { |
| | | return communityService.editFlowerShopGoods(id, addShopGoodsVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增商品") |
| | | @PostMapping("/goods/save") |
| | | public R saveShopGoods(@RequestBody @Validated(AddGroup.class) AddShopFlowerGoodsVO addShopGoodsVO) { |
| | | return communityService.saveFlowerShopGoods(addShopGoodsVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询用户收货地址列表", response = ComShopUserAddressVO.class) |
| | | @PostMapping("shopUserAddressList") |
| | | public R shopUserAddressList(@RequestBody PageComShopAddressDTO comShopAddressDTO) { |
| | | Long userId = this.getUserId(); |
| | | if (userId == null) { |
| | | return R.fail("请重新登陆"); |
| | | } |
| | | comShopAddressDTO.setUserId(userId); |
| | | return communityService.shopFlowerUserAddressList(comShopAddressDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "添加用户收货地址列表") |
| | | @PostMapping("shopAddUserAddress") |
| | | public R shopAddUserAddress(@RequestBody ComShopAddressDTO comShopAddressDTO) { |
| | | Long userId = this.getUserId(); |
| | | if (userId == null) { |
| | | return R.fail("请重新登陆"); |
| | | } |
| | | comShopAddressDTO.setUserId(userId); |
| | | return communityService.shopFlowerAddUserAddress(comShopAddressDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "修改用户收货地址列表") |
| | | @PostMapping("shopEditUserAddress") |
| | | public R shopEditUserAddress(@RequestBody ComShopAddressDTO comShopAddressDTO) { |
| | | Long userId = this.getUserId(); |
| | | if (userId == null) { |
| | | return R.fail("请重新登陆"); |
| | | } |
| | | comShopAddressDTO.setUserId(userId); |
| | | return communityService.shopFlowerEditUserAddress(comShopAddressDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除用户收货地址列表") |
| | | @DeleteMapping("shopDelUserAddress") |
| | | @ApiImplicitParam(name = "addressId", value = "收货地址id", required = true) |
| | | public R shopDelUserAddress(@RequestParam("addressId") Long addressId) { |
| | | return communityService.shopFlowerDelUserAddress(addressId); |
| | | } |
| | | |
| | | @ApiOperation(value = "订单预览", response = ComShopOrderPreviewVO.class) |
| | | @PostMapping("orderPreview") |
| | | public R orderPreview(@RequestBody ComShopOrderPreviewDTO orderPreviewDTO) { |
| | | Long userId = this.getUserId(); |
| | | if (userId == null) { |
| | | return R.fail("请重新登陆"); |
| | | } |
| | | orderPreviewDTO.setUserId(userId); |
| | | return communityService.orderPreviewFlower(orderPreviewDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "创建订单", response = ComShopOrderVO.class) |
| | | @PostMapping("orderCreate") |
| | | public R orderCreate(@RequestBody ComShopOrderCreateDTO orderCreateDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if (loginUserInfo == null) { |
| | | return R.fail("请重新登陆"); |
| | | } |
| | | orderCreateDTO.setUserId(loginUserInfo.getUserId()); |
| | | orderCreateDTO.setPhone(loginUserInfo.getPhone()); |
| | | orderCreateDTO.setOpenId(loginUserInfo.getOpenid()); |
| | | return communityService.orderCreateFlower(orderCreateDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询订单列表", response = ComShopFlowerOrderPageVO.class) |
| | | @PostMapping("pageOrderList") |
| | | public R pageOrderList(@RequestBody PageComFlowerOrderListDTO comOrderListDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if (loginUserInfo == null) { |
| | | return R.fail("请重新登陆"); |
| | | } |
| | | comOrderListDTO.setUserId(loginUserInfo.getUserId()); |
| | | return communityService.pageOrderListFlower(comOrderListDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询订单详情", response = ComShopFlowerOrderPageVO.class) |
| | | @GetMapping("orderDetail") |
| | | @ApiImplicitParam(name = "orderId", value = "订单id", required = true) |
| | | public R orderDetail(@RequestParam("orderId") Long orderId) { |
| | | return communityService.orderDetailFlower(orderId,null); |
| | | } |
| | | |
| | | @ApiOperation(value = "自提点查询订单详情", response = ComShopFlowerOrderPageVO.class) |
| | | @GetMapping("pointOrderDetail") |
| | | @ApiImplicitParam(name = "orderId", value = "订单id", required = true) |
| | | public R pointOrderDetail(@RequestParam("orderId") Long orderId) { |
| | | String phone = this.getLoginUserInfo().getPhone(); |
| | | return communityService.orderDetailFlower(orderId,phone); |
| | | } |
| | | |
| | | @ApiOperation(value = "取消订单") |
| | | @PostMapping("orderCancel") |
| | | public R orderCancel(@RequestBody ComShopOrderQueryDTO comShopOrderQueryDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if (loginUserInfo == null) { |
| | | return R.fail("请重新登陆"); |
| | | } |
| | | return communityService.orderCancelFlower(comShopOrderQueryDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除订单") |
| | | @DeleteMapping("orderDelete") |
| | | @ApiImplicitParam(name = "orderId", value = "订单id", required = true) |
| | | public R orderDelete(@RequestParam("orderId") Long orderId) { |
| | | return communityService.orderDeleteFlower(orderId); |
| | | } |
| | | |
| | | @ApiOperation(value = "订单确认收货") |
| | | @PostMapping("orderConfirm") |
| | | public R orderConfirm(@RequestBody ComShopOrderQueryDTO comShopOrderQueryDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if (loginUserInfo == null) { |
| | | return R.fail("请重新登陆"); |
| | | } |
| | | return communityService.orderConfirmFlower(comShopOrderQueryDTO); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "小程序微信调起支付") |
| | | @PostMapping("wxpay") |
| | | public R wxPay(@RequestBody OrderPayDTO orderPayDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if (loginUserInfo == null) { |
| | | return R.fail("请重新登陆"); |
| | | } |
| | | orderPayDTO.setOpenId(loginUserInfo.getOpenid()); |
| | | return communityService.wxPayFlower(orderPayDTO); |
| | | } |
| | | |
| | | /** |
| | | * 获取当前商铺周围的自提点信息以及距离手机距离 |
| | | * |
| | | * @param merchantId |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取自提点",response = ConvenientElevatingPointVO.class) |
| | | @ApiImplicitParams({@ApiImplicitParam(name = "merchantId", value = "商家Id", required = true), |
| | | @ApiImplicitParam(name = "lat", value = "经度", required = true), @ApiImplicitParam(name = "lng", value = "纬度", required = true)}) |
| | | @GetMapping("/point/findPointByMerchantId") |
| | | public R findPointByMerchantId(@RequestParam("merchantId") Long merchantId, @RequestParam("lat") String lat, @RequestParam("lng") String lng) { |
| | | return communityService.findPointByMerchantId(merchantId, lat, lng); |
| | | } |
| | | /** |
| | | * 获取商家周围 n(km)的自提点数量 |
| | | * |
| | | * @param distance |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取商家周围 n(km)的自提点数量") |
| | | @ApiImplicitParams({@ApiImplicitParam(name = "distance", value = "距离", required = false), |
| | | @ApiImplicitParam(name = "lat", value = "经度", required = true), @ApiImplicitParam(name = "lng", value = "纬度", required = true)}) |
| | | @GetMapping("/point/findPointNumByDistance") |
| | | public R findPointNumByDistance(@RequestParam(value = "distance",required = false) Integer distance, @RequestParam("lat") String lat, @RequestParam("lng") String lng) { |
| | | if (null == distance){ |
| | | return R.ok(0); |
| | | } |
| | | return communityService.findPointNumByDistance(distance, lat, lng); |
| | | } |
| | | |
| | | /** |
| | | * 保存评价 |
| | | * |
| | | * @param comShopFlowerEvaluateDTO |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "保存评价") |
| | | @PostMapping("/saveEvaluate") |
| | | public R saveEvaluate(@RequestBody ComShopFlowerEvaluateDTO comShopFlowerEvaluateDTO) { |
| | | String evaluateContent = comShopFlowerEvaluateDTO.getEvaluateContent(); |
| | | if (StrUtil.isNotBlank(evaluateContent)) { |
| | | String result = checkService.checkMessageBy(evaluateContent, this.getLoginUserInfo().getOpenid(), this.getAppId()); |
| | | if (StrUtil.isNotBlank(result)) { |
| | | return R.fail(501, "填写内容存在 " + result + " 违规信息"); |
| | | } |
| | | } |
| | | comShopFlowerEvaluateDTO.setUserId(this.getUserId()); |
| | | return communityService.saveEvaluate(comShopFlowerEvaluateDTO); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询评价 |
| | | * |
| | | * @param pageComShopFlowerEvaluateDTO |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "分页查询评价", response = ComShopFlowerEvaluateVO.class) |
| | | @PostMapping("/pageEvaluate") |
| | | public R pageEvaluate(@RequestBody PageComShopFlowerEvaluateDTO pageComShopFlowerEvaluateDTO) { |
| | | return communityService.pageEvaluate(pageComShopFlowerEvaluateDTO); |
| | | } |
| | | |
| | | /** |
| | | * 评价详情 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "评价详情") |
| | | @GetMapping("/detailEvaluate") |
| | | public R detailEvaluate(@RequestParam("id") Long id) { |
| | | return communityService.detailEvaluate(id); |
| | | } |
| | | |
| | | /** |
| | | * 删除评价 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "删除评价") |
| | | @DeleteMapping("deleteEvaluate") |
| | | public R deleteEvaluate(@RequestParam("id") Long id) { |
| | | return communityService.deleteEvaluate(id); |
| | | } |
| | | |
| | | /** |
| | | * 取货码 |
| | | * |
| | | * @param orderId |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "取货码") |
| | | @GetMapping("getQRCode") |
| | | @ApiImplicitParam(name = "orderId", value = "订单id", required = true) |
| | | public R getQRCode(@RequestParam("orderId") Long orderId) { |
| | | return communityService.getQRCode(orderId); |
| | | } |
| | | |
| | | /** |
| | | * 保存配送单 |
| | | * |
| | | * @param comShopFlowerOrderDeliveryDTO |
| | | */ |
| | | @PostMapping("saveDelivery") |
| | | @ApiOperation(value = "保存配送单") |
| | | public R saveDelivery(@RequestBody ComShopFlowerOrderDeliveryDTO comShopFlowerOrderDeliveryDTO) { |
| | | return communityService.saveDelivery(comShopFlowerOrderDeliveryDTO); |
| | | } |
| | | |
| | | /** |
| | | * 更新配送单 |
| | | * |
| | | * @param comShopFlowerOrderDeliveryDTO |
| | | */ |
| | | @PostMapping("updateDelivery") |
| | | @ApiOperation(value = "更新配送单") |
| | | public R updateDelivery(@RequestBody ComShopFlowerOrderDeliveryDTO comShopFlowerOrderDeliveryDTO) { |
| | | return communityService.updateDelivery(comShopFlowerOrderDeliveryDTO); |
| | | } |
| | | |
| | | /** |
| | | * 已配送、已送达 分页查询 |
| | | * |
| | | * @param pageComFlowerOrderDeliveryDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("pageDelivery") |
| | | @ApiOperation(value = "已配送、已送达 分页查询", response = ComShopFlowerOrderDeliveryVO.class) |
| | | public R pageDelivery(@RequestBody PageComFlowerOrderDeliveryDTO pageComFlowerOrderDeliveryDTO) { |
| | | return communityService.pageDelivery(pageComFlowerOrderDeliveryDTO); |
| | | } |
| | | |
| | | /** |
| | | * 未配送 分页查询 |
| | | * |
| | | * @param pageComFlowerOrderDeliveryDTO |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "未配送 分页查询", response = ConvenientElevatingPointVO.class) |
| | | @PostMapping("pageNoDelivery") |
| | | public R pageNoDelivery(@RequestBody PageComFlowerOrderDeliveryDTO pageComFlowerOrderDeliveryDTO) { |
| | | return communityService.pageNoDelivery(pageComFlowerOrderDeliveryDTO); |
| | | } |
| | | |
| | | /** |
| | | * 未配送-开始配送-订单列表 |
| | | * |
| | | * @param pageComFlowerOrderListDTO |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "未配送-开始配送-订单列表", response = ConvenientElevatingPointOrderVO.class) |
| | | @PostMapping("pageNoDeliveryOrderList") |
| | | public R pageNoDeliveryOrderList(@RequestBody PageComFlowerOrderListDTO pageComFlowerOrderListDTO) { |
| | | return communityService.pageNoDeliveryOrderList(pageComFlowerOrderListDTO); |
| | | } |
| | | |
| | | /** |
| | | * 根据商家id查询商家的订单 |
| | | * |
| | | * @param pageComFlowerOrderListDTO |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "根据商家id分页查询商家的订单", response = ComShopFlowerOrderStoreListVO.class) |
| | | @PostMapping("pageOrderByStoreId") |
| | | public R pageOrderByStoreId(@RequestBody PageComFlowerOrderListDTO pageComFlowerOrderListDTO) { |
| | | return communityService.pageOrderByStoreId(pageComFlowerOrderListDTO); |
| | | } |
| | | |
| | | /** |
| | | * 查询我的店铺各类统计数据 |
| | | * |
| | | * @param storeId |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "查询我的店铺各类统计数据") |
| | | @GetMapping("/selectCountByStoreId") |
| | | public R selectCountByUserId(Long storeId) { |
| | | return communityService.selectCountByUserId(storeId); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 创建退款订单 |
| | | * |
| | | * @param comShopFlowerRefundOrderDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("createRefundOrder") |
| | | @ApiOperation(value = "创建退款订单") |
| | | public R createRefundOrder(@RequestBody ComShopFlowerRefundOrderDTO comShopFlowerRefundOrderDTO) { |
| | | comShopFlowerRefundOrderDTO.setUserId(this.getUserId()); |
| | | return communityService.createRefundOrder(comShopFlowerRefundOrderDTO); |
| | | } |
| | | |
| | | /** |
| | | * 用户 分页查询退款订单 |
| | | * |
| | | * @param pageComOrderRefundDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("pageRefundOrder") |
| | | @ApiOperation(value = "退款订单分页查询 用户", response = ComShopFlowerRefundOrderVO.class) |
| | | public R pageRefundOrder(@RequestBody PageComOrderRefundDTO pageComOrderRefundDTO) { |
| | | pageComOrderRefundDTO.setUserId(this.getUserId()); |
| | | return communityService.pageRefundOrder(pageComOrderRefundDTO); |
| | | } |
| | | |
| | | /** |
| | | * 商家 分页查询退款订单 |
| | | * |
| | | * @param pageComOrderRefundDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("pageRefundOrderStore") |
| | | @ApiOperation(value = "退款订单分页查询 商家", response = ComShopFlowerRefundOrderVO.class) |
| | | public R pageRefundOrderStore(@RequestBody PageComOrderRefundDTO pageComOrderRefundDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | pageComOrderRefundDTO.setStoreId(loginUserInfo.getStoreIdId()); |
| | | return communityService.pageRefundOrder(pageComOrderRefundDTO); |
| | | } |
| | | |
| | | /** |
| | | * 修改退款订单 |
| | | * |
| | | * @param comShopFlowerRefundOrderDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("updateRefundOrder") |
| | | @ApiOperation(value = "修改退款订单") |
| | | public R updateRefundOrder(@RequestBody ComShopFlowerRefundOrderDTO comShopFlowerRefundOrderDTO) { |
| | | return communityService.updateRefundOrder(comShopFlowerRefundOrderDTO); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 商家后台-退款申请统计 |
| | | * |
| | | * @param storeId |
| | | * @return |
| | | */ |
| | | @GetMapping("selectCountGroupStatus") |
| | | @ApiOperation(value = "商家后台-退款申请统计") |
| | | public R selectCountGroupStatus(Long storeId) { |
| | | return communityService.selectCountGroupStatus(storeId); |
| | | } |
| | | |
| | | @ApiOperation(value = "商品分类") |
| | | @GetMapping("/goodsCategory/getAllGoodsCategories") |
| | | public R getAllGoodsCategories() { |
| | | return communityService.getAllGoodsCategories(); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询便民服务分类", response = ConvenientServiceCategoryVO.class) |
| | | @PostMapping("/service-category/page") |
| | | public R pageServiceCategory(@RequestBody PageConvenientServiceCategoryDTO pageConvenientServiceCategoryDTO) { |
| | | pageConvenientServiceCategoryDTO.setAreaCode(this.getAreaCode()); |
| | | return communityService.pageServiceCategory(pageConvenientServiceCategoryDTO); |
| | | } |
| | | |
| | | /** |
| | | * 新增商品浏览量 |
| | | * |
| | | * @param goodsId |
| | | * @return |
| | | */ |
| | | @GetMapping("incrGoodsView") |
| | | @ApiOperation(value = "新增商品浏览量") |
| | | public R incrGoodsView(@RequestParam("goodsId") Long goodsId) { |
| | | return communityService.incrGoodsView(goodsId); |
| | | } |
| | | |
| | | @ApiOperation(value = "增加商家咨询量") |
| | | @GetMapping("/merchant/incr-consult") |
| | | public R incrMerchantConsult(@RequestParam("merchantId") Long merchantId) { |
| | | return communityService.consultMerchant(merchantId); |
| | | } |
| | | |
| | | @ApiOperation(value = "增加商家浏览量") |
| | | @GetMapping("/merchant/incr-view") |
| | | public R incrMerchantView(@RequestParam("merchantId") Long merchantId) { |
| | | return communityService.incrMerchantView(merchantId); |
| | | } |
| | | |
| | | @ApiOperation(value = "出入账分页", response = ComShopFlowerOrderPayVO.class) |
| | | @PostMapping("pageOrderPay") |
| | | public R pageOrderPay(@RequestBody PageComShopFlowerOrderPayDTO pageComShopFlowerOrderPayDTO) { |
| | | return communityService.pageOrderPay(pageComShopFlowerOrderPayDTO); |
| | | } |
| | | |
| | | /** |
| | | * 获取商家的营业额和可结算金额 |
| | | * @param storeId |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取商家的营业额和可结算金额") |
| | | @GetMapping("getQuota") |
| | | public R getQuota(@RequestParam("storeId") Long storeId){ |
| | | return communityService.getQuota(storeId); |
| | | } |
| | | |
| | | /** |
| | | * 取消退款 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "取消退款") |
| | | @GetMapping("refundOrderCancel") |
| | | public R refundOrderCancel(@RequestParam("id") Long id){ |
| | | return communityService.refundOrderCancel(id); |
| | | } |
| | | |
| | | /** |
| | | * 退款订单详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "退款订单详情",response = ComShopFlowerRefundOrderVO.class) |
| | | @GetMapping("refundOrderDetail") |
| | | public R refundOrderDetail(Long id){ |
| | | return communityService.refundOrderDetail(id); |
| | | } |
| | | |
| | | /** |
| | | * 清点商品 确认送达详情 |
| | | * @param pageComFlowerOrderListDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("pageOrderByDeliveryNo") |
| | | @ApiOperation(value = "清点商品 确认送达详情",response = ComShopFlowerOrderDeliveryNoListVO.class) |
| | | public R pageOrderByDeliveryNo(@RequestBody PageComFlowerOrderListDTO pageComFlowerOrderListDTO){ |
| | | return communityService.pageOrderByDeliveryNo(pageComFlowerOrderListDTO); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 订单发货 |
| | | * |
| | | * @param orderShipDTO 发货信息 |
| | | * @return 发货结果 |
| | | */ |
| | | @PostMapping("/shipOrderFlower") |
| | | @ApiOperation(value = "订单发货") |
| | | public R shipOrderFlower(@RequestBody ComShopOrderShipDTO orderShipDTO) { |
| | | orderShipDTO.setOperUserAccount(this.getLoginUserInfo().getAccount()); |
| | | return communityService.shipOrderFlower(orderShipDTO); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: 调试接口 |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2021-01-06 16:32 |
| | | **/ |
| | | @RestController |
| | | @RequestMapping("/test/") |
| | | @Api(tags = {"调试接口"}) |
| | | public class TestApi { |
| | | |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | @ApiOperation(value = "维护用户持续登录天数") |
| | | @GetMapping("timedtaskcontinuouslandingdays") |
| | | public R timedTaskContinuousLandingDays() { |
| | | return userService.timedTaskContinuousLandingDays(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.equipment.UnionInspectionDto; |
| | | import com.panzhihua.common.model.dtos.equipment.UnionReportDto; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.service.community.ComEquipmentUnionInspectionFeign; |
| | | import com.panzhihua.common.service.community.ComEquipmentUnionRePortFeign; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import io.swagger.annotations.Api; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/unionInspection/") |
| | | @Api(tags = {"户外劳工站巡查"}) |
| | | public class UnionInspectionApi extends BaseController { |
| | | |
| | | @Resource |
| | | private ComEquipmentUnionInspectionFeign comEquipmentUnionInspectionFeign; |
| | | |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | |
| | | /** |
| | | * 新增户外劳工站巡查 |
| | | * |
| | | * @param unionInspectionDto |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/add") |
| | | public R add(@RequestBody UnionInspectionDto unionInspectionDto) { |
| | | // LoginUserInfoVO loginUser = this.getLoginUserInfo(); |
| | | // LoginUserInfoVO userInfoByUserId = userService.getUserInfoByUserId(loginUser.getUserId().toString()).getData(); |
| | | LoginUserInfoVO userInfoByUserId = userService.getUserInfoByUserId("1588095866109984769").getData(); |
| | | unionInspectionDto.setCreateUserId(userInfoByUserId.getUserId()); |
| | | return comEquipmentUnionInspectionFeign.add(unionInspectionDto); |
| | | } |
| | | |
| | | /** |
| | | * 分页户外劳工站巡查 |
| | | * |
| | | * @param unionInspectionDto |
| | | * @return 动态结果 |
| | | */ |
| | | @PostMapping("/query") |
| | | public R query(@RequestBody UnionInspectionDto unionInspectionDto) { |
| | | // LoginUserInfoVO loginUser = this.getLoginUserInfo(); |
| | | // LoginUserInfoVO userInfoByUserId = userService.getUserInfoByUserId(loginUser.getUserId().toString()).getData(); |
| | | LoginUserInfoVO userInfoByUserId = userService.getUserInfoByUserId("1588095866109984769").getData(); |
| | | unionInspectionDto.setCreateUserId(userInfoByUserId.getUserId()); |
| | | unionInspectionDto.setIsApplets(1); |
| | | return comEquipmentUnionInspectionFeign.query(unionInspectionDto); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | import com.panzhihua.common.model.dtos.equipment.UnionOutdoorLaborDynamicDto; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComMngStructAreaDistrictVO; |
| | | import com.panzhihua.common.service.community.ComEquipmentUnionOutdoorLaborDynamicFeign; |
| | | 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("/unionOutdoorLaborDynamic/") |
| | | @Api(tags = {"户外劳工动态服务"}) |
| | | public class UnionOutdoorLaborDynamicApi { |
| | | |
| | | @Resource |
| | | private ComEquipmentUnionOutdoorLaborDynamicFeign comEquipmentUnionOutdoorLaborDynamicFeign; |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | /** |
| | | * 分页总工会-户外劳工站-动态 |
| | | * |
| | | * @param unionOutdoorLaborDynamicDto |
| | | * @return 动态结果 |
| | | */ |
| | | @PostMapping("page") |
| | | R query(@RequestBody UnionOutdoorLaborDynamicDto unionOutdoorLaborDynamicDto) { |
| | | return comEquipmentUnionOutdoorLaborDynamicFeign.query(unionOutdoorLaborDynamicDto); |
| | | } |
| | | |
| | | /** |
| | | * 查询总工会-户外劳工站-动态 |
| | | * |
| | | * @param id |
| | | * 动态 id |
| | | * @return 查找结果 |
| | | */ |
| | | @GetMapping("/{id}") |
| | | R eventMainMemberDetails(@PathVariable("id") Long id) { |
| | | return comEquipmentUnionOutdoorLaborDynamicFeign.unionOutdoorLaborDynamicDetail(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "所在地地址下拉列表(攀枝花)", response = ComMngStructAreaDistrictVO.class) |
| | | @PostMapping("listarea") |
| | | public R listArea() { |
| | | Long cityAdcode = 510400l; |
| | | return communityService.listAreaDistrict(cityAdcode); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | import com.panzhihua.common.model.dtos.equipment.UnionOutdoorLaborDynamicDto; |
| | | import com.panzhihua.common.model.dtos.equipment.UnionOutdoorSiteDto; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComMngStructAreaDistrictVO; |
| | | import com.panzhihua.common.service.community.ComEquipmentUnionOutdoorLaborDynamicFeign; |
| | | import com.panzhihua.common.service.community.ComEquipmentUnionOutdoorSiteFeign; |
| | | 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("/unionOutdoorSite/") |
| | | @Api(tags = {"户外劳工站"}) |
| | | public class UnionOutdoorSiteApi { |
| | | |
| | | @Resource |
| | | private ComEquipmentUnionOutdoorSiteFeign comEquipmentUnionOutdoorSiteFeign; |
| | | |
| | | |
| | | /** |
| | | * 分页总工会户外劳工站 |
| | | * |
| | | * @param unionOutdoorSiteDto |
| | | * @return 动态结果 |
| | | */ |
| | | @PostMapping("page") |
| | | R query(@RequestBody UnionOutdoorSiteDto unionOutdoorSiteDto) { |
| | | return comEquipmentUnionOutdoorSiteFeign.query(unionOutdoorSiteDto); |
| | | } |
| | | |
| | | /** |
| | | * 查询总工会户外劳工站 |
| | | * |
| | | * @param id |
| | | * 户外劳工站 id |
| | | * @return 查找结果 |
| | | */ |
| | | @GetMapping("/{id}") |
| | | R eventMainMemberDetails(@PathVariable("id") Long id) { |
| | | return comEquipmentUnionOutdoorSiteFeign.unionOutdoorSiteDetail(id); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.equipment.UnionReportDto; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.service.community.ComEquipmentUnionRePortFeign; |
| | | import com.panzhihua.common.service.community.ComEquipmentUnionUserFeign; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import io.swagger.annotations.Api; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/unionReport/") |
| | | @Api(tags = {"户外劳工站上报"}) |
| | | public class UnionReportApi extends BaseController { |
| | | |
| | | @Resource |
| | | private ComEquipmentUnionRePortFeign comEquipmentUnionRePortFeign; |
| | | |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | |
| | | /** |
| | | * 户外劳工站上报表 |
| | | * |
| | | * @param unionReportDto |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/add") |
| | | public R add(@RequestBody UnionReportDto unionReportDto) { |
| | | // LoginUserInfoVO loginUser = this.getLoginUserInfo(); |
| | | // LoginUserInfoVO userInfoByUserId = userService.getUserInfoByUserId(loginUser.getUserId().toString()).getData(); |
| | | LoginUserInfoVO userInfoByUserId = userService.getUserInfoByUserId("1588095866109984769").getData(); |
| | | unionReportDto.setCreateUserId(userInfoByUserId.getUserId()); |
| | | return comEquipmentUnionRePortFeign.add(unionReportDto); |
| | | } |
| | | |
| | | /** |
| | | * 分页户外劳工站上报表 |
| | | * |
| | | * @param unionReportDto |
| | | * @return 动态结果 |
| | | */ |
| | | @PostMapping("/query") |
| | | public R query(@RequestBody UnionReportDto unionReportDto) { |
| | | // LoginUserInfoVO loginUser = this.getLoginUserInfo(); |
| | | // LoginUserInfoVO userInfoByUserId = userService.getUserInfoByUserId(loginUser.getUserId().toString()).getData(); |
| | | LoginUserInfoVO userInfoByUserId = userService.getUserInfoByUserId("1588095866109984769").getData(); |
| | | unionReportDto.setCreateUserId(userInfoByUserId.getUserId()); |
| | | unionReportDto.setIsApplets(1); |
| | | return comEquipmentUnionRePortFeign.query(unionReportDto); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | import com.panzhihua.common.constants.TokenConstant; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.equipment.UnionOutdoorSiteDto; |
| | | import com.panzhihua.common.model.dtos.equipment.UnionUserDto; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.acid.ComActAcidRecordVO; |
| | | import com.panzhihua.common.service.community.ComEquipmentUnionOutdoorSiteFeign; |
| | | import com.panzhihua.common.service.community.ComEquipmentUnionUserFeign; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.utlis.JWTTokenUtil; |
| | | import io.jsonwebtoken.Claims; |
| | | 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; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/unionUser/") |
| | | @Api(tags = {"户外劳工站登录"}) |
| | | public class UnionUserApi extends BaseController { |
| | | |
| | | @Resource |
| | | private ComEquipmentUnionUserFeign comEquipmentUnionUserFeign; |
| | | |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | |
| | | /** |
| | | * 总工会户外劳登录 |
| | | * |
| | | * |
| | | * @return 总工会户外劳共用户 |
| | | */ |
| | | @ApiOperation(value = "总工会户外劳登录",response = UnionUserDto.class) |
| | | @GetMapping("/login") |
| | | public R login(){ |
| | | // LoginUserInfoVO loginUser = this.getLoginUserInfo(); |
| | | // LoginUserInfoVO userInfoByUserId = userService.getUserInfoByUserId(loginUser.getUserId().toString()).getData(); |
| | | LoginUserInfoVO userInfoByUserId = userService.getUserInfoByUserId("1588095866109984769").getData(); |
| | | return comEquipmentUnionUserFeign.login(userInfoByUserId); |
| | | } |
| | | |
| | | /** |
| | | * 总工会户外劳工站用户认证 |
| | | * |
| | | * @param unionUserDto |
| | | * @return 总工会户外劳共用户 |
| | | */ |
| | | @ApiOperation(value = "总工会户外劳工站用户认证",response = UnionUserDto.class) |
| | | @PostMapping("/authentication") |
| | | public R authentication(@RequestBody UnionUserDto unionUserDto){ |
| | | unionUserDto.setIsApplets(1); |
| | | // LoginUserInfoVO loginUser = this.getLoginUserInfo(); |
| | | // LoginUserInfoVO userInfoByUserId = userService.getUserInfoByUserId(loginUser.getUserId().toString()).getData(); |
| | | LoginUserInfoVO userInfoByUserId = userService.getUserInfoByUserId("1588095866109984769").getData(); |
| | | unionUserDto.setUserId(userInfoByUserId.getUserId()); |
| | | // unionUserDto.setId(userInfoByUserId.getId); |
| | | return comEquipmentUnionUserFeign.authentication(unionUserDto); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import static java.util.stream.Collectors.toList; |
| | | |
| | | import java.util.*; |
| | | import java.util.concurrent.atomic.AtomicBoolean; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.panzhihua.applets.umf.UmfPayUtil; |
| | | import com.panzhihua.common.constants.Constants; |
| | | import com.panzhihua.common.constants.HttpStatus; |
| | | import com.panzhihua.common.model.dtos.community.social.PageProjectDTO; |
| | | import com.panzhihua.common.model.vos.community.rentHouse.WxPayOrderVO; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.apache.commons.lang.StringUtils; |
| | | 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 com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.applets.model.dtos.ComPbMemberCertificationDTO; |
| | | import com.panzhihua.applets.weixin.CheckService; |
| | | import com.panzhihua.common.constants.SecurityConstants; |
| | | import com.panzhihua.common.constants.UserConstants; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.user.SysUserEditTipsDTO; |
| | | 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.ComActActEvaluateVO; |
| | | 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.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; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: 用户 |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-11-24 12:03 |
| | | **/ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/user/") |
| | | @Api(tags = {"我的模块"}) |
| | | public class UserApi extends BaseController { |
| | | @Resource |
| | | private UserService userService; |
| | | @Resource |
| | | private CommunityService communityService; |
| | | @Resource |
| | | private PartyBuildingService partyBuildingService; |
| | | @Resource |
| | | private CheckService checkService; |
| | | @Resource |
| | | private StringRedisTemplate stringRedisTemplate; |
| | | |
| | | @ApiOperation(value = "当前登录用户信息", response = LoginUserInfoVO.class) |
| | | @GetMapping("info") |
| | | public R getUserInfo() { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | Long communityId = loginUserInfo.getCommunityId(); |
| | | Long userId = loginUserInfo.getUserId(); |
| | | Long areaId = loginUserInfo.getAreaId(); |
| | | R<LoginUserInfoVO> r = userService.getUserInfoByUserId(userId + ""); |
| | | String phone = loginUserInfo.getPhone(); |
| | | if (R.isOk(r)) { |
| | | Object data = r.getData(); |
| | | if (!ObjectUtils.isEmpty(data)) { |
| | | LoginUserInfoVO loginUserInfoVO = (LoginUserInfoVO)data; |
| | | //是否保存unionid |
| | | // if (Objects.isNull(loginUserInfoVO.getUnionid()) || "无".equals(loginUserInfoVO.getUnionid())) { |
| | | // return R.fail(HttpStatus.UNAUTHORIZED, "token过期"); |
| | | // } |
| | | R r1 = communityService.detailHouse(userId); |
| | | if(StringUtils.isNotEmpty(loginUserInfoVO.getIdCard())){ |
| | | //查询实名用户绑定的实有人口地址 |
| | | R r4=communityService.selectByIdCard(loginUserInfoVO.getIdCard()); |
| | | if(R.isOk(r4)){ |
| | | String address= (String) r4.getData(); |
| | | if(StringUtils.isNotEmpty(address)){ |
| | | loginUserInfoVO.setAddress(address); |
| | | r.setData(loginUserInfoVO); |
| | | } |
| | | } |
| | | } |
| | | if (null != communityId && 0 != communityId) { |
| | | R r2 = communityService.detailCommunity(communityId); |
| | | if (R.isOk(r2)) { |
| | | Object data1 = r2.getData(); |
| | | if (!ObjectUtils.isEmpty(data1)) { |
| | | loginUserInfoVO |
| | | .setComActVO(JSONObject.parseObject(JSONObject.toJSONString(data1), ComActVO.class)); |
| | | r.setData(loginUserInfoVO); |
| | | } |
| | | } |
| | | } |
| | | if (null != areaId && areaId != 0) { |
| | | R r3 = communityService.detailArea(areaId); |
| | | if (R.isOk(r3)) { |
| | | Object data1 = r3.getData(); |
| | | if (!ObjectUtils.isEmpty(data1)) { |
| | | loginUserInfoVO.setComMngStructAreaVO( |
| | | JSONObject.parseObject(JSONObject.toJSONString(data1), ComMngStructAreaVO.class)); |
| | | r.setData(loginUserInfoVO); |
| | | } |
| | | } |
| | | } |
| | | if (R.isOk(r1)) { |
| | | Object data1 = r1.getData(); |
| | | if (!ObjectUtils.isEmpty(data1)) { |
| | | loginUserInfoVO.setComMngStructHouseVOS((List<ComMngStructHouseVO>)data1); |
| | | r.setData(loginUserInfoVO); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return r; |
| | | } |
| | | |
| | | @ApiOperation(value = "用户实名认证") |
| | | @PutMapping("putuserauthentication") |
| | | public R putUserAuthentication(@RequestBody @Validated(AddGroup.class) LoginUserInfoVO loginUserInfoVO) { |
| | | Long userId = this.getUserId(); |
| | | loginUserInfoVO.setUserId(userId); |
| | | loginUserInfoVO.setCommunityId(this.getCommunityId()); |
| | | R r = userService.putUserAuthentication(loginUserInfoVO); |
| | | if (R.isOk(r)) { |
| | | // 通过发通知 |
| | | SysUserNoticeVO sysUserNoticeVO = new SysUserNoticeVO(); |
| | | sysUserNoticeVO.setUserId(userId); |
| | | sysUserNoticeVO.setType(3); |
| | | sysUserNoticeVO.setTitle("实名制审核通过"); |
| | | sysUserNoticeVO.setBusinessType(6); |
| | | sysUserNoticeVO.setBusinessContent("恭喜你,你已经通过了实名制认证"); |
| | | sysUserNoticeVO.setStatus(0); |
| | | sysUserNoticeVO.setBusinessStatus(2); |
| | | R r1 = userService.addNotice(sysUserNoticeVO); |
| | | if (R.isOk(r1)) { |
| | | log.info("新增实名认证未通过通知成功【{}】", JSONObject.toJSONString(sysUserNoticeVO)); |
| | | } |
| | | // 清空缓存 |
| | | String userRoleKey = UserConstants.LOGIN_USER_INFO + this.getLoginUserInfo().getUserId(); |
| | | String userAppletRoleKey = SecurityConstants.ROLE_APPLETS_USER + this.getLoginUserInfo().getUserId(); |
| | | stringRedisTemplate.delete(userRoleKey); |
| | | stringRedisTemplate.delete(userAppletRoleKey); |
| | | } else { |
| | | // 未通过发通知 |
| | | /** |
| | | * SysUserNoticeVO sysUserNoticeVO=new SysUserNoticeVO(); sysUserNoticeVO.setUserId(userId); |
| | | * sysUserNoticeVO.setType(3); sysUserNoticeVO.setTitle("实名制审核未通过"); sysUserNoticeVO.setBusinessType(6); |
| | | * sysUserNoticeVO.setBusinessContent(String.format("驳回原因:%s",r.getMsg())); sysUserNoticeVO.setStatus(0); |
| | | * sysUserNoticeVO.setBusinessStatus(1); R r1 = userService.addNotice(sysUserNoticeVO); if (R.isOk(r1)) { |
| | | * log.info("新增实名认证未通过通知成功【{}】", JSONObject.toJSONString(sysUserNoticeVO)); } |
| | | */ |
| | | } |
| | | return r; |
| | | } |
| | | |
| | | @ApiOperation(value = "修改用户手机号") |
| | | @PutMapping("userphone") |
| | | public R putUserphone(@RequestBody UserPhoneVO userPhoneVO) { |
| | | Long userId = this.getUserId(); |
| | | userPhoneVO.setUserId(userId); |
| | | R r = userService.putUserphone(userPhoneVO); |
| | | if (R.isOk(r)) { |
| | | communityService.putVolunteerPhone(userPhoneVO); |
| | | } |
| | | return r; |
| | | } |
| | | |
| | | @ApiOperation(value = "修改用户信息") |
| | | @PutMapping("user") |
| | | public R putUser(@RequestBody LoginUserInfoVO loginUserInfoVO) { |
| | | Long userId = this.getUserId(); |
| | | loginUserInfoVO.setUserId(userId); |
| | | return userService.putUser(loginUserInfoVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "修改用户首页活动提示") |
| | | @PostMapping("editUserTips") |
| | | public R putUserTips(@RequestBody SysUserEditTipsDTO userEditTipsDTO) { |
| | | Long userId = this.getUserId(); |
| | | if (userId == null) { |
| | | return R.fail("请重新登录"); |
| | | } |
| | | userEditTipsDTO.setUserId(userId); |
| | | return userService.editUserTips(userEditTipsDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "房屋地址下拉列表") |
| | | @GetMapping("listhouse") |
| | | @ApiImplicitParam(name = "parentCode", value = "父级地址编码", required = false) |
| | | public R listHouses(String parentCode) { |
| | | Long areaId = this.getAreaId(); |
| | | if (ObjectUtils.isEmpty(parentCode)) { |
| | | parentCode = ""; |
| | | } |
| | | return communityService.listHouses(parentCode, areaId); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增房屋") |
| | | @PostMapping("houses") |
| | | public R addHouses(@RequestBody @Validated(AddGroup.class) ComMngStructHouseVO comMngStructHouseVO) { |
| | | String houseCode = comMngStructHouseVO.getHouseCode(); |
| | | if (ObjectUtils.isEmpty(houseCode)) { |
| | | return R.fail("房屋地址编码不能为空"); |
| | | } |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | comMngStructHouseVO.setUserId(loginUserInfo.getUserId()); |
| | | comMngStructHouseVO.setAreaId(loginUserInfo.getAreaId()); |
| | | return communityService.addHouses(comMngStructHouseVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "家庭成员列表") |
| | | @GetMapping("listfamily") |
| | | public R listFamily(@RequestParam(value = "pageNum") Long pageNum, @RequestParam("pageSize") Long pageSize) { |
| | | Long userId = this.getUserId(); |
| | | return userService.listFamily(userId, pageNum, pageSize); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增家庭成员") |
| | | @PostMapping("addfamily") |
| | | public R addFamily(@RequestBody @Validated(AddGroup.class) ComMngFamilyInfoVO comMngFamilyInfoVO) { |
| | | Long userId = this.getUserId(); |
| | | comMngFamilyInfoVO.setUserId(userId); |
| | | return userService.addFamily(comMngFamilyInfoVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "编辑家庭成员") |
| | | @PutMapping("putfamily") |
| | | public R putFamily(@RequestBody ComMngFamilyInfoVO comMngFamilyInfoVO) { |
| | | Long id = comMngFamilyInfoVO.getId(); |
| | | if (null == id || 0 == id) { |
| | | return R.fail("成员主键不能为空"); |
| | | } |
| | | comMngFamilyInfoVO.setUserId(this.getUserId()); |
| | | return userService.putFamily(comMngFamilyInfoVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "我的活动", response = ComActActivityVO.class) |
| | | @GetMapping("listactivity") |
| | | public R listActivity(@RequestParam(value = "status", required = false) Integer status,@RequestParam(value = "type", required = false) Integer type) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | Long userId = loginUserInfo.getUserId(); |
| | | Long communityId = loginUserInfo.getCommunityId(); |
| | | List<ComActActivityVO> comActActivityVOS = new ArrayList<>(); |
| | | R r = communityService.listActivity(userId, status,type); |
| | | if (R.isOk(r)&&r.getData()!=null) { |
| | | comActActivityVOS = (List<ComActActivityVO>)r.getData(); |
| | | } |
| | | // R r1 = partyBuildingService.listActivity(userId, communityId, status); |
| | | // if (R.isOk(r1)&&r1.getData()!=null) { |
| | | // List<ComActActivityVO> data = (List<ComActActivityVO>)r1.getData(); |
| | | // comActActivityVOS.addAll(data); |
| | | // } |
| | | if (!ObjectUtils.isEmpty(comActActivityVOS)) { |
| | | String s = JSONArray.toJSONString(comActActivityVOS); |
| | | List<ComActActivityVO> comActActivityVOS1 = new ArrayList<>(); |
| | | comActActivityVOS1 = JSONArray.parseArray(s, ComActActivityVO.class); |
| | | List<ComActActivityVO> collect = comActActivityVOS1.stream() |
| | | .sorted(Comparator.comparing(ComActActivityVO::getBeginAt).reversed()).collect(Collectors.toList()); |
| | | comActActivityVOS = collect; |
| | | } |
| | | 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())) { |
| | | List<ComActActRegistVO> comActActRegistVOS = JSONArray.parseArray(JSONArray.toJSONString(r2.getData()), ComActActRegistVO.class).stream() |
| | | .sorted(Comparator.comparing(ComActActRegistVO::getCreateAt).reversed()).collect(toList()); |
| | | collect.forEach(comActActivityVO -> { |
| | | ArrayList<ComActActRegistVO> currentList = new ArrayList<>(); |
| | | comActActRegistVOS.forEach(activitySignInVO -> { |
| | | if (comActActivityVO.getId().equals(activitySignInVO.getActivityId())) { |
| | | currentList.add(activitySignInVO); |
| | | if(activitySignInVO.getEndTime()!=null){ |
| | | comActActivityVO.setIsComment(1); |
| | | if(comActActivityVO.getTimes()==null){ |
| | | comActActivityVO.setTimes(1); |
| | | comActActivityVO.setAward(activitySignInVO.getAward()); |
| | | } |
| | | else { |
| | | comActActivityVO.setTimes(comActActivityVO.getTimes()+1); |
| | | comActActivityVO.setAward(comActActivityVO.getAward() + activitySignInVO.getAward()); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | if (currentList.size() > 10) { |
| | | comActActivityVO.setActivitySignInList(currentList.subList(0, 10)); |
| | | } else { |
| | | comActActivityVO.setActivitySignInList(currentList); |
| | | } |
| | | Integer limit = comActActivityVO.getLimit(); |
| | | if(limit != null && limit>0 &¤tList.size()>0){ |
| | | if(limit==currentList.size()&¤tList.get(currentList.size()-1).getEndTime()!=null){ |
| | | comActActivityVO.setIsRegist(1); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | //当前用户活动评分 |
| | | 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 -> { |
| | | List<ComActActEvaluateVO> evaluateVOS=comActActEvaluateVOS.stream().filter(comActActEvaluateVO -> comActActEvaluateVO.getActivityId().equals(comActActivityVO.getId())).collect(toList()); |
| | | if(comActActivityVO.getSignCount()<=evaluateVOS.size()){ |
| | | comActActivityVO.setIsComment(0); |
| | | } |
| | | comActActivityVO.setComActActEvaluateVOList(evaluateVOS); |
| | | }); |
| | | } |
| | | return R.ok(collect); |
| | | } |
| | | return R.ok(comActActivityVOS); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询我的随手拍", response = ComActEasyPhotoVO.class) |
| | | @PostMapping("pageeasyphoto") |
| | | public R pageEasyPhoto(@RequestBody ComActEasyPhotoVO comActEasyPhotoVO) { |
| | | Long userId = this.getUserId(); |
| | | comActEasyPhotoVO.setSponsorId(userId); |
| | | comActEasyPhotoVO.setCommunityId(null); |
| | | return communityService.pageEasyPhotoApplets(comActEasyPhotoVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询我的微心愿", response = ComActMicroWishVO.class) |
| | | @PostMapping("pagemicrowish") |
| | | public R pageMicroWish(@RequestBody ComActMicroWishVO comActMicroWishVO) { |
| | | Long userId = this.getUserId(); |
| | | comActMicroWishVO.setUserId(userId); |
| | | comActMicroWishVO.setCommunityId(null); |
| | | Integer status = comActMicroWishVO.getStatus(); |
| | | if (null != status && status == 1) { |
| | | comActMicroWishVO.setIsPageMyWish(1); |
| | | } else { |
| | | comActMicroWishVO.setIsPageMyWish(null); |
| | | } |
| | | |
| | | return communityService.pageMicroWish(comActMicroWishVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "用户确认心愿") |
| | | @PutMapping("microwishconfirm") |
| | | public R putMicroWishConfirm(@RequestBody ComActMicroWishVO comActMicroWishVO) { |
| | | Long userId = this.getUserId(); |
| | | comActMicroWishVO.setUserId(userId); |
| | | comActMicroWishVO.setCommunityId(null); |
| | | Long id = comActMicroWishVO.getId(); |
| | | if (null == id || 0 == id) { |
| | | return R.fail("心愿主键不能为空"); |
| | | } |
| | | Integer score = comActMicroWishVO.getScore(); |
| | | if (null == score || 0 == score) { |
| | | return R.fail("评分不能为空"); |
| | | } |
| | | comActMicroWishVO.setEvaluateAt(new Date()); |
| | | comActMicroWishVO.setStatus(6); |
| | | return communityService.putMicroWishConfirm(comActMicroWishVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "调试接口--清除昵称、社区、小区") |
| | | @DeleteMapping("usertest") |
| | | public R deleteUserTest() { |
| | | Long userId = this.getUserId(); |
| | | return userService.deleteUserTest(userId); |
| | | } |
| | | |
| | | @ApiOperation(value = "意见反馈") |
| | | @PostMapping("feedback") |
| | | public R addFeedback(@RequestBody @Validated(AddGroup.class) SysUserFeedbackDTO sysUserFeedbackDTO) { |
| | | // 微信内容审核 |
| | | String msg = sysUserFeedbackDTO.getContent(); |
| | | if (StrUtil.isNotBlank(msg)) { |
| | | String result = checkService.checkMessageBy(msg, this.getLoginUserInfo().getOpenid(),this.getAppId()); |
| | | if (StrUtil.isNotBlank(result)) { |
| | | return R.fail(501, "填写内容存在 " + result + " 违规信息"); |
| | | } |
| | | } |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | Long userId = loginUserInfo.getUserId(); |
| | | Long communityId = loginUserInfo.getCommunityId(); |
| | | Long areaId = loginUserInfo.getAreaId(); |
| | | if (null == communityId || 0 == communityId) { |
| | | return R.fail("未绑定社区"); |
| | | } |
| | | sysUserFeedbackDTO.setCommunityId(communityId); |
| | | sysUserFeedbackDTO.setAreaId(areaId); |
| | | sysUserFeedbackDTO.setUserId(userId); |
| | | return userService.addFeedback(sysUserFeedbackDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "党员认证") |
| | | @PostMapping("partybuildingembercertification") |
| | | public R partybuildingembercertification( |
| | | @RequestBody @Validated(AddGroup.class) ComPbMemberCertificationDTO comPbMemberCertificationDTO) { |
| | | // 党员认证 |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | Long userId = loginUserInfo.getUserId(); |
| | | Long communityId = loginUserInfo.getCommunityId(); |
| | | if (null == communityId || 0 == communityId) { |
| | | return R.fail("未绑定社区"); |
| | | } |
| | | |
| | | // 判断用户是否已认证成功 |
| | | R certUser = partyBuildingService.userCertification(userId,communityId); |
| | | |
| | | Object certUserInfo = certUser.getData(); |
| | | AtomicBoolean userCertified = new AtomicBoolean(false); |
| | | if (R.isOk(certUser) && certUserInfo != null) { |
| | | try { |
| | | List<PartyBuildingMemberVO> partyBuildingMemberVOList = |
| | | JSONArray.parseArray(JSONArray.toJSONString(certUser.getData()), PartyBuildingMemberVO.class); |
| | | // 已认证党员身份,直接返回 |
| | | if (partyBuildingMemberVOList != null && partyBuildingMemberVOList.size() > 0) { |
| | | partyBuildingMemberVOList.forEach(vo -> { |
| | | userCertified.set(vo.getAuditResult() == 1); |
| | | }); |
| | | } |
| | | } catch (Exception e) { |
| | | } |
| | | } |
| | | // 匹配手机,验证是否进行自动确认 |
| | | if (userCertified.get()) { |
| | | return R.fail("您已审核通过,无需重复提交"); |
| | | } |
| | | |
| | | PartyBuildingMemberVO partyBuildingMemberVO = new PartyBuildingMemberVO(); |
| | | BeanUtils.copyProperties(comPbMemberCertificationDTO, partyBuildingMemberVO); |
| | | partyBuildingMemberVO.setAuditResult(0); |
| | | partyBuildingMemberVO.setCommunityId(communityId); |
| | | |
| | | // 用户实名认证信息判断 |
| | | String idCard = loginUserInfo.getIdCard(); |
| | | partyBuildingMemberVO.setUserId(userId); |
| | | if (idCard == null) { |
| | | return R.fail("用户未完成实名认证"); |
| | | } else { |
| | | partyBuildingMemberVO.setIdCard(loginUserInfo.getIdCard()); |
| | | partyBuildingMemberVO.setName(loginUserInfo.getName()); |
| | | partyBuildingMemberVO.setPhone(loginUserInfo.getPhone()); |
| | | } |
| | | |
| | | R r = partyBuildingService.addPartyBuildingMember(partyBuildingMemberVO); |
| | | return r; |
| | | } |
| | | |
| | | @ApiOperation(value = "党员认证查询") |
| | | @GetMapping("partybuildingembercertification") |
| | | public R partybuildingembercertification() { |
| | | // 党员认证查询 |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | Long userId = loginUserInfo.getUserId(); |
| | | R r = partyBuildingService.userCertification(userId,this.getCommunityId()); |
| | | |
| | | if (R.isOk(r)) { |
| | | List<PartyBuildingMemberVO> partyBuildingMemberVOList = |
| | | JSONArray.parseArray(JSONArray.toJSONString(r.getData()), PartyBuildingMemberVO.class); |
| | | if (partyBuildingMemberVOList != null && partyBuildingMemberVOList.size() > 0) { |
| | | Optional<PartyBuildingMemberVO> ot = partyBuildingMemberVOList.stream() |
| | | .filter(partyBuildingMemberVO -> partyBuildingMemberVO.getAuditResult() == 1).findFirst(); |
| | | if (ot.isPresent()) { |
| | | return R.ok(ot.get()); |
| | | } else { |
| | | return R.ok(partyBuildingMemberVOList.get(0)); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取用户电子档案", response = UserArchivesVO.class) |
| | | @PostMapping("getUserArchives") |
| | | public R getUserArchives() { |
| | | Long userId = this.getUserId(); |
| | | if (userId == null) { |
| | | return R.fail("请重新登录"); |
| | | } |
| | | return userService.getUserArchives(userId); |
| | | } |
| | | |
| | | @ApiOperation(value = "编辑用户电子档案") |
| | | @PostMapping("updateUserArchives") |
| | | public R updateUserArchives(@RequestBody UpdateUserArchivesVO userArchivesVO) { |
| | | Long userId = this.getUserId(); |
| | | if (userId == null) { |
| | | return R.fail("请重新登录"); |
| | | } |
| | | userArchivesVO.setUserId(userId); |
| | | return userService.updateUserArchives(userArchivesVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询用户报名的项目") |
| | | @PostMapping("project") |
| | | public R pageProjectWhichIsSignedByUser(@RequestBody @Valid PageProjectDTO pageProjectDTO) { |
| | | pageProjectDTO.setUserId(this.getUserId()); |
| | | return communityService.pageProjectWhichIsSignedByUser(pageProjectDTO); |
| | | } |
| | | |
| | | @ApiOperation("获取用户") |
| | | @GetMapping("selectAutomessageSysUserById") |
| | | public R selectAutomessageSysUserById(@RequestParam("id")Long id){ |
| | | return communityService.selectAutomessageSysUserById(id); |
| | | } |
| | | |
| | | @ApiOperation("新增投诉建议或问题留言") |
| | | @PostMapping("addFeedBack") |
| | | public R addFeedBack(@RequestBody SysUserFeedbackDTO sysUserFeedbackDTO){ |
| | | sysUserFeedbackDTO.setCommunityId(null); |
| | | return userService.addFeedback(sysUserFeedbackDTO); |
| | | } |
| | | |
| | | @ApiOperation("查看自己的投诉建议或问题留言记录") |
| | | @GetMapping("myFeedBack") |
| | | public R myFeedBack(@ApiParam("类型:1问题留言2投诉建议") @RequestParam(value = "type",required = false)Integer type,@RequestParam("propertyId")Long propertyId){ |
| | | return userService.myFeedBack(this.getLoginUserInfo().getUserId(),type,propertyId); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.vaccines.VaccinesEnrollByAppDTO; |
| | | import com.panzhihua.common.model.dtos.vaccines.VaccinesEnrollUserByAppDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.vaccines.VaccinesByAppVO; |
| | | import com.panzhihua.common.model.vos.vaccines.VaccinesEnrollUserByAppVO; |
| | | import com.panzhihua.common.model.vos.vaccines.VaccinesUserInoculationByAppVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-05-19 14:25:49 |
| | | * @describe 疫苗服务API |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/vaccines/") |
| | | @Api(tags = {"疫苗服务"}) |
| | | public class VaccinesApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @ApiOperation(value = "疫苗分类列表", response = VaccinesByAppVO.class) |
| | | @PostMapping("list") |
| | | public R getVaccinesListByApp() { |
| | | return communityService.getVaccinesListByApp(); |
| | | } |
| | | |
| | | @ApiOperation(value = "疫苗类型对应家庭成员接种列表", response = VaccinesEnrollUserByAppVO.class) |
| | | @PostMapping("user/list") |
| | | public R getVaccinesUserListByApp(@RequestBody VaccinesEnrollUserByAppDTO enrollUserByAppDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if (loginUserInfo == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | enrollUserByAppDTO.setUserId(loginUserInfo.getUserId()); |
| | | return communityService.getVaccinesUserListByApp(enrollUserByAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "用户疫苗报名") |
| | | @PostMapping("enroll") |
| | | public R VaccinesEnrollByApp(@RequestBody VaccinesEnrollByAppDTO enrollByAppDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if (loginUserInfo == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | enrollByAppDTO.setUserId(loginUserInfo.getUserId()); |
| | | enrollByAppDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | return communityService.VaccinesEnrollByApp(enrollByAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "用户家庭接种记录", response = VaccinesUserInoculationByAppVO.class) |
| | | @PostMapping("user/inoculation/list") |
| | | public R getVaccinesUserInoculationListByApp() { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if (loginUserInfo == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | return communityService.getVaccinesUserInoculationListByApp(loginUserInfo.getUserId()); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.listen.ComMngVillageServeExcelListen; |
| | | import com.panzhihua.common.model.dtos.community.PageComMngVillageDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageRegionVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageServeExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageTotalVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @description: 小区管理 |
| | | * @author: llming |
| | | **/ |
| | | @Slf4j |
| | | @Api(tags = {"小区管理"}) |
| | | @RestController |
| | | @RequestMapping("/villagemanager/") |
| | | public class VillageApi extends BaseController { |
| | | @Resource |
| | | private CommunityService communityService; |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | @ApiOperation(value = "查询小区", response = ComMngVillageVO.class) |
| | | @PostMapping("listvillage") |
| | | public R listVillage(@RequestBody ComMngVillageVO comMngVillageVO) { |
| | | return communityService.listVillage(comMngVillageVO); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.VolunteerActivitiesPeopleVO; |
| | | import com.panzhihua.common.model.vos.community.VolunteerIntegralMerchantVO; |
| | | import com.panzhihua.common.model.vos.community.VolunteerIntegralRecordVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/VolunteerActivitiesPeople") |
| | | public class VolunteerActivitiesPeopleApi extends BaseController |
| | | { |
| | | @Resource |
| | | private CommunityService volunteerActivitiesPeople; |
| | | |
| | | /** |
| | | * 志愿者单个详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/vapGetById") |
| | | public R vapGetById(@RequestParam("id") String id) |
| | | { |
| | | if(StringUtils.isEmpty(id)) |
| | | { |
| | | return R.fail("id不能为空"); |
| | | } |
| | | return R.ok(volunteerActivitiesPeople.vapGetById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 参与人员列表 |
| | | * @param activityId |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | @GetMapping("/vapGetList") |
| | | public R vapGetList(@RequestParam("activityId") String activityId, |
| | | @RequestParam("communityId") String communityId) |
| | | { |
| | | if(StringUtils.isEmpty(activityId)) |
| | | { |
| | | return R.fail("活动id不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(communityId)) |
| | | { |
| | | communityId=getLoginUserInfo().getCommunityId()+""; |
| | | } |
| | | |
| | | return R.ok(volunteerActivitiesPeople.vapGetList(activityId, communityId)); |
| | | } |
| | | |
| | | /** |
| | | * 添加参与人员 |
| | | * @param volunteerActivitiesPeopleVO |
| | | * @return |
| | | */ |
| | | @PostMapping("/vapInsert") |
| | | public R vapInsert(@RequestBody VolunteerActivitiesPeopleVO volunteerActivitiesPeopleVO) |
| | | { |
| | | if(volunteerActivitiesPeopleVO==null) |
| | | { |
| | | return R.fail("参数不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(volunteerActivitiesPeopleVO.getUserId())) |
| | | { |
| | | return R.fail("用户id不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(volunteerActivitiesPeopleVO.getActivityId())) |
| | | { |
| | | return R.fail("活动id不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(volunteerActivitiesPeopleVO.getCommunityId())) |
| | | { |
| | | volunteerActivitiesPeopleVO.setCommunityId(getLoginUserInfo().getCommunityId()+""); |
| | | } |
| | | |
| | | return volunteerActivitiesPeople.vapInsert(volunteerActivitiesPeopleVO); |
| | | } |
| | | |
| | | /** |
| | | * 修改参与人员 |
| | | * @param volunteerActivitiesPeopleVO |
| | | * @return |
| | | */ |
| | | @PostMapping("/vapUpdate") |
| | | public R vapUpdate(@RequestBody VolunteerActivitiesPeopleVO volunteerActivitiesPeopleVO) |
| | | { |
| | | if(volunteerActivitiesPeopleVO==null) |
| | | { |
| | | return R.fail("参数不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(volunteerActivitiesPeopleVO.getId())) |
| | | { |
| | | return R.fail("id不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(volunteerActivitiesPeopleVO.getActivityId())) |
| | | { |
| | | return R.fail("活动id不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(volunteerActivitiesPeopleVO.getVolunteerId())) |
| | | { |
| | | return R.fail("志愿者id不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(volunteerActivitiesPeopleVO.getCommunityId())) |
| | | { |
| | | volunteerActivitiesPeopleVO.setCommunityId(getLoginUserInfo().getCommunityId()+""); |
| | | } |
| | | |
| | | return volunteerActivitiesPeople.vapUpdate(volunteerActivitiesPeopleVO); |
| | | } |
| | | |
| | | /** |
| | | * 删除参与人员 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/vapDelete") |
| | | public R vapDelete(@RequestParam("id") String id) |
| | | { |
| | | if(StringUtils.isEmpty(id)) |
| | | { |
| | | return R.fail("id不能为空"); |
| | | } |
| | | return volunteerActivitiesPeople.vapDelete(id); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @GetMapping("/queryList") |
| | | R queryList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize, |
| | | @RequestParam(value = "name", required = false) String name, |
| | | @RequestParam(value = "acState", required = false) String acState, |
| | | @RequestParam(value = "acType", required = false) String acType, |
| | | @RequestParam(value = "actityBeginTime", required = false) Date actityBeginTime, |
| | | @RequestParam(value = "actityEndTime", required = false) Date actityEndTime) |
| | | { |
| | | return volunteerActivitiesPeople.volunteerQueryList(pageNum, pageSize, name, acState, acType, actityBeginTime, actityEndTime); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @GetMapping("/volunteerTypeGetList") |
| | | public R volunteerTypeGetList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize) |
| | | { |
| | | return volunteerActivitiesPeople.volunteerTypeGetList(pageNum,pageSize,"1"); |
| | | } |
| | | |
| | | /************************************************************************************************** |
| | | * |
| | | * 积分明细 |
| | | * |
| | | ***************************************************************************************************/ |
| | | /** |
| | | * 获取单个详情 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/IntegralRecord/getId") |
| | | public R VolunteerIntegralRecordGetId(@RequestParam("id") String id) |
| | | { |
| | | return volunteerActivitiesPeople.VolunteerIntegralRecordGetId(id); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | @GetMapping("/IntegralRecord/getList") |
| | | public R VolunteerIntegralRecordGetList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize, |
| | | @RequestParam("userId") String userId) |
| | | { |
| | | return volunteerActivitiesPeople.VolunteerIntegralRecordGetList(pageNum,pageSize,userId); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | @PostMapping("/IntegralRecord/insertVolunteer") |
| | | public R VolunteerIntegralRecordInsertVolunteer(@RequestBody() VolunteerIntegralRecordVO volunteerIntegralRecordVO) |
| | | { |
| | | return volunteerActivitiesPeople.VolunteerIntegralRecordInsertVolunteer(volunteerIntegralRecordVO); |
| | | } |
| | | |
| | | /** |
| | | * 便捷 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @PostMapping("/VolunteerIntegralRecord/updateId") |
| | | public R VolunteerIntegralRecordUpdateId(@RequestBody() VolunteerIntegralRecordVO volunteerIntegralRecordVO) |
| | | { |
| | | return volunteerActivitiesPeople.VolunteerIntegralRecordUpdateId(volunteerIntegralRecordVO); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/IntegralRecord/deleteId") |
| | | public R VolunteerIntegralRecordDeleteId(@RequestParam("id") String id) |
| | | { |
| | | return volunteerActivitiesPeople.VolunteerIntegralRecordDeleteId(id); |
| | | } |
| | | |
| | | /**************************************************************************************************** |
| | | * |
| | | * |
| | | * 路北积分商城 |
| | | * |
| | | * |
| | | ***************************************************************************************************/ |
| | | |
| | | /** |
| | | * 获取单个详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/VolunteerIntegralMerchant/queryById") |
| | | public R VolunteerIntegralMerchantQueryById(@RequestParam("id") String id) |
| | | { |
| | | return volunteerActivitiesPeople.VolunteerIntegralMerchantQueryById(id); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @GetMapping("/VolunteerIntegralMerchant/queryList") |
| | | public R VolunteerIntegralMerchantQueryList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize, |
| | | @RequestParam(value = "name", required = false) String name, |
| | | @RequestParam(value = "state", required = false) String state) |
| | | { |
| | | return volunteerActivitiesPeople.VolunteerIntegralMerchantQueryList(pageNum,pageSize,name,state,"0",null); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @GetMapping("/VolunteerIntegralMerchant/merchantQueryList") |
| | | public R MerchantQueryList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize, |
| | | @RequestParam(value = "name", required = false) String name, |
| | | @RequestParam(value = "state", required = false) String state, |
| | | @RequestParam(value = "merchantId", required = false) String merchantId) |
| | | { |
| | | return volunteerActivitiesPeople.VolunteerIntegralMerchantQueryList(pageNum,pageSize,name,state,"1",merchantId); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 新增 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @PostMapping("/VolunteerIntegralMerchant/insertVolunteer") |
| | | public R VolunteerIntegralMerchantInsertVolunteer(@RequestBody VolunteerIntegralMerchantVO vimVO) |
| | | { |
| | | if(StringUtils.isEmpty(vimVO.getMerchantId())) |
| | | { |
| | | return R.fail("商家id不能为空"); |
| | | } |
| | | |
| | | vimVO.setGoodType("1"); |
| | | return volunteerActivitiesPeople.VolunteerIntegralMerchantInsertVolunteer(vimVO); |
| | | } |
| | | |
| | | @PostMapping("/VolunteerIntegralMerchant/updateById") |
| | | public R VolunteerIntegralMerchantUpdateById(@RequestBody VolunteerIntegralMerchantVO vimVO) |
| | | { |
| | | if(StringUtils.isEmpty(vimVO.getMerchantId())) |
| | | { |
| | | return R.fail("商家id不能为空"); |
| | | } |
| | | |
| | | vimVO.setGoodType("1"); |
| | | return volunteerActivitiesPeople.VolunteerIntegralMerchantUpdateById(vimVO); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/VolunteerIntegralMerchant/unmount") |
| | | public R VolunteerIntegralMerchantUnmount(@RequestBody VolunteerIntegralMerchantVO vimVO) |
| | | { |
| | | vimVO.setGoodType("1"); |
| | | return volunteerActivitiesPeople.VolunteerIntegralMerchantUnmount(vimVO); |
| | | } |
| | | |
| | | |
| | | @DeleteMapping("/VolunteerIntegralMerchant/deleteById") |
| | | public R VolunteerIntegralMerchantDeleteById(@RequestParam("id") String id) |
| | | { |
| | | return volunteerActivitiesPeople.VolunteerIntegralMerchantDeleteById(id); |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.wallet.ComActWalletDetailDTO; |
| | | import com.panzhihua.common.model.dtos.community.wallet.PageComActWalletTradeDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.wallet.ComActWalletRankingVO; |
| | | import com.panzhihua.common.model.vos.community.wallet.ComActWalletTradeVO; |
| | | import com.panzhihua.common.model.vos.community.wallet.ComActWalletVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | |
| | | @RestController |
| | | @RequestMapping("/wallet/") |
| | | @Api(tags = {"钱包模块"}) |
| | | public class WalletApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @ApiOperation(value = "查询我的钱包", response = ComActWalletVO.class) |
| | | @PostMapping("/get/my") |
| | | public R getWallet() { |
| | | ComActWalletDetailDTO walletDetailDTO = new ComActWalletDetailDTO(); |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if (loginUserInfo == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | walletDetailDTO.setUserId(loginUserInfo.getUserId()); |
| | | Long communityId = loginUserInfo.getCommunityId(); |
| | | if (null == communityId || 0 == communityId) { |
| | | return R.fail("用户未绑定社区"); |
| | | } |
| | | walletDetailDTO.setCommunityId(communityId); |
| | | return communityService.getUserWalletDetail(walletDetailDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询我的收支记录", response = ComActWalletTradeVO.class) |
| | | @PostMapping("/get/trade") |
| | | public R getWalletTrade(@RequestBody PageComActWalletTradeDTO walletTradeDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if (loginUserInfo == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | walletTradeDTO.setUserId(loginUserInfo.getUserId()); |
| | | Long communityId = loginUserInfo.getCommunityId(); |
| | | if (null == communityId || 0 == communityId) { |
| | | return R.fail("用户未绑定社区"); |
| | | } |
| | | walletTradeDTO.setCommunityId(communityId); |
| | | return communityService.getUserWalletTrade(walletTradeDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询收益排行榜", response = ComActWalletRankingVO.class) |
| | | @PostMapping("/get/ranking") |
| | | public R getWalletRanking(@RequestBody PageComActWalletTradeDTO walletTradeDTO) { |
| | | Long communityId = this.getCommunityId(); |
| | | if (null == communityId || 0 == communityId) { |
| | | return R.fail("用户未绑定社区"); |
| | | } |
| | | walletTradeDTO.setCommunityId(communityId); |
| | | return communityService.getWalletRanking(walletTradeDTO); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.vos.community.ComActWorkGuideAppletsVO; |
| | | import com.panzhihua.common.model.vos.community.ComActWorkGuideDetailAppletsVO; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.PageActWorkGuideDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActWorkGuideVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * @auther llming |
| | | * @describe 办事指南API |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/workguide/") |
| | | @Api(tags = {"办事指南API"}) |
| | | public class WorkGuideApi extends BaseController { |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @ApiOperation(value = "办事指南_分页", response = ComActWorkGuideVO.class) |
| | | @PostMapping("pageworkguide") |
| | | public R detailWorkGuide(@RequestBody PageActWorkGuideDTO pageActWorkGuideDTO) { |
| | | pageActWorkGuideDTO.setAreaCode(this.getAreaCode()); |
| | | return communityService.pageWorkGuide(pageActWorkGuideDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "办事指南_详情", response = ComActWorkGuideVO.class) |
| | | @GetMapping("detailworkguide") |
| | | public R detailWorkGuide(@RequestParam("workGuideId") String workGuideId, |
| | | @RequestParam(value = "communityId", required = false) Long communityId) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | communityId = loginUserInfo.getCommunityId(); |
| | | } |
| | | if(communityId==null || communityId<0) |
| | | { |
| | | return communityService.detailWorkGuide(workGuideId, ""); |
| | | } |
| | | return communityService.detailWorkGuide(workGuideId, communityId+""); |
| | | } |
| | | |
| | | @ApiOperation(value = "办事指南列表-按分类查询", response = ComActWorkGuideAppletsVO.class) |
| | | @PostMapping("list") |
| | | public R listWorkGuide(@RequestBody PageActWorkGuideDTO pageActWorkGuideDTO) { |
| | | pageActWorkGuideDTO.setAreaCode(this.getAreaCode()); |
| | | return communityService.listWorkGuide(pageActWorkGuideDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "办事指南列表-按分类查询", response = ComActWorkGuideDetailAppletsVO.class) |
| | | @GetMapping("list/classify") |
| | | public R listWorkGuideByClassifyId(@RequestParam("classifyId") Long classifyId) { |
| | | return communityService.listWorkGuideByClassifyId(classifyId); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import java.io.IOException; |
| | | import java.io.PrintWriter; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.panzhihua.applets.umf.MyAESUtil; |
| | | import com.panzhihua.applets.umf.UmfPayUtil; |
| | | import com.panzhihua.applets.unionpay.Query; |
| | | import com.panzhihua.applets.unionpay.QueryEntiy; |
| | | import com.panzhihua.applets.unionpay.Refund; |
| | | import com.panzhihua.common.model.dtos.wx.UnionpayCarWash; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.common.utlis.HttpClientUtil; |
| | | import com.umf.api.service.UmfService; |
| | | import com.umf.api.service.UmfServiceImpl; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import com.panzhihua.common.service.community.ComBatteryCommodityOrderFeign; |
| | | import org.json.XML; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.model.dtos.shop.WxPayNotifyOrderDTO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import static com.umf.api.service.UmfServiceImpl.printResult; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-14 15:02:49 |
| | | * @describe 微信支付回到函数 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/wx/") |
| | | public class WxCallbackApi { |
| | | |
| | | private static final String SUCCESS="SUCCESS"; |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | @Resource |
| | | private UmfPayUtil umfPayUtil; |
| | | @Value("${umf.file}") |
| | | private String file; |
| | | @Resource |
| | | private UserService userService; |
| | | @Resource |
| | | private ComBatteryCommodityOrderFeign commodityOrderFeign; |
| | | |
| | | |
| | | @PostMapping("wxNotify") |
| | | public void payCallback(HttpServletRequest request, HttpServletResponse response) { |
| | | log.error("微信支付回调start"); |
| | | String inputLine = ""; |
| | | String notityXml = ""; |
| | | try { |
| | | while ((inputLine = request.getReader().readLine()) != null) { |
| | | notityXml += inputLine; |
| | | } |
| | | // 关闭流 |
| | | request.getReader().close(); |
| | | log.error("微信回调内容信息:" + notityXml); |
| | | // 解析成Json |
| | | org.json.JSONObject xmlJson = XML.toJSONObject(notityXml); |
| | | if (StringUtils.isNotEmpty(xmlJson.toString())) { |
| | | JSONObject resultData = JSON.parseObject(xmlJson.get("xml").toString()); |
| | | // 成功支付订单 |
| | | if (resultData.getString("result_code").equals("SUCCESS") |
| | | && resultData.getString("return_code").equals("SUCCESS")) { |
| | | WxPayNotifyOrderDTO notifyOrderDTO = new WxPayNotifyOrderDTO(); |
| | | // 订单号 |
| | | String orderTradeNo = resultData.getString("out_trade_no"); |
| | | notifyOrderDTO.setOrderTradeNo(orderTradeNo); |
| | | // 微信支付订单号 |
| | | String wxTradeNo = resultData.getString("transaction_id"); |
| | | notifyOrderDTO.setWxTradeNo(wxTradeNo); |
| | | // 订单金额 |
| | | String totalFee = resultData.getString("total_fee"); |
| | | notifyOrderDTO.setTotalFee(totalFee); |
| | | // 支付完成时间 |
| | | String payTime = resultData.getString("time_end"); |
| | | notifyOrderDTO.setPayTime(payTime); |
| | | // 现金支付金额 |
| | | String cashFee = resultData.getString("cash_fee"); |
| | | notifyOrderDTO.setCashFee(cashFee); |
| | | |
| | | // 根据订单号修改订单信息 |
| | | communityService.wxOrderPayNotify(notifyOrderDTO); |
| | | |
| | | // 封装 返回值 |
| | | StringBuffer buffer = new StringBuffer(); |
| | | buffer.append("<xml>"); |
| | | buffer.append("<return_code>SUCCESS</return_code>"); |
| | | buffer.append("<return_msg>OK</return_msg>"); |
| | | buffer.append("</xml>"); |
| | | |
| | | // 给微信服务器返回 成功标示 否则会一直询问 咱们服务器 是否回调成功 |
| | | PrintWriter writer = response.getWriter(); |
| | | // 返回 |
| | | writer.print(buffer.toString()); |
| | | } else {// 未成功支付订单 |
| | | // 封装 返回值 |
| | | StringBuffer buffer = new StringBuffer(); |
| | | buffer.append("<xml>"); |
| | | buffer.append("<return_code>FAIL</return_code>"); |
| | | buffer.append("<return_msg>FAIL</return_msg>"); |
| | | buffer.append("</xml>"); |
| | | |
| | | // 给微信服务器返回 成功标示 否则会一直询问 咱们服务器 是否回调成功 |
| | | PrintWriter writer = response.getWriter(); |
| | | // 返回 |
| | | writer.print(buffer.toString()); |
| | | } |
| | | } |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | @GetMapping("wxNotifyAll") |
| | | public void payCallbackAll(HttpServletRequest request, HttpServletResponse response) { |
| | | //获取联动发送请求的参数 |
| | | String requestParam = request.getQueryString(); |
| | | System.out.println("花城洗车请求参数 :" + requestParam); |
| | | //调用异步通知解析方法 |
| | | UmfService service = new UmfServiceImpl("53461",file); |
| | | Map respMap = null; |
| | | try { |
| | | respMap = service.notifyDataParserMap(requestParam); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | if(respMap.get("error_code").equals("0000")){ |
| | | //调用uu洗车支付成功回调 |
| | | Map map=new HashMap(); |
| | | map.put("orderId",respMap.get("order_id")); |
| | | HttpClientUtil.sendPostByJson("https://uu-api.imashuo.com/notify/wx/pzh-pay",JSONObject.toJSONString(map), |
| | | 1,"appid","10000"); |
| | | log.error("花城洗车回调成功 :" + respMap.get("order_id")); |
| | | } |
| | | //调用SDK生成返回联动平台字符串,加到CONTENT中 |
| | | String resMetaData = service.responseUMFMap(respMap); |
| | | response.setContentType("text/html;charset=utf-8"); |
| | | PrintWriter out = null; |
| | | try { |
| | | out = response.getWriter(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | out.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">"); |
| | | out.println("<HTML>"); |
| | | out.println("<HEAD><META NAME=\"MobilePayPlatform\" CONTENT=\"" + resMetaData + "\" /></HEAD>"); |
| | | out.println("<BODY>"); |
| | | out.println("</BODY>"); |
| | | out.println("</HTML>"); |
| | | out.flush(); |
| | | out.close(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 银联支付回调专用 银联方面只能是有个post |
| | | * @param response |
| | | */ |
| | | @PostMapping("wxNotifyAllUnionpay") |
| | | public void payCallbackAllUnionpay(@RequestParam("merOrderId") String merOrderId, HttpServletResponse response) |
| | | { |
| | | //获取联动发送请求的参数 |
| | | log.error("花城洗车请求参数 :" + merOrderId); |
| | | log.error("花城洗车请求参数response :" + response.toString()); |
| | | //调用异步通知解析方法 |
| | | String content=Query.query(merOrderId); |
| | | QueryEntiy queryEntiy=JSONObject.parseObject(content,QueryEntiy.class); |
| | | log.error("花城洗车请求参数queryEntiy :" + queryEntiy.toString()); |
| | | if(queryEntiy.getErrCode().equals("SUCCESS")) |
| | | { |
| | | //查询银联单号对应的洗车单号 |
| | | R r=communityService.carWashById(merOrderId); |
| | | if(r.getCode()==200) |
| | | { |
| | | |
| | | HashMap unionpayCarWash= (HashMap) r.getData(); |
| | | //调用uu洗车支付成功回调 |
| | | Map map=new HashMap(); |
| | | map.put("orderId",unionpayCarWash.get("carWashId")); |
| | | HttpClientUtil.sendPostByJson("https://uu-api.imashuo.com/notify/wx/pzh-pay",JSONObject.toJSONString(map), |
| | | 1,"appid","10000"); |
| | | log.error("花城洗车回调成功 :" + queryEntiy.getMerOrderId()+" : 洗车号" |
| | | +unionpayCarWash.get("carWashId")+" : 银联号"+unionpayCarWash.get("unionpayOrderId")); |
| | | } |
| | | |
| | | } |
| | | //调用SDK生成返回联动平台字符串,加到CONTENT中 |
| | | response.setContentType("text/html;charset=utf-8"); |
| | | PrintWriter out = null; |
| | | try { |
| | | out = response.getWriter(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | out.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">"); |
| | | out.println("<HTML>"); |
| | | out.println("<HEAD><META NAME=\"MobilePayPlatform\" CONTENT=\"" + content + "\" /></HEAD>"); |
| | | out.println("<BODY>"); |
| | | out.println("</BODY>"); |
| | | out.println("</HTML>"); |
| | | out.flush(); |
| | | out.close(); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("uu洗车退款接口") |
| | | @PostMapping("/uuRepay") |
| | | public R uuRepay(@RequestBody String aesString) |
| | | { |
| | | try { |
| | | Map<String, String> aesMap= (Map<String, String>) JSON.parse(aesString); |
| | | String desString=MyAESUtil.Decrypt(aesMap.get("aesString"),"Ryo7M3n8loC5Abcd"); |
| | | Map<String,String> desMap= (Map) JSON.parse(desString); |
| | | Map map=umfPayUtil.repay(desMap.get("orderId"),desMap.get("merdate"), DateUtils.getDateFormatString(new Date(), |
| | | "yyMMddHHmmss")+"0001",desMap.get("refundAmount"),desMap.get("orgAmount")); |
| | | |
| | | if(desMap.get("orderId")!=null) |
| | | { |
| | | R r=communityService.queryById(desMap.get("orderId")); |
| | | if(r.getCode()==200) |
| | | { |
| | | HashMap wash= (HashMap) r.getData(); |
| | | if(wash!=null) |
| | | { |
| | | String re=Refund.sendOrder(wash.get("money").toString(), |
| | | wash.get("unionpayOrderId").toString()); |
| | | map.put("unionpay","退款成功"); |
| | | log.error("花城洗车银联退款成功 :" + re); |
| | | } |
| | | |
| | | } |
| | | } |
| | | return R.ok(map); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return R.fail("加密验证失败"); |
| | | } |
| | | |
| | | } |
| | | @ApiOperation("uu洗车推送") |
| | | @PostMapping("/uuPush") |
| | | public R uuPush(@RequestBody String aesString){ |
| | | try { |
| | | Map<String, String> aesMap= (Map<String, String>) JSON.parse(aesString); |
| | | String desString=MyAESUtil.Decrypt(aesMap.get("aesString"),"Ryo7M3n8loC5Abcd"); |
| | | Map<String,String> desMap= (Map) JSON.parse(desString); |
| | | return userService.uuPush(desMap.get("washer_mobile"),desMap.get("phone"),desMap.get("washer_name"),Integer.parseInt(desMap.get("order_status"))); |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return R.fail("推送失败"); |
| | | } |
| | | |
| | | } |
| | | @ApiOperation("ws洗车推送") |
| | | @PostMapping("/wsPush") |
| | | public R wsPush(@RequestBody String aesString){ |
| | | try { |
| | | Map<String, String> aesMap= (Map<String, String>) JSON.parse(aesString); |
| | | String desString=MyAESUtil.Decrypt(aesMap.get("aesString"),"Ryo7M3n8loC5Abcd"); |
| | | Map<String,String> desMap= (Map) JSON.parse(desString); |
| | | return userService.wsPush(desMap.get("washer_mobile"),desMap.get("phone"),desMap.get("washer_name"),Integer.parseInt(desMap.get("order_status"))); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return R.fail("推送失败"); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 电动车商城商品购买支付回调 |
| | | * @param request 请求参数 |
| | | * @param response 返回参数 |
| | | */ |
| | | @PostMapping("/batteryPayNotify") |
| | | public void batteryPayNotify(HttpServletRequest request, HttpServletResponse response) { |
| | | log.info("钱包充值微信支付回调start"); |
| | | String inputLine = ""; |
| | | String notityXml = ""; |
| | | try { |
| | | while ((inputLine = request.getReader().readLine()) != null) { |
| | | notityXml += inputLine; |
| | | } |
| | | // 关闭流 |
| | | request.getReader().close(); |
| | | log.info("钱包充值微信回调内容信息:" + notityXml); |
| | | // 解析成Json |
| | | org.json.JSONObject xmlJson = XML.toJSONObject(notityXml); |
| | | if (StringUtils.isNotEmpty(xmlJson.toString())) { |
| | | JSONObject resultData = JSON.parseObject(xmlJson.get("xml").toString()); |
| | | // 成功支付订单 |
| | | if (SUCCESS.equals(resultData.getString("result_code")) && SUCCESS.equals(resultData.getString("result_code"))){ |
| | | WxPayNotifyOrderDTO notifyOrderDTO = getWxNotify(resultData); |
| | | |
| | | // 根据订单号修改订单信息 |
| | | commodityOrderFeign.batteryPayNotify(notifyOrderDTO); |
| | | // 给微信服务器返回 成功标示 否则会一直询问 咱们服务器 是否回调成功 |
| | | PrintWriter writer = response.getWriter(); |
| | | // 返回 |
| | | writer.print(getWxSuccessString()); |
| | | } else {// 未成功支付订单 |
| | | // 给微信服务器返回 成功标示 否则会一直询问 咱们服务器 是否回调成功 |
| | | PrintWriter writer = response.getWriter(); |
| | | // 返回 |
| | | writer.print(getWxFailString()); |
| | | } |
| | | } |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | @PostMapping("/batteryActivityPayNotify") |
| | | public void batteryActivityPayNotify(HttpServletRequest request, HttpServletResponse response) { |
| | | log.info("购买活动商品微信支付回调start"); |
| | | String inputLine = ""; |
| | | String notityXml = ""; |
| | | try { |
| | | while ((inputLine = request.getReader().readLine()) != null) { |
| | | notityXml += inputLine; |
| | | } |
| | | // 关闭流 |
| | | request.getReader().close(); |
| | | log.info("购买活动商品微信回调内容信息:" + notityXml); |
| | | // 解析成Json |
| | | org.json.JSONObject xmlJson = XML.toJSONObject(notityXml); |
| | | if (StringUtils.isNotEmpty(xmlJson.toString())) { |
| | | JSONObject resultData = JSON.parseObject(xmlJson.get("xml").toString()); |
| | | // 成功支付订单 |
| | | if (SUCCESS.equals(resultData.getString("result_code")) && SUCCESS.equals(resultData.getString("result_code"))){ |
| | | WxPayNotifyOrderDTO notifyOrderDTO = getWxNotify(resultData); |
| | | |
| | | // 根据订单号修改订单信息 |
| | | commodityOrderFeign.batteryActivityPayNotify(notifyOrderDTO); |
| | | // 给微信服务器返回 成功标示 否则会一直询问 咱们服务器 是否回调成功 |
| | | PrintWriter writer = response.getWriter(); |
| | | // 返回 |
| | | writer.print(getWxSuccessString()); |
| | | } else {// 未成功支付订单 |
| | | // 给微信服务器返回 成功标示 否则会一直询问 咱们服务器 是否回调成功 |
| | | PrintWriter writer = response.getWriter(); |
| | | // 返回 |
| | | writer.print(getWxFailString()); |
| | | } |
| | | } |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 将微信支付回调的请求参数转义为对象 |
| | | * @param resultData 微信支付回调请求参数 |
| | | * @return 转义为支付请求参数 |
| | | */ |
| | | private WxPayNotifyOrderDTO getWxNotify(JSONObject resultData){ |
| | | WxPayNotifyOrderDTO notifyOrderDTO = new WxPayNotifyOrderDTO(); |
| | | notifyOrderDTO.setResult(resultData.toJSONString()); |
| | | // 订单号 |
| | | String orderTradeNo = resultData.getString("out_trade_no"); |
| | | notifyOrderDTO.setOrderTradeNo(orderTradeNo); |
| | | // 微信支付订单号 |
| | | String wxTradeNo = resultData.getString("transaction_id"); |
| | | notifyOrderDTO.setWxTradeNo(wxTradeNo); |
| | | // 订单金额 |
| | | String totalFee = resultData.getString("total_fee"); |
| | | notifyOrderDTO.setTotalFee(totalFee); |
| | | // 支付完成时间 |
| | | String payTime = resultData.getString("time_end"); |
| | | notifyOrderDTO.setPayTime(payTime); |
| | | // 现金支付金额 |
| | | String cashFee = resultData.getString("cash_fee"); |
| | | notifyOrderDTO.setCashFee(cashFee); |
| | | //附加数据 |
| | | String attach = resultData.getString("attach"); |
| | | notifyOrderDTO.setAttach(attach); |
| | | return notifyOrderDTO; |
| | | } |
| | | |
| | | /** |
| | | * 封装微信成功返回值 |
| | | * @return 成功返回值 |
| | | */ |
| | | private String getWxSuccessString(){ |
| | | StringBuffer buffer = new StringBuffer(); |
| | | buffer.append("<xml>"); |
| | | buffer.append("<return_code>SUCCESS</return_code>"); |
| | | buffer.append("<return_msg>OK</return_msg>"); |
| | | buffer.append("</xml>"); |
| | | return buffer.toString(); |
| | | } |
| | | |
| | | /** |
| | | * 封装微信失败返回值 |
| | | * @return 失败返回值 |
| | | */ |
| | | private String getWxFailString(){ |
| | | StringBuffer buffer = new StringBuffer(); |
| | | buffer.append("<xml>"); |
| | | buffer.append("<return_code>FAIL</return_code>"); |
| | | buffer.append("<return_msg>FAIL</return_msg>"); |
| | | buffer.append("</xml>"); |
| | | return buffer.toString(); |
| | | } |
| | | |
| | | @GetMapping("/settle") |
| | | public R settle(String settleDate){ |
| | | return R.ok(umfPayUtil.settle(settleDate)); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/flower/wxNotify") |
| | | @ApiOperation("花城支付回调") |
| | | public void flowerWxNotify(HttpServletRequest request, HttpServletResponse response) { |
| | | log.error("微信支付回调start"); |
| | | String inputLine = ""; |
| | | String notityXml = ""; |
| | | try { |
| | | while ((inputLine = request.getReader().readLine()) != null) { |
| | | notityXml += inputLine; |
| | | } |
| | | // 关闭流 |
| | | request.getReader().close(); |
| | | log.error("微信回调内容信息:" + notityXml); |
| | | // 解析成Json |
| | | org.json.JSONObject xmlJson = XML.toJSONObject(notityXml); |
| | | if (StringUtils.isNotEmpty(xmlJson.toString())) { |
| | | JSONObject resultData = JSON.parseObject(xmlJson.get("xml").toString()); |
| | | // 成功支付订单 |
| | | if (resultData.getString("result_code").equals("SUCCESS") |
| | | && resultData.getString("return_code").equals("SUCCESS")) { |
| | | WxPayNotifyOrderDTO notifyOrderDTO = new WxPayNotifyOrderDTO(); |
| | | // 订单号 |
| | | String orderTradeNo = resultData.getString("out_trade_no"); |
| | | notifyOrderDTO.setOrderTradeNo(orderTradeNo); |
| | | // 微信支付订单号 |
| | | String wxTradeNo = resultData.getString("transaction_id"); |
| | | notifyOrderDTO.setWxTradeNo(wxTradeNo); |
| | | // 订单金额 |
| | | String totalFee = resultData.getString("total_fee"); |
| | | notifyOrderDTO.setTotalFee(totalFee); |
| | | // 支付完成时间 |
| | | String payTime = resultData.getString("time_end"); |
| | | notifyOrderDTO.setPayTime(payTime); |
| | | // 现金支付金额 |
| | | String cashFee = resultData.getString("cash_fee"); |
| | | notifyOrderDTO.setCashFee(cashFee); |
| | | |
| | | // 根据订单号修改订单信息 |
| | | communityService.wxOrderPayNotifyFlower(notifyOrderDTO); |
| | | |
| | | // 封装 返回值 |
| | | StringBuffer buffer = new StringBuffer(); |
| | | buffer.append("<xml>"); |
| | | buffer.append("<return_code>SUCCESS</return_code>"); |
| | | buffer.append("<return_msg>OK</return_msg>"); |
| | | buffer.append("</xml>"); |
| | | |
| | | // 给微信服务器返回 成功标示 否则会一直询问 咱们服务器 是否回调成功 |
| | | PrintWriter writer = response.getWriter(); |
| | | // 返回 |
| | | writer.print(buffer.toString()); |
| | | } else {// 未成功支付订单 |
| | | // 封装 返回值 |
| | | StringBuffer buffer = new StringBuffer(); |
| | | buffer.append("<xml>"); |
| | | buffer.append("<return_code>FAIL</return_code>"); |
| | | buffer.append("<return_msg>FAIL</return_msg>"); |
| | | buffer.append("</xml>"); |
| | | |
| | | // 给微信服务器返回 成功标示 否则会一直询问 咱们服务器 是否回调成功 |
| | | PrintWriter writer = response.getWriter(); |
| | | // 返回 |
| | | writer.print(buffer.toString()); |
| | | } |
| | | } |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import java.io.PrintWriter; |
| | | import java.security.MessageDigest; |
| | | import java.util.Arrays; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.common.utlis.WxUtil; |
| | | import com.panzhihua.common.utlis.WxXCXTempSend; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/wx/push/") |
| | | public class WxMessagePushApi { |
| | | |
| | | private String token = "01A9CB2234D7CBD0AC61B75EB1263805"; |
| | | |
| | | private String url = "www.taobao.com";// 图文跳转地址 |
| | | |
| | | private String thumbUrl = "https://www.psciio.com//idcard/f986ba3ae7a241d9bce5cb568adec7da.jpg";// 图片地址 |
| | | |
| | | @Resource |
| | | private WxXCXTempSend wxXCXTempSend; |
| | | |
| | | /** |
| | | * 微信接口配置信息认证接口<br> |
| | | * 需要正确响应微信发送的Token验证。 加密/校验流程如下:<br> |
| | | * 1. 将token、timestamp、nonce三个参数进行字典序排序<br> |
| | | * 2. 将三个参数字符串拼接成一个字符串进行sha1加密<br> |
| | | * 3. 开发者获得加密后的字符串可与signature对比,标识该请求来源于微信 |
| | | */ |
| | | @RequestMapping("/cgi") |
| | | public void cgi(HttpServletRequest request, HttpServletResponse response) { |
| | | boolean isGet = request.getMethod().toLowerCase().equals("get"); |
| | | // 微信加密签名,signature结合了开发者填写的token参数和请求中的timestamp参数、nonce参数。 |
| | | try { |
| | | if (isGet) { |
| | | String signature = request.getParameter("signature"); |
| | | // 时间戳 |
| | | String timestamp = request.getParameter("timestamp"); |
| | | // 随机数 |
| | | String nonce = request.getParameter("nonce"); |
| | | // 随机字符串 |
| | | String echostr = request.getParameter("echostr"); |
| | | log.info("signature = " + signature + " , timestamp = " + timestamp + " , nonce = " + nonce |
| | | + " , echostr = " + echostr); |
| | | String[] strArray = new String[] {token, timestamp, nonce}; |
| | | Arrays.sort(strArray); |
| | | StringBuilder sb = new StringBuilder(); |
| | | for (String str : strArray) { |
| | | sb.append(str); |
| | | } |
| | | // SHA1签名生成 |
| | | MessageDigest md = MessageDigest.getInstance("SHA-1"); |
| | | md.update(sb.toString().getBytes()); |
| | | byte[] digest = md.digest(); |
| | | |
| | | StringBuffer hexstr = new StringBuffer(); |
| | | String shaHex = ""; |
| | | for (int i = 0; i < digest.length; i++) { |
| | | shaHex = Integer.toHexString(digest[i] & 0xFF); |
| | | if (shaHex.length() < 2) { |
| | | hexstr.append(0); |
| | | } |
| | | hexstr.append(shaHex); |
| | | } |
| | | |
| | | if (hexstr.toString().equals(signature)) { |
| | | response.getOutputStream().write(echostr.getBytes()); |
| | | } |
| | | |
| | | } else { |
| | | // 进入POST聊天处理 |
| | | // 将请求、响应的编码均设置为UTF-8(防止中文乱码) |
| | | request.setCharacterEncoding("UTF-8"); |
| | | response.setCharacterEncoding("UTF-8"); |
| | | // 接收消息并返回消息 |
| | | String result = acceptMessage(request, response); |
| | | |
| | | // 响应消息 |
| | | PrintWriter out = response.getWriter(); |
| | | out.print(result); |
| | | out.close(); |
| | | } |
| | | } catch (Exception ex) { |
| | | log.error("微信帐号接口配置失败!", ex); |
| | | ex.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 接受到微信接口数据 |
| | | * |
| | | * @param request |
| | | * @param response |
| | | * @return |
| | | */ |
| | | private String acceptMessage(HttpServletRequest request, HttpServletResponse response) { |
| | | String respMessage = ""; |
| | | String inputLine = ""; |
| | | String notityXml = ""; |
| | | try { |
| | | // 接收数据 |
| | | while ((inputLine = request.getReader().readLine()) != null) { |
| | | notityXml += inputLine; |
| | | } |
| | | |
| | | // xml请求解析 |
| | | JSONObject requestJson = JSON.parseObject(notityXml); |
| | | log.info(">>>>>>>>>>>>>" + requestJson.toString()); |
| | | // 发送方帐号(open_id) |
| | | String fromUserName = requestJson.get("FromUserName").toString(); |
| | | // 公众帐号 |
| | | String toUserName = requestJson.get("ToUserName").toString(); |
| | | // 消息类型 |
| | | String msgType = requestJson.get("MsgType").toString(); |
| | | // String Event = requestJson.get("Event").toString(); //SCAN 为扫描信息 VIEW 公众号底部点击事件 |
| | | log.info("fromUserName = " + fromUserName + " , ToUserName = " + toUserName + " , msgType = " + msgType); |
| | | |
| | | String access_token = wxXCXTempSend.getAccessToken();// 获取access_token |
| | | |
| | | // 公众号关注事件消息 |
| | | if (msgType.equals("event")) { |
| | | // log.info("公众号被关注事件.........."); |
| | | } else if (msgType.equals("text")) { |
| | | // if(StringUtils.isNotEmpty(access_token)){ |
| | | // String mediaId = wxXCXTempSend.getMediaId(access_token);//获取mediaId |
| | | // WxUtil.sendKfImagesMessage(fromUserName,access_token,mediaId); |
| | | // } |
| | | // log.info("公众号接受文字.........."); |
| | | } else if (msgType.equals("image")) { |
| | | // log.info("公众号接受图片.........."); |
| | | } else if (msgType.equals("miniprogrampage")) { |
| | | if (StringUtils.isNotEmpty(access_token)) { |
| | | String mediaId = wxXCXTempSend.getMediaId(access_token);// 获取mediaId |
| | | WxUtil.sendKfImagesMessage(fromUserName, access_token, mediaId); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return respMessage; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.applets.config.WxMaConfiguration; |
| | | import com.panzhihua.common.constants.UserConstants; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.utlis.HttpClientUtil; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.data.redis.core.ValueOperations; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.*; |
| | | import java.net.HttpURLConnection; |
| | | import java.net.URL; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/official") |
| | | public class WxOfficialApi { |
| | | |
| | | @Resource |
| | | private StringRedisTemplate stringRedisTemplate; |
| | | // 公众号appid |
| | | private List<String> appidList = new ArrayList<String>() { |
| | | { |
| | | this.add("wx7c733ebbf6c55ecf"); |
| | | this.add("wxc94f0cddf13577d5"); |
| | | } |
| | | }; |
| | | // 公众号secret |
| | | private List<String> secretList = new ArrayList<String>() { |
| | | { |
| | | this.add("500290552cbfdd1c1c18131c5807b6ae"); |
| | | this.add("3418127405845701497a09f65678953f"); |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 微信公众号请求头设置 |
| | | */ |
| | | public static Map<String, String> getWxHeaderMap() { |
| | | Map<String, String> map = new HashMap<>(new LinkedHashMap()); |
| | | map.put("Accept", "text/html, application/xhtml+xml, image/jxr, */*"); |
| | | map.put("Accept-Encoding", "gzip, deflate"); |
| | | map.put("Accept-Language", "zh-Hans-CN, zh-Hans; q=0.8, en-US; q=0.5, en; q=0.3"); |
| | | map.put("Host", "mp.weixin.qq.com"); |
| | | map.put("If-Modified-Since", "Sat, 04 Jan 2020 12:23:43 GMT"); |
| | | map.put("User-Agent", "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko"); |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 根据文章链接抓取文章内容 |
| | | * |
| | | * @param url 文章链接 |
| | | * @return 文章内容 |
| | | */ |
| | | public static String getActicle(String url) { |
| | | // post发送的参数 |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("type", "news"); // news表示图文类型的素材,具体看API文档 |
| | | map.put("offset", 0); |
| | | map.put("count", 5); |
| | | // 将map转换成json字符串 |
| | | String paramBody = JSON.toJSONString(map); |
| | | return HttpClientUtil.get(url, getWxHeaderMap(), paramBody); |
| | | } |
| | | |
| | | /** |
| | | * 获取token |
| | | * |
| | | * @param appid 公众号appid |
| | | * @param secret 公众号secret |
| | | * @return token |
| | | */ |
| | | private String getToken(String appid, String secret) throws IOException { |
| | | // access_token接口https请求方式: GET |
| | | // https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=APPID&secret=APPSECRET |
| | | |
| | | String path = " https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential"; |
| | | URL url = new URL(path + "&appid=" + appid + "&secret=" + secret); |
| | | HttpURLConnection connection = (HttpURLConnection)url.openConnection(); |
| | | connection.setRequestMethod("GET"); |
| | | connection.connect(); |
| | | |
| | | InputStream in = connection.getInputStream(); |
| | | byte[] b = new byte[100]; |
| | | int len = -1; |
| | | StringBuffer sb = new StringBuffer(); |
| | | while ((len = in.read(b)) != -1) { |
| | | sb.append(new String(b, 0, len)); |
| | | } |
| | | |
| | | in.close(); |
| | | |
| | | |
| | | return sb.toString(); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 通过token获取公众号文章 |
| | | * |
| | | * @param token token |
| | | * @return 获取的文章列表结果 |
| | | */ |
| | | private String getContentList(String token) throws IOException { |
| | | String path = " https://api.weixin.qq.com/cgi-bin/material/batchget_material?access_token=" + token; |
| | | URL url = new URL(path); |
| | | HttpURLConnection connection = (HttpURLConnection) url.openConnection(); |
| | | connection.setRequestMethod("POST"); |
| | | connection.setDoOutput(true); |
| | | connection.setRequestProperty("content-type", "application/json;charset=utf-8"); |
| | | connection.connect(); |
| | | // post发送的参数 |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("type", "news"); // news表示图文类型的素材,具体看API文档 |
| | | map.put("offset", 0); |
| | | map.put("count", 5); |
| | | // 将map转换成json字符串 |
| | | String paramBody = JSON.toJSONString(map); // 这里用了Alibaba的fastjson |
| | | |
| | | OutputStream out = connection.getOutputStream(); |
| | | BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(out, StandardCharsets.UTF_8)); |
| | | bw.write(paramBody); // 向流中写入参数字符串 |
| | | bw.flush(); |
| | | |
| | | InputStream in = connection.getInputStream(); |
| | | byte[] b = new byte[100]; |
| | | int len = -1; |
| | | StringBuffer sb = new StringBuffer(); |
| | | while ((len = in.read(b)) != -1) { |
| | | sb.append(new String(b, 0, len, StandardCharsets.UTF_8)); |
| | | } |
| | | |
| | | in.close(); |
| | | return sb.toString(); |
| | | } |
| | | |
| | | @ApiOperation(value = "拉取公众号列表") |
| | | @GetMapping(value = "/list/noToken", produces = "application/json;charset=utf-8") |
| | | public R pageDiscuss() throws Exception { |
| | | WxOfficialApi officialApi = new WxOfficialApi(); |
| | | |
| | | ValueOperations<String, String> valueOperations = stringRedisTemplate.opsForValue(); |
| | | List<String> tokenList = new ArrayList<>(); |
| | | if (!appidList.isEmpty()) { |
| | | for (int i = 0; i < appidList.size(); i++) { |
| | | String token = officialApi.getToken(appidList.get(i), secretList.get(i)); |
| | | JSONObject tokenJson = JSON.parseObject(token); |
| | | if (StringUtils.isNotEmpty(tokenJson)) { |
| | | tokenList.add(tokenJson.getString("access_token")); |
| | | if (StringUtils.isNotEmpty(token)) { |
| | | tokenList.add(token); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | List<JSONObject> resultList = new ArrayList<>(); |
| | | Boolean newsListKey = stringRedisTemplate.hasKey(UserConstants.NEWS_LIST); |
| | | if (newsListKey != null && newsListKey) { |
| | | String json = valueOperations.get(UserConstants.NEWS_LIST); |
| | | resultList = JSON.parseArray(json, JSONObject.class); |
| | | return R.ok(resultList); |
| | | } |
| | | if (!tokenList.isEmpty()) { |
| | | for (String token : tokenList) { |
| | | try { |
| | | String url = "https://api.weixin.qq.com/cgi-bin/material/batchget_material?access_token=" + token; |
| | | String result = getActicle(url); |
| | | // log.info("通过token获取文章列表成功,返回结果:" + result); |
| | | |
| | | JSONObject resultJson = JSON.parseObject(result); |
| | | if (resultJson != null) { |
| | | List<JSONObject> itemList = JSON.parseArray(resultJson.getString("item"), JSONObject.class); |
| | | if (!itemList.isEmpty()) { |
| | | for (JSONObject object : itemList) { |
| | | String newsId = object.getString("media_id"); |
| | | JSONObject contentJson = JSON.parseObject(object.getString("content")); |
| | | List<JSONObject> newsItemList = |
| | | JSON.parseArray(contentJson.getString("news_item"), JSONObject.class); |
| | | String newsUrl = newsItemList.get(0).getString("url"); |
| | | newsItemList.get(0).put("news_id", newsId); |
| | | contentJson.put("news_item", newsItemList); |
| | | object.put("content", contentJson); |
| | | |
| | | valueOperations.set(UserConstants.NEWS_ID + newsId, newsUrl + "", 2, TimeUnit.DAYS); |
| | | } |
| | | } |
| | | resultJson.put("item", itemList); |
| | | } |
| | | resultList.add(resultJson); |
| | | } catch (Exception e) { |
| | | log.error("通过token获取文章列表失败,错误原因:" + e.getMessage()); |
| | | } |
| | | valueOperations.set(UserConstants.NEWS_LIST, resultList.toString(), 12, TimeUnit.HOURS); |
| | | } |
| | | } |
| | | return R.ok(resultList); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取公众号文章链接") |
| | | @GetMapping(value = "/get/noToken") |
| | | public R getDiscuss(@RequestParam("mediaId") String mediaId) { |
| | | |
| | | String key = UserConstants.NEWS_ID + mediaId; |
| | | Boolean hasKey = stringRedisTemplate.hasKey(key); |
| | | if (!hasKey) { |
| | | return R.fail("未找到该文章的链接地址"); |
| | | } |
| | | |
| | | ValueOperations<String, String> valueOperations = stringRedisTemplate.opsForValue(); |
| | | String url = valueOperations.get(key); |
| | | return R.ok(url); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.VolunteerCreditsExchangeVO; |
| | | import com.panzhihua.common.model.vos.community.VolunteerMerchantEvaluateVO; |
| | | import com.panzhihua.common.model.vos.community.VolunteerMerchantVO; |
| | | import com.panzhihua.common.model.vos.community.VolunteerMerchantWithdrawVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import io.swagger.annotations.Api; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/XmostBeautiful") |
| | | @Api(tags = {"小程序志愿者活动"}) |
| | | public class XmostBeautifulApi extends BaseController |
| | | { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | /** |
| | | * 查询单个 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | @GetMapping("/queryById") |
| | | public R queryById(@RequestParam("id") String Id) |
| | | { |
| | | if(StringUtils.isEmpty(Id)) |
| | | { |
| | | return R.fail("id不能为空"); |
| | | } |
| | | return communityService.queryById2(Id); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param name |
| | | * @param unmountType |
| | | * @return |
| | | */ |
| | | @GetMapping("/getqueryList") |
| | | public R queryList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize")int pageSize, |
| | | @RequestParam(value = "name", required = false) String name, |
| | | @RequestParam(value = "unmountType", required = false) String unmountType) |
| | | { |
| | | return communityService.queryList(pageNum,pageSize,name,unmountType); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询单个志愿者活动详情 |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | @GetMapping("/volunteerQueryById") |
| | | public R volunteerQueryById(@RequestParam("id") String Id) |
| | | { |
| | | if(StringUtils.isEmpty(Id)) |
| | | { |
| | | return R.fail("id不能为空"); |
| | | } |
| | | return communityService.volunteerQueryById(Id); |
| | | } |
| | | |
| | | /*********************************************************************************************************** |
| | | * |
| | | * |
| | | * 订单兑换 |
| | | * |
| | | * |
| | | ***********************************************************************************************************/ |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @GetMapping("/order/getList") |
| | | public R orderMerchantGetList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize, |
| | | @RequestParam(value = "goodsId", required = false) String goodsId, |
| | | @RequestParam(value = "orderNumber", required = false) String orderNumber, |
| | | @RequestParam(value = "goodsName", required = false) String goodsName, |
| | | @RequestParam(value = "condition", required = false) String condition, |
| | | @RequestParam(value = "userName", required = false) String userName, |
| | | @RequestParam(value = "communityId", required = false) String communityId, |
| | | @RequestParam(value = "orderType", required = false) String orderType, |
| | | @RequestParam(value = "merchantId", required = false) String merchantId) |
| | | { |
| | | if(StringUtils.isEmpty(communityId)) |
| | | { |
| | | communityId=getCommunityId()+""; |
| | | } |
| | | |
| | | String userId=null; |
| | | |
| | | if(StringUtils.isEmpty(merchantId)) |
| | | { |
| | | userId=getUserId()+""; |
| | | } |
| | | |
| | | return communityService.getList(pageNum,pageSize,goodsId,orderNumber,goodsName, |
| | | condition,userName,communityId,userId,orderType,merchantId); |
| | | } |
| | | |
| | | /** |
| | | * 新增用户购买商家商品记录 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @PostMapping("/order/insertMerchantData") |
| | | public R insertMerchantData(@RequestBody VolunteerCreditsExchangeVO item) |
| | | { |
| | | |
| | | if(StringUtils.isEmpty(item.getPalyIntegral())) |
| | | { |
| | | return R.fail("请输入兑换积分"); |
| | | } |
| | | |
| | | LoginUserInfoVO userInfoVO= getLoginUserInfo(); |
| | | if(StringUtils.isEmpty(item.getCommunityId())) |
| | | { |
| | | item.setCommunityId(userInfoVO.getCommunityId()+""); |
| | | } |
| | | item.setOrderType("2"); |
| | | item.setUserId(userInfoVO.getUserId()+""); |
| | | item.setNeedScore(userInfoVO.getLoveIntegral()); |
| | | return communityService.insertMerchantData(item); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 更新商家订单 |
| | | * @param item |
| | | * @return |
| | | */ |
| | | @PostMapping("/order/MerchantUpdate") |
| | | public R orderMerchantUpdate(@RequestBody VolunteerCreditsExchangeVO item) |
| | | { |
| | | item.setOrderType("2"); |
| | | return communityService.update(item); |
| | | } |
| | | |
| | | /** |
| | | * 查询详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("order/getData") |
| | | public R getData(@RequestParam("id") String id) |
| | | { |
| | | if(StringUtils.isEmpty(id)) |
| | | { |
| | | return R.fail("订单id不能为空"); |
| | | } |
| | | return communityService.getData(id); |
| | | } |
| | | |
| | | /** |
| | | * 新增社区 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @PostMapping("/order/insertData") |
| | | public R insertData(@RequestBody VolunteerCreditsExchangeVO item) |
| | | { |
| | | LoginUserInfoVO userInfoVO= getLoginUserInfo(); |
| | | if(StringUtils.isEmpty(item.getCommunityId())) |
| | | { |
| | | item.setCommunityId(userInfoVO.getCommunityId()+""); |
| | | } |
| | | item.setOrderType("1"); |
| | | item.setUserId(userInfoVO.getUserId()+""); |
| | | item.setNeedScore(userInfoVO.getLoveIntegral()); |
| | | return communityService.insertData(item); |
| | | } |
| | | |
| | | /** |
| | | * 更新社区 |
| | | * @param item |
| | | * @return |
| | | */ |
| | | @PostMapping("/order/update") |
| | | public R update(@RequestBody VolunteerCreditsExchangeVO item) |
| | | { |
| | | item.setOrderType("1"); |
| | | return communityService.update(item); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/order/delete") |
| | | public R delete(@RequestParam("id") String id) |
| | | { |
| | | if(StringUtils.isEmpty(id)) |
| | | { |
| | | return R.fail("订单id不能为空"); |
| | | } |
| | | return communityService.delete(id); |
| | | } |
| | | |
| | | /** |
| | | * 核销社区 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/order/conditionData") |
| | | public R conditionData(@RequestParam("id") String id) |
| | | { |
| | | if(StringUtils.isEmpty(id)) |
| | | { |
| | | return R.fail("订单id不能为空"); |
| | | } |
| | | return communityService.conditionData(id); |
| | | } |
| | | |
| | | /************************************************************************************* |
| | | * |
| | | * 路北社区商家模块 |
| | | * |
| | | **************************************************************************************/ |
| | | /** |
| | | * 分页查询 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @GetMapping("/getList") |
| | | public R volunteerMerchantGetList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize, |
| | | @RequestParam(value = "merchantState", required = false) String merchantState, |
| | | @RequestParam(value = "merchantType", required = false) String merchantType, |
| | | @RequestParam(value = "name", required = false) String name) |
| | | { |
| | | return communityService.volunteerMerchantGetList(pageNum, pageSize,merchantState,merchantType,name,getCommunityId()+""); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询商家分类 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @GetMapping("/VolunteerMerchant/getList") |
| | | public R merchantvolunteerTypeGetList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize) |
| | | { |
| | | return communityService.volunteerTypeGetList(pageNum,pageSize,"2"); |
| | | } |
| | | |
| | | /** |
| | | * 修改商家 |
| | | * @param vtvo |
| | | * @return |
| | | */ |
| | | @PostMapping("/VolunteerMerchant/update") |
| | | public R updateVolunteerMerchant(@RequestBody VolunteerMerchantVO vtvo) |
| | | { |
| | | return communityService.updateVolunteerMerchant(vtvo); |
| | | } |
| | | |
| | | /** |
| | | * 获取商家详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/VolunteerMerchant/getById") |
| | | public R volunteerMerchantGetById(@RequestParam("id") String id) |
| | | { |
| | | return communityService.volunteerMerchantGetById(id); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 是否是商家 |
| | | * @return |
| | | */ |
| | | @GetMapping("/VolunteerMerchant/isMerchant") |
| | | public R isMerchant(@RequestParam("userId") String userId) |
| | | { |
| | | return communityService.isMerchant(userId); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 社区取消订单 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/order/communityCancellation") |
| | | public R communityCancellation(@RequestParam("id") String id) |
| | | { |
| | | return communityService.communityCancellation(id); |
| | | } |
| | | |
| | | /** |
| | | * 用户设置积分支付密码 |
| | | * @param userId |
| | | * @param pwd |
| | | * @return |
| | | */ |
| | | @GetMapping("/setUserPlayPwd") |
| | | public R setUserPlayPwd(@RequestParam("userId") String userId,@RequestParam("pwd") String pwd) |
| | | { |
| | | if (StringUtils.isEmpty(userId)) |
| | | { |
| | | return R.fail("userId不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(pwd)) |
| | | { |
| | | return R.fail("密码不能为空"); |
| | | } |
| | | |
| | | LoginUserInfoVO loginUserInfoVO=new LoginUserInfoVO(); |
| | | loginUserInfoVO.setUserId(Long.valueOf(userId)); |
| | | loginUserInfoVO.setPlayPwd(pwd); |
| | | return userService.putUser(loginUserInfoVO); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 判断密码是否正确 |
| | | * @param userId |
| | | * @param pwd |
| | | * @return |
| | | */ |
| | | @GetMapping("/passwordIsCorrect") |
| | | public R passwordIsCorrect(@RequestParam("userId") String userId,@RequestParam("pwd") String pwd) |
| | | { |
| | | if (StringUtils.isEmpty(userId)) |
| | | { |
| | | return R.fail("userId不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(pwd)) |
| | | { |
| | | return R.fail("密码不能为空"); |
| | | } |
| | | LoginUserInfoVO loginUserInfoVO=userService.getUserInfoByUserId(userId).getData(); |
| | | if(StringUtils.isEmpty(loginUserInfoVO.getPlayPwd())) |
| | | { |
| | | return R.fail(304,"您还未设置密码!"); |
| | | } |
| | | |
| | | |
| | | if(StringUtils.equals(pwd,loginUserInfoVO.getPlayPwd())) |
| | | { |
| | | return R.ok(); |
| | | } |
| | | return R.fail("密码错误"); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /**************************************************************************************************************** |
| | | * |
| | | * 商家评论 |
| | | * |
| | | ***************************************************************************************************************/ |
| | | |
| | | /** |
| | | * 商家评论分页查询 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @GetMapping("/evaluate/getList") |
| | | public R volunteerMerchantGetList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize, |
| | | @RequestParam("communityId") String communityId, |
| | | @RequestParam("merchantId") String merchantId) |
| | | { |
| | | if(StringUtils.isEmpty(communityId)) |
| | | { |
| | | communityId=getCommunityId()+""; |
| | | } |
| | | if(StringUtils.isEmpty(merchantId)) |
| | | { |
| | | return R.fail("商家id不能为空"); |
| | | } |
| | | return communityService.volunteerMerchantGetList(pageNum,pageSize,communityId,merchantId); |
| | | } |
| | | |
| | | /** |
| | | * 商家评论获取详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/evaluate/getData") |
| | | public R volunteerMerchantGetData(@RequestParam("id") String id) |
| | | { |
| | | return communityService.volunteerMerchantGetData(id); |
| | | } |
| | | |
| | | /** |
| | | * 商家评论新增评价 |
| | | * @return |
| | | */ |
| | | @PostMapping("/evaluate/insert") |
| | | public R volunteerMerchantInsert(@RequestBody VolunteerMerchantEvaluateVO item) |
| | | { |
| | | if(item==null) |
| | | { |
| | | return R.fail("参数不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(item.getCommunityId())) |
| | | { |
| | | item.setCommunityId(getCommunityId()+""); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(item.getMerchantId())) |
| | | { |
| | | return R.fail("商家id不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(item.getOrderId())) |
| | | { |
| | | return R.fail("订单id不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(item.getUserId())) |
| | | { |
| | | return R.fail("评论人id不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(item.getEvaluateGrade())) |
| | | { |
| | | return R.fail("评论分数不能为空"); |
| | | } |
| | | |
| | | return communityService.volunteerMerchantInsert(item); |
| | | } |
| | | |
| | | /** |
| | | * 商家评论更新评价 |
| | | * @return |
| | | */ |
| | | @PostMapping("/evaluate/update") |
| | | public R volunteerMerchantUpdate(@RequestBody VolunteerMerchantEvaluateVO item) |
| | | { |
| | | return communityService.volunteerMerchantUpdate(item); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 商家评论删除评价 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/evaluate/delete") |
| | | public R volunteerMerchantDelete(@RequestParam("id") String id) |
| | | { |
| | | return communityService.volunteerMerchantDelete(id); |
| | | } |
| | | |
| | | |
| | | /*************************************************************************************************************** |
| | | * |
| | | * 路北社区商家提现 |
| | | * |
| | | ****************************************************************************************************************/ |
| | | |
| | | /** |
| | | * 新增商家提现 |
| | | * @param item |
| | | * @return |
| | | */ |
| | | @PostMapping("/withdraw/insert") |
| | | public R WithdrawInsert(@RequestBody VolunteerMerchantWithdrawVO item) |
| | | { |
| | | return communityService.WithdrawInsert(item); |
| | | } |
| | | |
| | | /** |
| | | * 商家提现列表 |
| | | * @param disposeType |
| | | * @return |
| | | */ |
| | | @GetMapping("/withdraw/getList") |
| | | public R WithdrawGetList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize, |
| | | @RequestParam(value = "disposeType", required = false) String disposeType, |
| | | @RequestParam(value = "merchantName", required = false) String merchantName, |
| | | @RequestParam(value = "merchantId", required = false) String merchantId, |
| | | @RequestParam(value = "communityId", required = false) String communityId) |
| | | { |
| | | if(StringUtils.isEmpty(communityId)) |
| | | { |
| | | communityId=getCommunityId()+""; |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(merchantId)) |
| | | { |
| | | return R.fail("商家id不能为空"); |
| | | } |
| | | |
| | | return communityService.WithdrawGetList(pageNum,pageSize,disposeType, merchantName,merchantId,communityId); |
| | | } |
| | | |
| | | |
| | | /*************************************************************************************************************** |
| | | * |
| | | * 路北社区系统配置 商家折扣 兑换地点信息 |
| | | * |
| | | ****************************************************************************************************************/ |
| | | |
| | | /** |
| | | * 详情 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @GetMapping("/Community/Config/getData") |
| | | public R ConfiggetData(@RequestParam("communityId") String communityId) |
| | | { |
| | | return communityService.ConfiggetData(communityId); |
| | | } |
| | | |
| | | |
| | | /******************************************************************************************************************* |
| | | * |
| | | * |
| | | * 社区折扣 |
| | | * |
| | | * |
| | | ******************************************************************************************************************/ |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @GetMapping("/community/discount/getList") |
| | | public R CommunityDiscountgetList(@RequestParam("communityId") String communityId) |
| | | { |
| | | return communityService.CommunityDiscountgetList(communityId); |
| | | } |
| | | |
| | | } |