Merge branch 'master' into yibin
# Conflicts:
# springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/user/UserService.java
# springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/api/UserApi.java
# springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java
| | |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if (loginUserInfo != null) { |
| | | comMngVolunteerMngVO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | }else{ |
| | | comMngVolunteerMngVO.setCommunityId(pageVolunteerDTO.getCommunityId()); |
| | | } |
| | | // Long communityId = this.getCommunityId(); |
| | | |
| | | // comMngVolunteerMngVO.setCommunityId(communityId); |
| | | comMngVolunteerMngVO.setPageNum(pageVolunteerDTO.getPageNum()); |
| | | comMngVolunteerMngVO.setPageSize(pageVolunteerDTO.getPageSize()); |
| | | return communityService.pageVolunteer(comMngVolunteerMngVO); |
New file |
| | |
| | | package com.panzhihua.applets_backstage.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.microCommercialStreet.McsOrderVO; |
| | | 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; |
| | | |
| | | /** |
| | | * 商业街订单表(McsOrder)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2022-01-04 16:10:07 |
| | | */ |
| | | @Api(tags = {"商业街订单API"}) |
| | | @RestController |
| | | @RequestMapping("mcsOrder") |
| | | public class McsOrderApi extends BaseController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @ApiOperation(value = "分页查询订单",response = McsOrderVO.class) |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | return communityService.selectAllMscOrder(commonPage); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @ApiOperation(value = "通过主键查询单条数据",response = McsOrderVO.class) |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable("id") Long id) { |
| | | return communityService.selectOneMscOrder(id); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param mcsOrderVO 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @ApiOperation("新增数据") |
| | | @PostMapping |
| | | public R insert(@RequestBody McsOrderVO mcsOrderVO) { |
| | | return communityService.insertMscOrder(mcsOrderVO); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param mcsOrderVO 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @ApiOperation("修改订单") |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody McsOrderVO mcsOrderVO) { |
| | | return communityService.updateMscOrder(mcsOrderVO); |
| | | } |
| | | |
| | | /** |
| | | * 微信支付 |
| | | * @param mcsOrderVO |
| | | * @return |
| | | */ |
| | | @ApiOperation("微信支付") |
| | | @PostMapping("/wxPay") |
| | | public R wxPay(@RequestBody McsOrderVO mcsOrderVO){ |
| | | return communityService.wxPayMscOrder(mcsOrderVO); |
| | | } |
| | | |
| | | /** |
| | | * 发送提醒短信 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation("发送提醒短信") |
| | | @GetMapping("/sendContent") |
| | | public R sendContent(@RequestParam("id") Long id){ |
| | | return communityService.sendContentMcsOrder(id); |
| | | } |
| | | |
| | | /** |
| | | *微信支付回调 |
| | | * @param mcsOrderVO |
| | | * @return |
| | | */ |
| | | @ApiOperation("微信支付回调") |
| | | @PostMapping("/notify") |
| | | public R notify(@RequestBody McsOrderVO mcsOrderVO){ |
| | | return communityService.notifyMcsOrder(mcsOrderVO); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets_backstage.api; |
| | | |
| | | import java.util.List; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsEvaluateDTO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsEvaluateVO; |
| | | 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.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.DisableOrEnableMcsMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsGameDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsInformationDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetPopularForGameDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetShelfForGameDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetShelfForInfoDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsConfigVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsGameVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsInformationVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsMerchantVO; |
| | | 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.ApiOperation; |
| | | |
| | | /** |
| | | * @title: MicroCommercialStreetApi |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 微商业街相关接口 |
| | | * @author: hans |
| | | * @date: 2021/12/28 14:18 |
| | | */ |
| | | @Api(tags = {"微商业街"}) |
| | | @RestController |
| | | @RequestMapping("/microcommercialstreet") |
| | | public class MicroCommercialStreetApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @ApiOperation(value = "新增数字商业街商家") |
| | | @PostMapping("/merchant/add") |
| | | public R addMcsMerchant(@RequestBody @Validated(AddGroup.class) McsMerchantDTO mcsMerchantDTO) { |
| | | Long userId = this.getUserId(); |
| | | mcsMerchantDTO.setCreatedBy(userId); |
| | | mcsMerchantDTO.setUpdatedBy(userId); |
| | | return communityService.addMcsMerchant(mcsMerchantDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "编辑数字商业街商家") |
| | | @PutMapping("/merchant/put") |
| | | public R putMcsMerchant(@RequestBody @Validated(PutGroup.class) McsMerchantDTO mcsMerchantDTO) { |
| | | mcsMerchantDTO.setUpdatedBy(this.getUserId()); |
| | | return communityService.putMcsMerchant(mcsMerchantDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询数字商业街商家详情", response = McsMerchantVO.class) |
| | | @GetMapping("/merchant/get") |
| | | public R getMcsMerchant(@RequestParam("merchantId") Long merchantId) { |
| | | return communityService.getMcsMerchant(merchantId); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除数字商业街商家") |
| | | @DeleteMapping("/merchant/delete") |
| | | public R deleteMcsMerchant(@RequestParam("merchantId") Long merchantId) { |
| | | return communityService.deleteMcsMerchant(merchantId, this.getUserId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询数字商业街商家", response = McsMerchantVO.class) |
| | | @PostMapping("/merchant/page") |
| | | public R pageMcsMerchant(@RequestBody @Valid PageMcsMerchantDTO pageMcsMerchantDTO) { |
| | | return communityService.pageMcsMerchant(pageMcsMerchantDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "禁用/启用数字商业街商家") |
| | | @PutMapping("/merchant/disable-or-enable") |
| | | public R disableOrEnableMcsMerchant(@RequestBody @Valid DisableOrEnableMcsMerchantDTO disableOrEnableMcsMerchantDTO) { |
| | | disableOrEnableMcsMerchantDTO.setUpdatedBy(this.getUserId()); |
| | | return communityService.disableOrEnableMcsMerchant(disableOrEnableMcsMerchantDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取所有数字商业街配置", response = McsConfigVO.class) |
| | | @GetMapping("/config/all") |
| | | public R getAllMcsConfig() { |
| | | return communityService.getAllMcsConfig(); |
| | | } |
| | | |
| | | @ApiOperation(value = "修改数字商业街配置") |
| | | @PutMapping("/config/put") |
| | | public R putMcsConfig(@RequestBody List<McsConfigVO> configs) { |
| | | return communityService.putMcsConfig(configs); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询戳戳游戏", response = McsGameVO.class) |
| | | @PostMapping("/game/page") |
| | | public R pageMcsGame(@RequestBody @Valid PageMcsGameDTO pageMcsGameDTO) { |
| | | return communityService.pageMcsGame(pageMcsGameDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "设为/取消游戏热门") |
| | | @PutMapping("/game/setPopular") |
| | | public R setPopularForGame(@RequestBody @Valid SetPopularForGameDTO setPopularForGameDTO) { |
| | | setPopularForGameDTO.setUpdatedBy(this.getUserId()); |
| | | return communityService.setPopularForGame(setPopularForGameDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "上架/下架戳戳游戏") |
| | | @PutMapping("/game/setShelf") |
| | | public R setShelfForGame(@RequestBody @Valid SetShelfForGameDTO setShelfForGameDTO) { |
| | | setShelfForGameDTO.setUpdatedBy(this.getUserId()); |
| | | return communityService.setShelfForGame(setShelfForGameDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除戳戳游戏") |
| | | @DeleteMapping("/game/delete") |
| | | public R deleteMcsGame(@RequestParam("gameId") Long gameId) { |
| | | return communityService.deleteMcsGame(gameId, this.getUserId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询戳戳资讯", response = McsInformationVO.class) |
| | | @PostMapping("/information/page") |
| | | public R pageMcsInfo(@RequestBody @Valid PageMcsInformationDTO pageMcsInformationDTO) { |
| | | return communityService.pageMcsInfo(pageMcsInformationDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "上架/下架戳戳资讯") |
| | | @PutMapping("/information/setShelf") |
| | | public R setShelfForMcsInfo(@RequestBody @Valid SetShelfForInfoDTO setShelfForInfoDTO) { |
| | | setShelfForInfoDTO.setUpdatedBy(this.getUserId()); |
| | | return communityService.setShelfForMcsInfo(setShelfForInfoDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除戳戳资讯") |
| | | @DeleteMapping("/information/delete") |
| | | public R deleteMcsInfo(@RequestParam("infoId") Long infoId) { |
| | | return communityService.deleteMcsInfo(infoId, this.getUserId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询评价记录", response = McsEvaluateVO.class) |
| | | @PostMapping("/evaluate/page") |
| | | public R pageMcsEvaluate(@RequestBody @Valid PageMcsEvaluateDTO pageMcsEvaluateDTO) { |
| | | return communityService.pageMcsEvaluate(pageMcsEvaluateDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询评价记录详情", response = McsEvaluateVO.class) |
| | | @GetMapping("/evaluate/get") |
| | | public R getMcsEvaluate(@RequestParam("evaluateId") Long evaluateId) { |
| | | return communityService.getMcsEvaluate(evaluateId); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除评价记录") |
| | | @DeleteMapping("/evaluate/delete") |
| | | public R deleteMcsEvaluate(@RequestParam("evaluateId") Long evaluateId) { |
| | | return communityService.deleteMcsEvaluate(evaluateId); |
| | | } |
| | | } |
| | |
| | | LoginReturnVO loginReturnVO = loginService.loginXQDP(account, password); |
| | | return R.ok(loginReturnVO); |
| | | } |
| | | |
| | | /** |
| | | * 微商业街用户登录 |
| | | * |
| | | * @param account |
| | | * 账户 |
| | | * @param password |
| | | * 密码 |
| | | * @return 登录结果 |
| | | */ |
| | | @PostMapping("/loginMcsUser") |
| | | public R loginMcsUser(@RequestParam("account") String account, @RequestParam("password") String password) { |
| | | LoginReturnVO loginReturnVO = loginService.loginMcsUser(account, password); |
| | | return R.ok(loginReturnVO); |
| | | } |
| | | } |
| | |
| | | * @return 登录结果 |
| | | */ |
| | | LoginReturnVO loginXQDP(String account, String password); |
| | | |
| | | /** |
| | | * 微商业街用户登录 |
| | | * @param account 账户 |
| | | * @param password 密码 |
| | | * @return 登录结果 |
| | | */ |
| | | LoginReturnVO loginMcsUser(String account, String password); |
| | | } |
| | |
| | | loginReturnVO.setRefreshToken(refeshToken); |
| | | return loginReturnVO; |
| | | } |
| | | |
| | | /** |
| | | * 微商业街用户登录 |
| | | * @param account 账户 |
| | | * @param password 密码 |
| | | * @return 登录结果 |
| | | */ |
| | | @Override |
| | | public LoginReturnVO loginMcsUser(String account, String password) { |
| | | Authentication authentication = authenticationManager.authenticate(new UsernamePasswordAuthenticationToken(account + "_11", password)); |
| | | LoginUserInfoVO loginUser = (LoginUserInfoVO)authentication.getPrincipal(); |
| | | String token = JWTTokenUtil.generateToken(loginUser); |
| | | String refeshToken = JWTTokenUtil.generateRefeshToken(loginUser); |
| | | LoginReturnVO loginReturnVO = new LoginReturnVO(); |
| | | loginReturnVO.setToken(token); |
| | | loginReturnVO.setRefreshToken(refeshToken); |
| | | return loginReturnVO; |
| | | } |
| | | } |
| | |
| | | @Min(value = 1, groups = {PageGroup.class}, message = "每页记录数不能为空") |
| | | private Long pageSize; |
| | | |
| | | @ApiModelProperty(value = "社区id") |
| | | private Long communityId; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.microCommercialStreet; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.Pattern; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: BindUserPhoneDTO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 商业街用户绑定手机号 |
| | | * @author: hans |
| | | * @date: 2022/01/13 10:58 |
| | | */ |
| | | @Data |
| | | @ApiModel("商业街用户绑定手机号") |
| | | public class BindUserPhoneDTO { |
| | | |
| | | @ApiModelProperty("手机号") |
| | | @NotBlank(message = "手机号不能为空") |
| | | @Pattern(message = "手机号格式错误", regexp = "^(13[0-9]|14[01456879]|15[0-3,5-9]|16[2567]|17[0-8]|18[0-9]|19[0-3,5-9])\\d{8}$") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty("验证码") |
| | | @NotBlank(message = "验证码不能为空") |
| | | private String code; |
| | | |
| | | @ApiModelProperty("openId") |
| | | @NotBlank(message = "openId不能为空") |
| | | private String openId; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.microCommercialStreet; |
| | | |
| | | import java.util.List; |
| | | |
| | | import javax.validation.constraints.NotEmpty; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: DeleteProductDTO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 删除产品信息请求参数 |
| | | * @author: hans |
| | | * @date: 2022/01/11 16:24 |
| | | */ |
| | | @Data |
| | | @ApiModel("删除产品信息请求参数") |
| | | public class DeleteProductDTO { |
| | | |
| | | @ApiModelProperty(value = "产品id列表", required = true) |
| | | @NotEmpty(message = "产品id列表不能为空") |
| | | private List<Long> productIds; |
| | | |
| | | @ApiModelProperty(value = "处理人", hidden = true) |
| | | private Long updatedBy; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.microCommercialStreet; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: DisableOrEnableMcsMerchantDTO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 禁用/启用数字商业街商家请求参数 |
| | | * @author: hans |
| | | * @date: 2021/12/29 14:35 |
| | | */ |
| | | @Data |
| | | @ApiModel("禁用/启用数字商业街商家请求参数") |
| | | public class DisableOrEnableMcsMerchantDTO { |
| | | |
| | | @ApiModelProperty(value = "处理类型(1.启用 2.禁用)", required = true, allowableValues = "1,2") |
| | | @NotNull(message = "处理类型不能为空") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "商家id", required = true) |
| | | @NotNull(message = "商家id不能为空") |
| | | private Long merchantId; |
| | | |
| | | @ApiModelProperty(value = "处理人", hidden = true) |
| | | private Long updatedBy; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.microCommercialStreet; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.Pattern; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: LoginWithPhoneDTO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 手机号登录请求参数 |
| | | * @author: hans |
| | | * @date: 2022/01/06 16:40 |
| | | */ |
| | | @Data |
| | | @ApiModel("手机号登录请求参数") |
| | | public class LoginWithPhoneDTO { |
| | | |
| | | @ApiModelProperty("手机号") |
| | | @NotBlank(message = "手机号不能为空") |
| | | @Pattern(message = "手机号格式错误", regexp = "^(13[0-9]|14[01456879]|15[0-3,5-9]|16[2567]|17[0-8]|18[0-9]|19[0-3,5-9])\\d{8}$") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty("验证码") |
| | | @NotBlank(message = "验证码不能为空") |
| | | private String code; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.microCommercialStreet; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: McsEvaluateDTO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 评价记录请求 |
| | | * @author: hans |
| | | * @date: 2022/01/08 13:13 |
| | | */ |
| | | @Data |
| | | @ApiModel("评价记录请求") |
| | | public class McsEvaluateDTO { |
| | | |
| | | @ApiModelProperty("戳戳券码id") |
| | | @NotNull(groups = {AddGroup.class}, message = "戳戳券码id不能为空") |
| | | private Long couponId; |
| | | |
| | | @ApiModelProperty("评分(1.差 2.一般 3.还不错 4.很满意 5.强烈推荐)") |
| | | @NotNull(groups = {AddGroup.class}, message = "评分不能为空") |
| | | private Integer star; |
| | | |
| | | @ApiModelProperty("评价内容") |
| | | @NotBlank(groups = {AddGroup.class}, message = "评价内容不能为空") |
| | | private String content; |
| | | |
| | | @ApiModelProperty("评价图片(多张逗号隔开)") |
| | | @NotBlank(groups = {AddGroup.class}, message = "评价图片不能为空") |
| | | private String photos; |
| | | |
| | | @ApiModelProperty(value = "创建人", hidden = true) |
| | | private Long userId; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.microCommercialStreet; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | import com.panzhihua.common.validated.PutGroup; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: McsGameDTO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 新增/编辑戳戳游戏 |
| | | * @author: hans |
| | | * @date: 2021/12/31 15:42 |
| | | */ |
| | | @Data |
| | | @ApiModel("新增/编辑戳戳游戏") |
| | | public class McsGameDTO { |
| | | |
| | | @ApiModelProperty("游戏ID") |
| | | @NotNull(groups = {PutGroup.class}, message = "游戏ID不能为空") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("游戏名称") |
| | | @NotBlank(groups = {AddGroup.class}, message = "游戏名称不能为空") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("戳戳卷数量") |
| | | @NotNull(groups = {AddGroup.class}, message = "戳戳卷数量不能为空") |
| | | private Integer coupons; |
| | | |
| | | @ApiModelProperty("游戏类别(1.戳戳币游戏 2.体验游戏)") |
| | | @NotNull(groups = {AddGroup.class}, message = "游戏类别不能为空") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("奖励类型(1.免费产品 2.免费服务)") |
| | | private Integer awardType; |
| | | |
| | | @ApiModelProperty("戳戳币分配方式(1.随机分配 2.平均分配)") |
| | | private Integer allocation; |
| | | |
| | | @ApiModelProperty("戳戳币数量") |
| | | private Integer coins; |
| | | |
| | | @ApiModelProperty("地址") |
| | | @NotBlank(groups = {AddGroup.class}, message = "地址不能为空") |
| | | private String address; |
| | | |
| | | @ApiModelProperty("纬度") |
| | | @NotBlank(groups = {AddGroup.class}, message = "纬度不能为空") |
| | | private String lat; |
| | | |
| | | @ApiModelProperty("经度") |
| | | @NotBlank(groups = {AddGroup.class}, message = "经度不能为空") |
| | | private String lon; |
| | | |
| | | @ApiModelProperty("失效时间") |
| | | @NotNull(groups = {AddGroup.class}, message = "失效时间不能为空") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date expireAt; |
| | | |
| | | @ApiModelProperty("封面") |
| | | @NotBlank(groups = {AddGroup.class}, message = "封面不能为空") |
| | | private String cover; |
| | | |
| | | @ApiModelProperty("其他图片(多张图片以逗号隔开)") |
| | | private String otherImages; |
| | | |
| | | @ApiModelProperty("游戏介绍") |
| | | @NotBlank(groups = {AddGroup.class}, message = "游戏介绍不能为空") |
| | | private String introduction; |
| | | |
| | | @ApiModelProperty(value = "创建人", hidden = true) |
| | | private Long createdBy; |
| | | |
| | | @ApiModelProperty(value = "更新人", hidden = true) |
| | | private Long updatedBy; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.microCommercialStreet; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | import com.panzhihua.common.validated.PutGroup; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: McsInfoDTO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 新增/编辑戳戳资讯 |
| | | * @author: hans |
| | | * @date: 2022/01/05 10:06 |
| | | */ |
| | | @Data |
| | | @ApiModel("新增/编辑戳戳资讯") |
| | | public class McsInfoDTO { |
| | | |
| | | @ApiModelProperty("资讯ID") |
| | | @NotNull(groups = {PutGroup.class}, message = "资讯ID不能为空") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("资讯标题") |
| | | @NotBlank(groups = {AddGroup.class}, message = "资讯标题不能为空") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("地址") |
| | | @NotBlank(groups = {AddGroup.class}, message = "地址不能为空") |
| | | private String address; |
| | | |
| | | @ApiModelProperty("纬度") |
| | | @NotBlank(groups = {AddGroup.class}, message = "纬度不能为空") |
| | | private String lat; |
| | | |
| | | @ApiModelProperty("经度") |
| | | @NotBlank(groups = {AddGroup.class}, message = "经度不能为空") |
| | | private String lon; |
| | | |
| | | @ApiModelProperty("封面") |
| | | @NotBlank(groups = {AddGroup.class}, message = "封面不能为空") |
| | | private String cover; |
| | | |
| | | @ApiModelProperty("资讯内容") |
| | | @NotBlank(groups = {AddGroup.class}, message = "资讯内容不能为空") |
| | | private String content; |
| | | |
| | | @ApiModelProperty(value = "创建人", hidden = true) |
| | | private Long createdBy; |
| | | |
| | | @ApiModelProperty(value = "更新人", hidden = true) |
| | | private Long updatedBy; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.microCommercialStreet; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import javax.validation.constraints.Pattern; |
| | | |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | import com.panzhihua.common.validated.PutGroup; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: McsMerchantDTO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: |
| | | * @author: hans |
| | | * @date: 2021/12/28 14:32 |
| | | */ |
| | | @Data |
| | | @ApiModel("新增/编辑微商业街商家") |
| | | public class McsMerchantDTO { |
| | | |
| | | @ApiModelProperty("微商业街商家ID") |
| | | @NotNull(groups = {PutGroup.class}, message = "微商业街商家ID不能为空") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("商家名称") |
| | | @NotBlank(groups = {AddGroup.class}, message = "商家名称不能为空") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("手机号") |
| | | @Pattern(groups = {AddGroup.class}, message = "手机号格式错误", regexp = "^(13[0-9]|14[01456879]|15[0-3,5-9]|16[2567]|17[0-8]|18[0-9]|19[0-3,5-9])\\d{8}$") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty("商家级别(1.临时商家 2.合作商家)") |
| | | @NotNull(groups = {AddGroup.class}, message = "商家级别不能为空") |
| | | private Integer level; |
| | | |
| | | @ApiModelProperty("点亮天数") |
| | | @NotNull(groups = {AddGroup.class}, message = "点亮天数不能为空") |
| | | private Integer litDays; |
| | | |
| | | @ApiModelProperty("商家账号") |
| | | @NotBlank(groups = {AddGroup.class}, message = "商家账号不能为空") |
| | | private String account; |
| | | |
| | | @ApiModelProperty("密码") |
| | | // @Pattern(groups = {AddGroup.class}, message = "请输入8-12位密码,由英文,数字和特殊符号组成", |
| | | // regexp = "^(?=.*[A-Za-z])(?=(.*[\\d]){1,})(?=(.*[\\W]){1,})(?!.*\\s).{8,12}$") |
| | | @NotBlank(groups = {AddGroup.class}, message = "密码不能为空") |
| | | private String password; |
| | | |
| | | @ApiModelProperty("账号状态(1.启用 2.禁用)") |
| | | @NotNull(groups = {AddGroup.class}, message = "账号状态不能为空") |
| | | private Integer accountStatus; |
| | | |
| | | @ApiModelProperty("商家logo") |
| | | private String logo; |
| | | |
| | | @ApiModelProperty("戳戳点亮上限(发布次数上限)") |
| | | private Integer publishLimit; |
| | | |
| | | @ApiModelProperty("商家地址") |
| | | private String address; |
| | | |
| | | @ApiModelProperty("纬度") |
| | | private String lat; |
| | | |
| | | @ApiModelProperty("经度") |
| | | private String lon; |
| | | |
| | | @ApiModelProperty("商家介绍") |
| | | private String introduction; |
| | | |
| | | @ApiModelProperty(value = "创建人", hidden = true) |
| | | private Long createdBy; |
| | | |
| | | @ApiModelProperty(value = "更新人", hidden = true) |
| | | private Long updatedBy; |
| | | |
| | | @ApiModelProperty(value = "所属商家", hidden = true) |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(value = "用户头像", hidden = true) |
| | | private String imageUrl; |
| | | |
| | | @ApiModelProperty(value = "openId", hidden = true) |
| | | private String openId; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.microCommercialStreet; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | import com.panzhihua.common.validated.PutGroup; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @title: McsProductDTO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 新增/编辑产品信息 |
| | | * @author: hans |
| | | * @date: 2022/01/05 11:25 |
| | | */ |
| | | @Data |
| | | @ApiModel("新增/编辑产品信息") |
| | | public class McsProductDTO { |
| | | |
| | | @ApiModelProperty("产品ID") |
| | | @NotNull(groups = {PutGroup.class}, message = "产品ID不能为空") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("产品名称") |
| | | @NotBlank(groups = {AddGroup.class}, message = "产品名称不能为空") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("产品图片") |
| | | private String image; |
| | | |
| | | @ApiModelProperty("产品介绍") |
| | | private String introduction; |
| | | |
| | | @ApiModelProperty("产品标签id列表") |
| | | private List<Long> labelIds; |
| | | |
| | | @ApiModelProperty(value = "创建人", hidden = true) |
| | | private Long createdBy; |
| | | |
| | | @ApiModelProperty(value = "更新人", hidden = true) |
| | | private Long updatedBy; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.microCommercialStreet; |
| | | |
| | | import javax.validation.constraints.Min; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: PageMyCouponDTO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 分页查询我的评价-参与游戏列表 |
| | | * @author: hans |
| | | * @date: 2022/01/08 12:34 |
| | | */ |
| | | @Data |
| | | @ApiModel("分页查询我的评价-参与游戏列表") |
| | | public class PageJoinGameListDTO { |
| | | |
| | | @ApiModelProperty("关键字") |
| | | private String keyword; |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数", example = "1") |
| | | @NotNull(message = "分页参数不能为空") |
| | | @Min(value = 1) |
| | | private Long pageNum; |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数", example = "10") |
| | | @NotNull(message = "分页参数不能为空") |
| | | @Min(value = 1) |
| | | private Long pageSize; |
| | | |
| | | @ApiModelProperty(value = "用户id", hidden = true) |
| | | private Long userId; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.microCommercialStreet; |
| | | |
| | | import javax.validation.constraints.Min; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: PageMcsEvaluateDTO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 分页查询戳戳评价记录请求参数 |
| | | * @author: hans |
| | | * @date: 2021/12/31 13:22 |
| | | */ |
| | | @Data |
| | | @ApiModel("分页查询戳戳评价记录请求参数") |
| | | public class PageMcsEvaluateDTO { |
| | | |
| | | @ApiModelProperty("关键词") |
| | | private String keyword; |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数", example = "1") |
| | | @NotNull(message = "分页参数不能为空") |
| | | @Min(value = 1) |
| | | private Long pageNum; |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数", example = "10") |
| | | @NotNull(message = "分页参数不能为空") |
| | | @Min(value = 1) |
| | | private Long pageSize; |
| | | |
| | | @ApiModelProperty("1.我的评价") |
| | | private Integer isMy; |
| | | |
| | | @ApiModelProperty("戳戳游戏id") |
| | | private Long gameId; |
| | | |
| | | @ApiModelProperty(value = "用户id", hidden = true) |
| | | private Long userId; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.microCommercialStreet; |
| | | |
| | | import javax.validation.constraints.Min; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: PageMcsGameDTO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 分页查询戳戳游戏请求参数 |
| | | * @author: hans |
| | | * @date: 2021/12/30 15:20 |
| | | */ |
| | | @Data |
| | | @ApiModel("分页查询戳戳游戏请求参数") |
| | | public class PageMcsGameDTO { |
| | | |
| | | @ApiModelProperty("关键词") |
| | | private String keyword; |
| | | |
| | | @ApiModelProperty("游戏类别(1.戳戳币游戏 2.体验游戏)") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("状态(1.未发布 2.进行中 3.已下架 4.已结束)") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数", example = "1") |
| | | @NotNull(message = "分页参数不能为空") |
| | | @Min(value = 1) |
| | | private Long pageNum; |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数", example = "10") |
| | | @NotNull(message = "分页参数不能为空") |
| | | @Min(value = 1) |
| | | private Long pageSize; |
| | | |
| | | @ApiModelProperty("纬度") |
| | | private String lat; |
| | | |
| | | @ApiModelProperty("经度") |
| | | private String lon; |
| | | |
| | | @ApiModelProperty("距离(千米)") |
| | | private Integer distance; |
| | | |
| | | @ApiModelProperty("商家id") |
| | | private Long merchantId; |
| | | |
| | | @ApiModelProperty(value = "用户id", hidden = true) |
| | | private Long userId; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.microCommercialStreet; |
| | | |
| | | import javax.validation.constraints.Min; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: PageMcsInformationDTO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 分页查询戳戳资讯请求参数 |
| | | * @author: hans |
| | | * @date: 2021/12/30 17:44 |
| | | */ |
| | | @Data |
| | | @ApiModel("分页查询戳戳资讯请求参数") |
| | | public class PageMcsInformationDTO { |
| | | |
| | | @ApiModelProperty("关键词") |
| | | private String keyword; |
| | | |
| | | @ApiModelProperty("状态(1.未发布 2.已发布 3.已下架)") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数", example = "1") |
| | | @NotNull(message = "分页参数不能为空") |
| | | @Min(value = 1) |
| | | private Long pageNum; |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数", example = "10") |
| | | @NotNull(message = "分页参数不能为空") |
| | | @Min(value = 1) |
| | | private Long pageSize; |
| | | |
| | | @ApiModelProperty("纬度") |
| | | private String lat; |
| | | |
| | | @ApiModelProperty("经度") |
| | | private String lon; |
| | | |
| | | @ApiModelProperty("距离(千米)") |
| | | private Integer distance; |
| | | |
| | | @ApiModelProperty("商家id") |
| | | private Long merchantId; |
| | | |
| | | @ApiModelProperty(value = "用户id", hidden = true) |
| | | private Long userId; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.microCommercialStreet; |
| | | |
| | | import javax.validation.constraints.Min; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: PageMcsMerchantDTO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 分页查询微商业街商家请求参数 |
| | | * @author: hans |
| | | * @date: 2021/12/29 14:31 |
| | | */ |
| | | @Data |
| | | @ApiModel("分页查询微商业街商家请求参数") |
| | | public class PageMcsMerchantDTO { |
| | | |
| | | @ApiModelProperty("关键词") |
| | | private String keyword; |
| | | |
| | | @ApiModelProperty("账号状态(1.启用 2.禁用)") |
| | | private Integer accountStatus; |
| | | |
| | | @ApiModelProperty("商家级别(1.临时商家 2.合作商家)") |
| | | private Integer level; |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数", example = "1") |
| | | @NotNull(message = "分页参数不能为空") |
| | | @Min(value = 1) |
| | | private Long pageNum; |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数", example = "10") |
| | | @NotNull(message = "分页参数不能为空") |
| | | @Min(value = 1) |
| | | private Long pageSize; |
| | | |
| | | @ApiModelProperty("查询类型(1.戳戳游戏 2.戳戳资讯)") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("纬度") |
| | | private String lat; |
| | | |
| | | @ApiModelProperty("经度") |
| | | private String lon; |
| | | |
| | | @ApiModelProperty("距离,单位km") |
| | | private Integer distance; |
| | | |
| | | @ApiModelProperty("x km以上时,此值为1") |
| | | private Integer isMore; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.microCommercialStreet; |
| | | |
| | | import javax.validation.constraints.Min; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: PageMcsProductDTO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 分页查询产品信息请求参数 |
| | | * @author: hans |
| | | * @date: 2022/01/05 11:30 |
| | | */ |
| | | @Data |
| | | @ApiModel("分页查询产品信息请求参数") |
| | | public class PageMcsProductDTO { |
| | | |
| | | @ApiModelProperty("关键词") |
| | | private String keyword; |
| | | |
| | | @ApiModelProperty("状态(1.上架中 2.已下架)") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数", example = "1") |
| | | @NotNull(message = "分页参数不能为空") |
| | | @Min(value = 1) |
| | | private Long pageNum; |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数", example = "10") |
| | | @NotNull(message = "分页参数不能为空") |
| | | @Min(value = 1) |
| | | private Long pageSize; |
| | | |
| | | @ApiModelProperty(value = "商家id") |
| | | private Long merchantId; |
| | | |
| | | @ApiModelProperty(value = "用户id", hidden = true) |
| | | private Long userId; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.microCommercialStreet; |
| | | |
| | | import javax.validation.constraints.Min; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @title: PageVerifyRecordDTO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 分页查询核销记录 |
| | | * @author: hans |
| | | * @date: 2022/01/08 14:53 |
| | | */ |
| | | @Data |
| | | @ApiModel("分页查询核销记录") |
| | | public class PageVerifyRecordDTO { |
| | | |
| | | @ApiModelProperty("关键字") |
| | | private String keyword; |
| | | |
| | | @ApiModelProperty("游戏类别(1.戳戳币游戏 2.体验游戏)") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("核销时间-起") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date verifiedBegin; |
| | | |
| | | @ApiModelProperty("核销时间-止") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date verifiedEnd; |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数", example = "1") |
| | | @NotNull(message = "分页参数不能为空") |
| | | @Min(value = 1) |
| | | private Long pageNum; |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数", example = "10") |
| | | @NotNull(message = "分页参数不能为空") |
| | | @Min(value = 1) |
| | | private Long pageSize; |
| | | |
| | | @ApiModelProperty(value = "用户id", hidden = true) |
| | | private Long userId; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.microCommercialStreet; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: PutUserInfoDTO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 修改用戶信息请求参数 |
| | | * @author: hans |
| | | * @date: 2022/01/08 16:24 |
| | | */ |
| | | @Data |
| | | @ApiModel("修改用戶信息请求参数") |
| | | public class PutUserInfoDTO { |
| | | |
| | | @ApiModelProperty("头像") |
| | | private String imageUrl; |
| | | |
| | | @ApiModelProperty("昵称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "用户id", hidden = true) |
| | | private Long userId; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.microCommercialStreet; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: SetPopularForGameDTO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 设为/取消游戏热门请求参数 |
| | | * @author: hans |
| | | * @date: 2021/12/30 16:29 |
| | | */ |
| | | @Data |
| | | @ApiModel("设为/取消游戏热门请求参数") |
| | | public class SetPopularForGameDTO { |
| | | |
| | | @ApiModelProperty(value = "处理类型(1.设为热门 2.取消热门)", required = true, allowableValues = "1,2") |
| | | @NotNull(message = "处理类型不能为空") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "游戏id", required = true) |
| | | @NotNull(message = "游戏id不能为空") |
| | | private Long gameId; |
| | | |
| | | @ApiModelProperty(value = "处理人", hidden = true) |
| | | private Long updatedBy; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.microCommercialStreet; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: SetPopularForGameDTO1 |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 上架/下架戳戳游戏请求参数 |
| | | * @author: hans |
| | | * @date: 2021/12/30 16:43 |
| | | */ |
| | | @Data |
| | | @ApiModel("上架/下架戳戳游戏请求参数") |
| | | public class SetShelfForGameDTO { |
| | | |
| | | @ApiModelProperty(value = "处理类型(1.上架 2.下架)", required = true, allowableValues = "1,2") |
| | | @NotNull(message = "处理类型不能为空") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "游戏id", required = true) |
| | | @NotNull(message = "游戏id不能为空") |
| | | private Long gameId; |
| | | |
| | | @ApiModelProperty(value = "处理人", hidden = true) |
| | | private Long updatedBy; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.microCommercialStreet; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: SetShelfForInfoDTO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 上架/下架戳戳资讯请求参数 |
| | | * @author: hans |
| | | * @date: 2021/12/30 17:45 |
| | | */ |
| | | @Data |
| | | @ApiModel("上架/下架戳戳资讯请求参数") |
| | | public class SetShelfForInfoDTO { |
| | | |
| | | @ApiModelProperty(value = "处理类型(1.上架 2.下架)", required = true, allowableValues = "1,2") |
| | | @NotNull(message = "处理类型不能为空") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "资讯id", required = true) |
| | | @NotNull(message = "资讯id不能为空") |
| | | private Long infoId; |
| | | |
| | | @ApiModelProperty(value = "处理人", hidden = true) |
| | | private Long updatedBy; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.microCommercialStreet; |
| | | |
| | | import java.util.List; |
| | | |
| | | import javax.validation.constraints.NotEmpty; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: SetShelfForProductDTO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 上架/下架产品信息请求参数 |
| | | * @author: hans |
| | | * @date: 2022/01/05 11:27 |
| | | */ |
| | | @Data |
| | | @ApiModel("上架/下架产品信息请求参数") |
| | | public class SetShelfForProductDTO { |
| | | |
| | | @ApiModelProperty(value = "处理类型(1.上架 2.下架)", required = true, allowableValues = "1,2") |
| | | @NotNull(message = "处理类型不能为空") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "产品id列表", required = true) |
| | | @NotEmpty(message = "产品id列表不能为空") |
| | | private List<Long> productIds; |
| | | |
| | | @ApiModelProperty(value = "处理人", hidden = true) |
| | | private Long updatedBy; |
| | | } |
| | |
| | | private Integer paramId2; |
| | | @ApiModelProperty("社区id") |
| | | private Long communityId; |
| | | @ApiModelProperty("商家id") |
| | | private Long merchantId; |
| | | } |
| | |
| | | private String refreshToken; |
| | | @ApiModelProperty("communityId") |
| | | private Long communityId; |
| | | @ApiModelProperty("openId") |
| | | private String openId; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.microCommercialStreet; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: GameStatisticsVO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 游戏统计信息 |
| | | * @author: hans |
| | | * @date: 2022/01/08 15:12 |
| | | */ |
| | | @Data |
| | | @ApiModel("游戏统计信息") |
| | | public class GameStatisticsVO { |
| | | |
| | | @ApiModelProperty("游戏总数") |
| | | private Integer gameTotal; |
| | | |
| | | @ApiModelProperty("发放核销码") |
| | | private Integer sendCouponTotal; |
| | | |
| | | @ApiModelProperty("领取数占比") |
| | | private BigDecimal appliedPercent; |
| | | |
| | | @ApiModelProperty("未领取数占比") |
| | | private BigDecimal unAppliedPercent; |
| | | |
| | | @ApiModelProperty("核销人数占比") |
| | | private BigDecimal verifiedPercent; |
| | | |
| | | @ApiModelProperty("未核销数占比") |
| | | private BigDecimal unVerifiedPercent; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.microCommercialStreet; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: IndexTopStatisticsVO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 首页顶部数据 |
| | | * @author: hans |
| | | * @date: 2022/01/07 14:04 |
| | | */ |
| | | @Data |
| | | @ApiModel("首页顶部数据") |
| | | public class IndexTopStatisticsVO { |
| | | |
| | | @ApiModelProperty("戳戳币总额") |
| | | private Integer coinTotal; |
| | | |
| | | @ApiModelProperty("今日已领戳戳币") |
| | | private Integer appliedTotal; |
| | | |
| | | @ApiModelProperty("游戏总数") |
| | | private Integer gameTotal; |
| | | |
| | | @ApiModelProperty("全部资讯") |
| | | private Integer infoTotal; |
| | | |
| | | @ApiModelProperty("热门戳戳") |
| | | private McsGameVO popularGame; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.microCommercialStreet; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: McsConfigVO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 数字商业街配置信息 |
| | | * @author: hans |
| | | * @date: 2021/12/30 11:15 |
| | | */ |
| | | @Data |
| | | @ApiModel("数字商业街配置信息") |
| | | public class McsConfigVO { |
| | | |
| | | @ApiModelProperty("配置id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("配置名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("key") |
| | | private String key; |
| | | |
| | | @ApiModelProperty("配置内容") |
| | | private String value; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.microCommercialStreet; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @title: CouponApplyReturnVO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 戳戳卷信息 |
| | | * @author: hans |
| | | * @date: 2022/01/07 17:27 |
| | | */ |
| | | @Data |
| | | @ApiModel("戳戳卷信息") |
| | | public class McsCouponVO { |
| | | |
| | | @ApiModelProperty("戳戳卷id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("优惠券包含奖励") |
| | | private String award; |
| | | |
| | | @ApiModelProperty("戳戳卷二维码") |
| | | private String qrCode; |
| | | |
| | | @ApiModelProperty("是否核验") |
| | | private Boolean isVerified; |
| | | |
| | | @ApiModelProperty("游戏名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("游戏类别(1.戳戳币游戏 2.体验游戏)") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("是否评论(1.是 2.否)") |
| | | private Integer isEvaluate; |
| | | |
| | | @ApiModelProperty("评论id") |
| | | private Long evaluateId; |
| | | |
| | | @ApiModelProperty("游戏id") |
| | | private Long gameId; |
| | | |
| | | @ApiModelProperty("失效时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date expireAt; |
| | | |
| | | @ApiModelProperty("游戏封面") |
| | | private String cover; |
| | | |
| | | @ApiModelProperty("奖励类型(1.免费产品 2.免费服务)") |
| | | private Integer awardType; |
| | | |
| | | @ApiModelProperty("戳戳币分配方式(1.随机分配 2.平均分配)") |
| | | private Integer allocation; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.microCommercialStreet; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: McsEvaluateVO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 戳戳评价记录信息 |
| | | * @author: hans |
| | | * @date: 2021/12/31 13:19 |
| | | */ |
| | | @Data |
| | | @ApiModel("戳戳评价记录信息") |
| | | public class McsEvaluateVO { |
| | | |
| | | @ApiModelProperty("评价记录id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("评分(1.差 2.一般 3.还不错 4.很满意 5.强烈推荐)") |
| | | private Integer star; |
| | | |
| | | @ApiModelProperty("评价内容") |
| | | private String content; |
| | | |
| | | @ApiModelProperty("评价图片(多张逗号隔开)") |
| | | private String photos; |
| | | |
| | | @ApiModelProperty("评价时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createdAt; |
| | | |
| | | @ApiModelProperty("用户") |
| | | private String nickName; |
| | | |
| | | @ApiModelProperty("用户头像") |
| | | private String imageUrl; |
| | | |
| | | @ApiModelProperty("手机号码") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty("评价游戏") |
| | | private String gameName; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.microCommercialStreet; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: McsGameVO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 戳戳游戏信息 |
| | | * @author: hans |
| | | * @date: 2021/12/30 13:50 |
| | | */ |
| | | @Data |
| | | @ApiModel("戳戳游戏信息") |
| | | public class McsGameVO { |
| | | |
| | | @ApiModelProperty("游戏id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("游戏名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("戳戳卷数量") |
| | | private Integer coupons; |
| | | |
| | | @ApiModelProperty("剩余戳戳卷数量") |
| | | private Integer surplusCoupons; |
| | | |
| | | @ApiModelProperty("游戏类别(1.戳戳币游戏 2.体验游戏)") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("奖励类型(1.免费产品 2.免费服务)") |
| | | private Integer awardType; |
| | | |
| | | @ApiModelProperty("戳戳币分配方式(1.随机分配 2.平均分配)") |
| | | private Integer allocation; |
| | | |
| | | @ApiModelProperty("戳戳币总额") |
| | | private Integer coins; |
| | | |
| | | @ApiModelProperty("地址") |
| | | private String address; |
| | | |
| | | @ApiModelProperty("纬度") |
| | | private String lat; |
| | | |
| | | @ApiModelProperty("经度") |
| | | private String lon; |
| | | |
| | | @ApiModelProperty("失效时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date expireAt; |
| | | |
| | | @ApiModelProperty("封面") |
| | | private String cover; |
| | | |
| | | @ApiModelProperty("其他图片(多张图片以逗号隔开)") |
| | | private String otherImages; |
| | | |
| | | @ApiModelProperty("游戏介绍") |
| | | private String introduction; |
| | | |
| | | @ApiModelProperty("状态(1.未发布 2.进行中 3.已下架 4.已结束)") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty("是否热门") |
| | | private Boolean isPopular; |
| | | |
| | | @ApiModelProperty("发布时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date publishAt; |
| | | |
| | | @ApiModelProperty("所属商家") |
| | | private Long merchantId; |
| | | |
| | | @ApiModelProperty("所属商家名称") |
| | | private String merchantName; |
| | | |
| | | @ApiModelProperty("商家logo") |
| | | private String logo; |
| | | |
| | | @ApiModelProperty("所属商家下游戏总数") |
| | | private Integer gameCount; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.microCommercialStreet; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: McsInformationVO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 戳戳资讯信息 |
| | | * @author: hans |
| | | * @date: 2021/12/30 17:43 |
| | | */ |
| | | @Data |
| | | @ApiModel("戳戳资讯信息") |
| | | public class McsInformationVO { |
| | | |
| | | @ApiModelProperty("资讯id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("资讯标题") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("地址") |
| | | private String address; |
| | | |
| | | @ApiModelProperty("纬度") |
| | | private String lat; |
| | | |
| | | @ApiModelProperty("经度") |
| | | private String lon; |
| | | |
| | | @ApiModelProperty("封面") |
| | | private String cover; |
| | | |
| | | @ApiModelProperty("资讯内容") |
| | | private String content; |
| | | |
| | | @ApiModelProperty("状态(1.未发布 2.已发布 3.已下架)") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty("发布时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date publishAt; |
| | | |
| | | @ApiModelProperty("所属商家") |
| | | private Long merchantId; |
| | | |
| | | @ApiModelProperty("资讯内容") |
| | | private String merchantName; |
| | | |
| | | @ApiModelProperty("商家信息") |
| | | private McsMerchantVO merchantInfo; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.microCommercialStreet; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: McsLabelVO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 产品标签信息 |
| | | * @author: hans |
| | | * @date: 2022/01/05 14:54 |
| | | */ |
| | | @Data |
| | | @ApiModel("产品标签信息") |
| | | public class McsLabelVO { |
| | | |
| | | @ApiModelProperty("标签id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("标签名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("说明") |
| | | private String introduction; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.microCommercialStreet; |
| | | |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.community.convenient.ConvenientMerchantVO; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: McsLoginUserInfoVO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 微商业街用户登录信息 |
| | | * @author: hans |
| | | * @date: 2022/01/06 13:12 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "微商业街用户登录信息") |
| | | public class McsLoginUserInfoVO extends LoginUserInfoVO { |
| | | @ApiModelProperty("商家信息") |
| | | private McsMerchantVO mcsMerchantVO; |
| | | |
| | | private String plaintextPassword; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.microCommercialStreet; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: McsMerchantVO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 数字商业街商家信息 |
| | | * @author: hans |
| | | * @date: 2021/12/29 10:37 |
| | | */ |
| | | @Data |
| | | @ApiModel("数字商业街商家信息") |
| | | public class McsMerchantVO { |
| | | |
| | | @ApiModelProperty("商家id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("商家名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("手机号") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty("商家账号") |
| | | private String account; |
| | | |
| | | @ApiModelProperty("商家logo") |
| | | private String logo; |
| | | |
| | | @ApiModelProperty("商家级别(1.临时商家 2.合作商家)") |
| | | private Integer level; |
| | | |
| | | @ApiModelProperty("戳戳点亮上限(发布次数上限)") |
| | | private Integer publishLimit; |
| | | |
| | | @ApiModelProperty("到期时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date expireAt; |
| | | |
| | | @ApiModelProperty("商家地址") |
| | | private String address; |
| | | |
| | | @ApiModelProperty("纬度") |
| | | private String lat; |
| | | |
| | | @ApiModelProperty("经度") |
| | | private String lon; |
| | | |
| | | @ApiModelProperty("商家简介") |
| | | private String introduction; |
| | | |
| | | @ApiModelProperty("首次点亮时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date firstLitAt; |
| | | |
| | | @ApiModelProperty("剩余点亮天数") |
| | | private Integer surplusLitDays; |
| | | |
| | | @ApiModelProperty("账号状态(1.启用 2.禁用)") |
| | | private Integer accountStatus; |
| | | |
| | | @ApiModelProperty("空闲戳戳点") |
| | | private Integer idleTotal; |
| | | |
| | | @ApiModelProperty("距离") |
| | | private Double distance; |
| | | |
| | | @ApiModelProperty("客服电话") |
| | | private String customPhone; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.microCommercialStreet; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | @Data |
| | | @ApiModel("商业街订单表") |
| | | public class McsOrderVO { |
| | | private Long id; |
| | | |
| | | /** |
| | | * 订单编号 |
| | | */ |
| | | @ApiModelProperty(value = "订单编号") |
| | | private String orderNo; |
| | | |
| | | /** |
| | | * 支付配置id |
| | | */ |
| | | @ApiModelProperty(value = "支付配置id") |
| | | private Long configId; |
| | | |
| | | /** |
| | | * 数量 |
| | | */ |
| | | @ApiModelProperty(value = "数量") |
| | | private Integer num; |
| | | |
| | | /** |
| | | * 支付状态 0 待支付 1已支付 2 已取消 3 已退款 |
| | | */ |
| | | @ApiModelProperty(value = "支付状态 0 待支付 1已支付 2 已取消 3 已退款") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 支付金额 |
| | | */ |
| | | @ApiModelProperty(value = "支付金额") |
| | | private BigDecimal money; |
| | | |
| | | /** |
| | | * 支付时间 |
| | | */ |
| | | @ApiModelProperty(value = "支付时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date payTime; |
| | | |
| | | /** |
| | | * 商家id |
| | | */ |
| | | @ApiModelProperty(value = "商家id") |
| | | private Long merchantId; |
| | | |
| | | /** |
| | | * 支付流水号 |
| | | */ |
| | | @ApiModelProperty(value = "支付流水号") |
| | | private String payNo; |
| | | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | @ApiModelProperty(value = "用户id") |
| | | private Long userId; |
| | | /** |
| | | * 商家名称 |
| | | */ |
| | | @ApiModelProperty("商家名称") |
| | | private String merchantName; |
| | | /** |
| | | * 付费名称 |
| | | */ |
| | | @ApiModelProperty("付费名称") |
| | | private String payName; |
| | | /** |
| | | * 商家账号 |
| | | */ |
| | | @ApiModelProperty("商家账号") |
| | | private String merchantAccount; |
| | | @ApiModelProperty("创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createTime; |
| | | @ApiModelProperty("交易类型 MWEB-->h5支付 NATIVE-->pc端支付 JSAPI-->小程序支付") |
| | | private String tradeType; |
| | | |
| | | @ApiModelProperty("openid") |
| | | private String openId; |
| | | |
| | | @ApiModelProperty("订单取消剩余倒计时") |
| | | private Long cancelCountdown; |
| | | |
| | | @ApiModelProperty("支付方式") |
| | | private String paymentMethod; |
| | | |
| | | @ApiModelProperty("商家地址") |
| | | private String address; |
| | | |
| | | @ApiModelProperty("纬度") |
| | | private String lat; |
| | | |
| | | @ApiModelProperty("经度") |
| | | private String lon; |
| | | |
| | | @ApiModelProperty(value = "用户真实ip", hidden = true) |
| | | private String clientIp; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.microCommercialStreet; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @title: McsProductVO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: |
| | | * @author: hans |
| | | * @date: 2022/01/05 11:29 |
| | | */ |
| | | @Data |
| | | @ApiModel("产品信息") |
| | | public class McsProductVO { |
| | | |
| | | @ApiModelProperty("产品id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("产品名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("产品图片") |
| | | private String image; |
| | | |
| | | @ApiModelProperty("产品介绍") |
| | | private String introduction; |
| | | |
| | | @ApiModelProperty("浏览量") |
| | | private Integer viewNum; |
| | | |
| | | @ApiModelProperty("状态(1.上架中 2.已下架)") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty("产品标签") |
| | | private String productLabel; |
| | | |
| | | @ApiModelProperty("所属商家") |
| | | private Long merchantId; |
| | | |
| | | @ApiModelProperty("所属商家名称") |
| | | private Long merchantName; |
| | | |
| | | @ApiModelProperty("产品标签ids") |
| | | private List<Long> labelIds; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.microCommercialStreet; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: McsVerifyRecordVO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 戳戳卷核验记录信息 |
| | | * @author: hans |
| | | * @date: 2022/01/08 14:56 |
| | | */ |
| | | @Data |
| | | @ApiModel("戳戳卷核验记录信息") |
| | | public class McsVerifyRecordVO { |
| | | |
| | | @ApiModelProperty("核验记录id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("核验码") |
| | | private Long couponId; |
| | | |
| | | @ApiModelProperty("游戏名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("获得奖励") |
| | | private String award; |
| | | |
| | | @ApiModelProperty("核验时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date verifiedAt; |
| | | |
| | | @ApiModelProperty("用户昵称") |
| | | private String nickName; |
| | | |
| | | @ApiModelProperty("游戏类别(1.戳戳币游戏 2.体验游戏)") |
| | | private Integer type; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.microCommercialStreet; |
| | | |
| | | import java.util.List; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: MyCouponVO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 我的戳戳卷信息 |
| | | * @author: hans |
| | | * @date: 2022/01/08 12:26 |
| | | */ |
| | | @Data |
| | | @ApiModel("我的戳戳卷信息") |
| | | public class MyCouponVO { |
| | | |
| | | @ApiModelProperty("已获得的戳戳币") |
| | | private Integer obtainedTotal; |
| | | |
| | | @ApiModelProperty("免费体验次") |
| | | private Integer trialTotal; |
| | | |
| | | @ApiModelProperty("参与游戏数") |
| | | private Integer joinGameTotal; |
| | | |
| | | @ApiModelProperty("待核销券码") |
| | | private Integer unVerifiedTotal; |
| | | |
| | | @ApiModelProperty("戳戳卷列表") |
| | | private List<McsCouponVO> couponList; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.microCommercialStreet; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: TopStatisticsVO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 统计信息 |
| | | * @author: hans |
| | | * @date: 2022/01/04 17:58 |
| | | */ |
| | | @Data |
| | | @ApiModel("统计信息") |
| | | public class TopStatisticsVO { |
| | | |
| | | @ApiModelProperty("到期时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date expireAt; |
| | | |
| | | @ApiModelProperty("剩余点亮天数") |
| | | private Integer surplusLitDays; |
| | | |
| | | @ApiModelProperty("领取人数") |
| | | private Integer appliedTotal; |
| | | |
| | | @ApiModelProperty("核销人数") |
| | | private Integer verifiedTotal; |
| | | |
| | | @ApiModelProperty("空闲戳戳点") |
| | | private Integer idleTotal; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.microCommercialStreet; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: VerifiedReturnVO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 戳戳卷核验返回参数 |
| | | * @author: hans |
| | | * @date: 2022/01/08 14:37 |
| | | */ |
| | | @Data |
| | | @ApiModel("戳戳卷核验返回参数") |
| | | public class VerifiedReturnVO { |
| | | |
| | | @ApiModelProperty("用户") |
| | | private String nickName; |
| | | |
| | | @ApiModelProperty("奖励") |
| | | private String award; |
| | | |
| | | @ApiModelProperty("券码") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long couponId; |
| | | |
| | | @ApiModelProperty("核销时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date verifiedAt; |
| | | |
| | | @ApiModelProperty("游戏名称") |
| | | private String gameName; |
| | | |
| | | @ApiModelProperty("游戏封面") |
| | | private String cover; |
| | | |
| | | @ApiModelProperty("奖励类型(1.免费产品 2.免费服务)") |
| | | private Integer awardType; |
| | | } |
| | |
| | | */ |
| | | @PostMapping("/loginXQDP") |
| | | R loginXQDP(@RequestParam("account") String account, @RequestParam("password") String password); |
| | | |
| | | /** |
| | | * 微商业街用户登录 |
| | | * |
| | | * @param account |
| | | * 账户 |
| | | * @param password |
| | | * 密码 |
| | | * @return 登录结果 |
| | | */ |
| | | @PostMapping("/loginMcsUser") |
| | | R loginMcsUser(@RequestParam("account") String account, @RequestParam("password") String password); |
| | | } |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.panzhihua.common.model.dtos.PageBaseDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.DeleteProductDTO; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import com.panzhihua.common.model.dtos.AppletesBackstageConfigDTO; |
| | | import com.panzhihua.common.model.dtos.PageBaseDTO; |
| | | import com.panzhihua.common.model.dtos.PageDTO; |
| | | import com.panzhihua.common.model.dtos.advertisement.ComOpsAdvDTO; |
| | | import com.panzhihua.common.model.dtos.advertisement.PageComOpsAdvDTO; |
| | |
| | | import com.panzhihua.common.model.dtos.community.integral.admin.EditComActIntegralRuleDTO; |
| | | import com.panzhihua.common.model.dtos.community.integral.admin.PageComActIntegralRuleDTO; |
| | | import com.panzhihua.common.model.dtos.community.integral.admin.PageComActIntegralTradeDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.DisableOrEnableMcsMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.LoginWithPhoneDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsEvaluateDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsGameDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsInfoDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsProductDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageJoinGameListDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsEvaluateDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsGameDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsInformationDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsProductDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageVerifyRecordDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PutUserInfoDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetPopularForGameDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetShelfForGameDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetShelfForInfoDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetShelfForProductDTO; |
| | | import com.panzhihua.common.model.dtos.community.questnaire.StatisticsSummaryDTO; |
| | | import com.panzhihua.common.model.dtos.community.rentingHouses.*; |
| | | 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.PageRentingHousesConfigDTO; |
| | | import com.panzhihua.common.model.dtos.community.rentingHouses.ReleaseOrCancelHouseDTO; |
| | | import com.panzhihua.common.model.dtos.community.rentingHouses.RentingHouseRegisterDTO; |
| | | import com.panzhihua.common.model.dtos.community.rentingHouses.RentingHousesConfigDTO; |
| | | import com.panzhihua.common.model.dtos.community.reserve.AddReserveAdminDTO; |
| | | import com.panzhihua.common.model.dtos.community.reserve.CancelReserveRecordDTO; |
| | | import com.panzhihua.common.model.dtos.community.reserve.ComActReserveMakeStatisticsDTO; |
| | |
| | | import com.panzhihua.common.model.vos.community.bigscreen.PartyBuildingMemberVO; |
| | | import com.panzhihua.common.model.vos.community.cluster.admin.ComClusterMemberExcelVO; |
| | | import com.panzhihua.common.model.vos.community.convenient.ConvenientMerchantVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsConfigVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsOrderVO; |
| | | import com.panzhihua.common.model.vos.community.questnaire.EditComActQuestnaireVo; |
| | | import com.panzhihua.common.model.vos.community.questnaire.QuestnaireVO; |
| | | import com.panzhihua.common.model.vos.community.questnaire.UsersAnswerQuestnaireVO; |
| | |
| | | import com.panzhihua.common.model.vos.shop.ShopStoreVO; |
| | | import com.panzhihua.common.model.vos.user.UserElectronicFileVO; |
| | | import com.panzhihua.common.model.vos.user.UserPhoneVO; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | |
| | | */ |
| | | @PostMapping("/screen/event/page") |
| | | R pageEventList(@RequestBody PageBaseDTO pageBaseDTO); |
| | | |
| | | /** |
| | | * 新增数字商业街商家 |
| | | * @param mcsMerchantDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/microcommercialstreet/merchant/add") |
| | | R addMcsMerchant(@RequestBody McsMerchantDTO mcsMerchantDTO); |
| | | |
| | | /** |
| | | * 编辑数字商业街商家 |
| | | * @param mcsMerchantDTO |
| | | * @return |
| | | */ |
| | | @PutMapping("/microcommercialstreet/merchant/put") |
| | | R putMcsMerchant(@RequestBody McsMerchantDTO mcsMerchantDTO); |
| | | |
| | | /** |
| | | * 查询数字商业街商家详情 |
| | | * @param merchantId |
| | | * @return |
| | | */ |
| | | @GetMapping("/microcommercialstreet/merchant/get") |
| | | R getMcsMerchant(@RequestParam("merchantId") Long merchantId); |
| | | |
| | | /** |
| | | * 删除数字商业街商家 |
| | | * @param merchantId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/microcommercialstreet/merchant/delete") |
| | | R deleteMcsMerchant(@RequestParam("merchantId") Long merchantId, @RequestParam("userId") Long userId); |
| | | |
| | | /** |
| | | * 分页查询数字商业街商家 |
| | | * @param pageMcsMerchantDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/microcommercialstreet/merchant/page") |
| | | R pageMcsMerchant(@RequestBody PageMcsMerchantDTO pageMcsMerchantDTO); |
| | | |
| | | /** |
| | | * 禁用/启用数字商业街商家 |
| | | * @param disableOrEnableMcsMerchantDTO |
| | | * @return |
| | | */ |
| | | @PutMapping("/microcommercialstreet/merchant/disable-or-enable") |
| | | R disableOrEnableMcsMerchant(@RequestBody DisableOrEnableMcsMerchantDTO disableOrEnableMcsMerchantDTO); |
| | | |
| | | /** |
| | | * 获取所有数字商业街配置 |
| | | * @return |
| | | */ |
| | | @GetMapping("/microcommercialstreet/config/all") |
| | | R getAllMcsConfig(); |
| | | |
| | | /** |
| | | * 修改数字商业街配置 |
| | | * @param configs |
| | | * @return |
| | | */ |
| | | @PutMapping("/microcommercialstreet/config/put") |
| | | R putMcsConfig(@RequestBody List<McsConfigVO> configs); |
| | | |
| | | /** |
| | | * 分页查询戳戳游戏 |
| | | * @param pageMcsGameDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/microcommercialstreet/game/page") |
| | | R pageMcsGame(@RequestBody PageMcsGameDTO pageMcsGameDTO); |
| | | |
| | | /** |
| | | * 设为/取消游戏热门 |
| | | * @param setPopularForGameDTO |
| | | * @return |
| | | */ |
| | | @PutMapping("/microcommercialstreet/game/setPopular") |
| | | R setPopularForGame(@RequestBody SetPopularForGameDTO setPopularForGameDTO); |
| | | |
| | | /** |
| | | * 上架/下架戳戳游戏 |
| | | * @param setShelfForGameDTO |
| | | * @return |
| | | */ |
| | | @PutMapping("/microcommercialstreet/game/setShelf") |
| | | R setShelfForGame(@RequestBody SetShelfForGameDTO setShelfForGameDTO); |
| | | |
| | | /** |
| | | * 删除戳戳游戏 |
| | | * @param gameId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/microcommercialstreet/game/delete") |
| | | R deleteMcsGame(@RequestParam("gameId") Long gameId, @RequestParam("userId") Long userId); |
| | | |
| | | /** |
| | | * 分页查询戳戳资讯 |
| | | * @param pageMcsInformationDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/microcommercialstreet/information/page") |
| | | R pageMcsInfo(@RequestBody PageMcsInformationDTO pageMcsInformationDTO); |
| | | |
| | | /** |
| | | * 上架/下架戳戳资讯 |
| | | * @param setShelfForInfoDTO |
| | | * @return |
| | | */ |
| | | @PutMapping("/microcommercialstreet/information/setShelf") |
| | | R setShelfForMcsInfo(@RequestBody SetShelfForInfoDTO setShelfForInfoDTO); |
| | | |
| | | /** |
| | | * 删除戳戳资讯 |
| | | * @param infoId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/microcommercialstreet/information/delete") |
| | | R deleteMcsInfo(@RequestParam("infoId") Long infoId, @RequestParam("userId") Long userId); |
| | | |
| | | /** |
| | | * 分页查询评价记录 |
| | | * @param pageMcsEvaluateDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/microcommercialstreet/evaluate/page") |
| | | R pageMcsEvaluate(@RequestBody PageMcsEvaluateDTO pageMcsEvaluateDTO); |
| | | |
| | | /** |
| | | * 查询评价记录详情 |
| | | * @param evaluateId |
| | | * @return |
| | | */ |
| | | @GetMapping("/microcommercialstreet/evaluate/get") |
| | | R getMcsEvaluate(@RequestParam("evaluateId") Long evaluateId); |
| | | |
| | | /** |
| | | * 删除评价记录 |
| | | * @param evaluateId |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/microcommercialstreet/evaluate/delete") |
| | | R deleteMcsEvaluate(@RequestParam("evaluateId") Long evaluateId); |
| | | |
| | | /** |
| | | * 新增戳戳游戏 |
| | | * @param mcsGameDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/microcommercialstreet/game/add") |
| | | R addMcsGame(@RequestBody McsGameDTO mcsGameDTO); |
| | | |
| | | /** |
| | | * 编辑戳戳游戏 |
| | | * @param mcsGameDTO |
| | | * @return |
| | | */ |
| | | @PutMapping("/microcommercialstreet/game/put") |
| | | R putMcsGame(@RequestBody McsGameDTO mcsGameDTO); |
| | | |
| | | /** |
| | | * 发布戳戳游戏 |
| | | * @param gameId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @GetMapping("/microcommercialstreet/game/publish") |
| | | R publishMcsGame(@RequestParam("gameId") Long gameId, @RequestParam("userId") Long userId); |
| | | |
| | | /** |
| | | * 结束戳戳游戏 |
| | | * @param gameId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @GetMapping("/microcommercialstreet/game/finish") |
| | | R finishMcsGame(@RequestParam("gameId") Long gameId, @RequestParam("userId") Long userId); |
| | | |
| | | /** |
| | | * 戳戳游戏/资讯顶部统计数据 |
| | | * @param type |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @GetMapping("/microcommercialstreet/statistics/top") |
| | | R getTopStatistics(@RequestParam("type") Integer type, @RequestParam("userId") Long userId); |
| | | |
| | | /** |
| | | * 新增戳戳资讯 |
| | | * @param mcsInfoDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/microcommercialstreet/information/add") |
| | | R addMcsInfo(@RequestBody McsInfoDTO mcsInfoDTO); |
| | | |
| | | /** |
| | | * 编辑戳戳资讯 |
| | | * @param mcsInfoDTO |
| | | * @return |
| | | */ |
| | | @PutMapping("/microcommercialstreet/information/put") |
| | | R putMcsInfo(@RequestBody McsInfoDTO mcsInfoDTO); |
| | | |
| | | /** |
| | | * 发布戳戳资讯 |
| | | * @param infoId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @GetMapping("/microcommercialstreet/information/publish") |
| | | R publishMcsInfo(@RequestParam("infoId") Long infoId, @RequestParam("userId") Long userId); |
| | | |
| | | /** |
| | | * 新增产品信息 |
| | | * @param mcsProductDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/microcommercialstreet/product/add") |
| | | R addMcsProduct(@RequestBody McsProductDTO mcsProductDTO); |
| | | |
| | | /** |
| | | * 编辑产品信息 |
| | | * @param mcsProductDTO |
| | | * @return |
| | | */ |
| | | @PutMapping("/microcommercialstreet/product/put") |
| | | R putMcsProduct(@RequestBody McsProductDTO mcsProductDTO); |
| | | |
| | | /** |
| | | * 删除产品信息 |
| | | * @param deleteProductDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/microcommercialstreet/product/delete") |
| | | R deleteMcsProduct(@RequestBody DeleteProductDTO deleteProductDTO); |
| | | |
| | | /** |
| | | * 上架/下架产品信息 |
| | | * @param setShelfForProductDTO |
| | | * @return |
| | | */ |
| | | @PutMapping("/microcommercialstreet/product/setShelf") |
| | | R setShelfForMcsProduct(@RequestBody SetShelfForProductDTO setShelfForProductDTO); |
| | | |
| | | /** |
| | | * 分页查询产品信息 |
| | | * @param pageMcsProductDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/microcommercialstreet/product/page") |
| | | R pageMcsProduct(@RequestBody PageMcsProductDTO pageMcsProductDTO); |
| | | |
| | | /** |
| | | * 获取产品标签列表 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @GetMapping("/microcommercialstreet/label/list") |
| | | R getMcsLabelList(@RequestParam("userId") Long userId); |
| | | |
| | | /** |
| | | * check商家/店铺是否有效 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @GetMapping("/shop/checkStoreIsValid") |
| | | R checkStoreIsValid(@RequestParam("userId") Long userId); |
| | | |
| | | /** |
| | | * 根据account查询微商业街商家信息 |
| | | * @param account |
| | | * @return |
| | | */ |
| | | @GetMapping("/microcommercialstreet/getMcsMerchantByAccount") |
| | | R getMcsMerchantByAccount(@RequestParam("account") String account); |
| | | |
| | | /** |
| | | * 完成订单更新/新增商家信息 |
| | | * @param merchantName |
| | | * @param configId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @GetMapping("/microcommercialstreet/updateAfterOrder") |
| | | R updateMcsMerchantAfterOrder(@RequestParam(value = "merchantName", required = false) String merchantName, |
| | | @RequestParam("configId") Long configId, @RequestParam("userId") Long userId); |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @PostMapping("/mcsOrder/queryAll") |
| | | R selectAllMscOrder(@RequestBody CommonPage commonPage); |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @GetMapping("/mcsOrder/{id}") |
| | | R selectOneMscOrder(@PathVariable("id") Long id); |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param mcsOrderVO 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/mcsOrder") |
| | | R insertMscOrder(@RequestBody McsOrderVO mcsOrderVO); |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param mcsOrderVO 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("/mcsOrder/update") |
| | | R updateMscOrder(@RequestBody McsOrderVO mcsOrderVO); |
| | | |
| | | /** |
| | | * 微信支付 |
| | | * @param mcsOrderVO |
| | | * @return |
| | | */ |
| | | @PostMapping("/mcsOrder/wxPay") |
| | | R wxPayMscOrder(McsOrderVO mcsOrderVO); |
| | | |
| | | /** |
| | | * 发送提醒短信 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/mcsOrder/sendContent") |
| | | R sendContentMcsOrder(@RequestParam("id") Long id); |
| | | |
| | | /** |
| | | *微信支付回调 |
| | | * @param mcsOrderVO |
| | | * @return |
| | | */ |
| | | @PostMapping("/mcsOrder/notify") |
| | | R notifyMcsOrder(@RequestBody McsOrderVO mcsOrderVO); |
| | | |
| | | /** |
| | | * 验证码登录 |
| | | * @param loginDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/microcommercialstreet/loginWithPhone") |
| | | R loginWithPhone(@RequestBody LoginWithPhoneDTO loginDTO); |
| | | |
| | | /** |
| | | * 首页顶部数据 |
| | | * @return |
| | | */ |
| | | @GetMapping("/microcommercialstreet/index/topData") |
| | | R getMcsIndexTopData(); |
| | | |
| | | /** |
| | | * 戳戳卷领取 |
| | | * @param gameId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @GetMapping("/microcommercialstreet/coupon/apply") |
| | | R applyMcsCoupon(@RequestParam("gameId") Long gameId, @RequestParam("userId") Long userId); |
| | | |
| | | /** |
| | | * h5分页查询戳戳资讯 |
| | | * @param pageMcsInformationDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/microcommercialstreet/information/pageH5") |
| | | R pageH5McsInfo(@RequestBody PageMcsInformationDTO pageMcsInformationDTO); |
| | | |
| | | /** |
| | | * h5分页查询戳戳游戏 |
| | | * @param pageMcsGameDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/microcommercialstreet/game/pageH5") |
| | | R pageH5McsGame(@RequestBody PageMcsGameDTO pageMcsGameDTO); |
| | | |
| | | /** |
| | | * 游戏详情 |
| | | * @param gameId |
| | | * @return |
| | | */ |
| | | @GetMapping("/microcommercialstreet/game/get") |
| | | R getMcsGame(@RequestParam("gameId") Long gameId); |
| | | |
| | | /** |
| | | * 资讯详情 |
| | | * @param infoId |
| | | * @return |
| | | */ |
| | | @GetMapping("/microcommercialstreet/info/get") |
| | | R getMcsInfo(@RequestParam("infoId") Long infoId); |
| | | |
| | | /** |
| | | * H5分页查询数字商业街商家 |
| | | * @param pageMcsMerchantDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/microcommercialstreet/merchant/pageH5") |
| | | R pageH5McsMerchant(@RequestBody PageMcsMerchantDTO pageMcsMerchantDTO); |
| | | |
| | | /** |
| | | * 我的戳戳卷 |
| | | * @param type |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @GetMapping("/microcommercialstreet/myCoupon") |
| | | R getMyCoupon(@RequestParam(value = "type", required = false) Integer type, @RequestParam("userId") Long userId); |
| | | |
| | | /** |
| | | * 新增评价记录 |
| | | * @param mcsEvaluateDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/microcommercialstreet/evaluate/add") |
| | | R addMcsEvaluate(@RequestBody McsEvaluateDTO mcsEvaluateDTO); |
| | | |
| | | /** |
| | | * 我的评价-参与游戏列表 |
| | | * @param pageJoinGameListDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/microcommercialstreet/joinGame/page") |
| | | R getJoinGameList(@RequestBody PageJoinGameListDTO pageJoinGameListDTO); |
| | | |
| | | /** |
| | | * 戳戳卷核销 |
| | | * @param couponId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @GetMapping("/microcommercialstreet/coupon/verify") |
| | | R verifyMcsCoupon(@RequestParam("couponId") Long couponId, @RequestParam("userId") Long userId); |
| | | |
| | | /** |
| | | * 分页查询核销记录 |
| | | * @param pageVerifyRecordDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/microcommercialstreet/verifyRecord/page") |
| | | R pageMcsVerifyRecord(@RequestBody PageVerifyRecordDTO pageVerifyRecordDTO); |
| | | |
| | | /** |
| | | * 游戏统计 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @GetMapping("/microcommercialstreet/game/statistics") |
| | | R getMcsGameStatistics(@RequestParam("userId") Long userId); |
| | | |
| | | /** |
| | | * 修改用戶信息 |
| | | * @param putUserInfoDTO |
| | | * @return |
| | | */ |
| | | @PutMapping("/microcommercialstreet/putUserInfo") |
| | | R putUserInfo(@RequestBody PutUserInfoDTO putUserInfoDTO); |
| | | |
| | | /** |
| | | * 根据userId获取商家信息 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @GetMapping("/microcommercialstreet/retrieveMcsMerchantInfoByUserId") |
| | | R retrieveMcsMerchantInfoByUserId(@RequestParam("userId") Long userId); |
| | | |
| | | /** |
| | | * 定时任务-每隔5分钟执行一次,将已到期的微商业街商家旗下所有的游戏/资讯全部下架 |
| | | * @return |
| | | */ |
| | | @GetMapping("/microcommercialstreet/offResourceForMcsMerchant") |
| | | R offResourceForMcsMerchant(); |
| | | |
| | | /** |
| | | * 获取产品信息详情 |
| | | * @param productId |
| | | * @return |
| | | */ |
| | | @GetMapping("/microcommercialstreet/product/get") |
| | | R getMcsProduct(@RequestParam("productId") Long productId); |
| | | |
| | | /** |
| | | * 定时任务-每隔5分钟执行一次,将已到期的微商业街游戏结束 |
| | | * @return |
| | | */ |
| | | @GetMapping("/microcommercialstreet/endStatusForMcsGame") |
| | | R endStatusForMcsGame(); |
| | | } |
| | |
| | | import com.panzhihua.common.model.dtos.DataKanBansDto; |
| | | import com.panzhihua.common.model.dtos.community.convenient.ConvenientMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.DisableOrEnableConvenientMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.BindUserPhoneDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.LoginWithPhoneDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsMerchantDTO; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | import com.panzhihua.common.model.vos.*; |
| | | import com.panzhihua.common.model.vos.shop.ShopStoreVO; |
| | | import com.panzhihua.common.model.vos.user.*; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | |
| | | */ |
| | | @GetMapping("/sysTemplateConfig/selectTemplate") |
| | | R<SysTemplateConfigVO> selectTemplate(@RequestParam("areaCode")String areaCode,@RequestParam("type")Integer type); |
| | | |
| | | /** |
| | | * 微商业街新增商家账号 |
| | | * @param mcsMerchantDTO |
| | | * @return 商家用户id |
| | | */ |
| | | @PostMapping("insertMcsMerchantAccount") |
| | | R addMcsMerchantUser(@RequestBody McsMerchantDTO mcsMerchantDTO); |
| | | |
| | | /** |
| | | * 微商业街修改商家账号 |
| | | * @param mcsMerchantDTO |
| | | * @return |
| | | */ |
| | | @PutMapping("putMcsMerchantUser") |
| | | R putMcsMerchantUser(@RequestBody McsMerchantDTO mcsMerchantDTO); |
| | | |
| | | /** |
| | | * 检查用户是否有效 |
| | | * @param userId |
| | | * @param type |
| | | * @return |
| | | */ |
| | | @PutMapping("checkUserIsValid") |
| | | Boolean checkUserIsValid(@RequestParam("userId") Long userId, @RequestParam("type") Integer type); |
| | | |
| | | /** |
| | | * 根据手机号、用户类型查询用户 |
| | | * @param phone |
| | | * @param type |
| | | * @return |
| | | */ |
| | | @GetMapping("/getSysUserByPhone") |
| | | R getSysUserByPhone(@RequestParam("phone") String phone, @RequestParam("type") Integer type); |
| | | |
| | | /** |
| | | * 发送验证码 |
| | | * @param phone 手机号 |
| | | * @param clientIP 用户ip |
| | | * @param prefixKey redis Key 前缀 |
| | | * @param limit 获取次数限制 |
| | | * @param timeout 超次数获取时间等待 |
| | | * @return |
| | | */ |
| | | @GetMapping("/sendMessageCode") |
| | | R sendMessageCode(@RequestParam("phone") String phone, |
| | | @RequestParam(value = "clientIP", required = false) String clientIP, |
| | | @RequestParam("prefixKey") String prefixKey, |
| | | @RequestParam("limit") Integer limit, |
| | | @RequestParam("timeout") Integer timeout); |
| | | |
| | | /** |
| | | * 根据openId获取微商业街用户 |
| | | * @param openid |
| | | * @return |
| | | */ |
| | | @GetMapping("/getMcsUserByOpenId") |
| | | R getMcsUserByOpenId(@RequestParam("openid") String openid); |
| | | |
| | | /** |
| | | * 商业街用户微信授权-绑定手机号 |
| | | * @param bindUserPhoneDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/mcs/bindPhone") |
| | | R bindOrAddMcsUser(@RequestBody @Valid BindUserPhoneDTO bindUserPhoneDTO); |
| | | } |
| | |
| | | public static SimpleDateFormat yyyyMM_format = new SimpleDateFormat("yyyy-MM"); |
| | | public static SimpleDateFormat format_yyymmdd = new SimpleDateFormat("yyyyMMdd"); |
| | | public static SimpleDateFormat format_yyyy = new SimpleDateFormat("yyyy"); |
| | | public static SimpleDateFormat format_yyyyMMddHHmmss = new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | private static DateTimeFormatter format_ymdhmssss = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS"); |
| | | private static DateTimeFormatter format_ymds = DateTimeFormatter.ofPattern("yyyyMMdd"); |
| | | private static DateTimeFormatter format_yms = DateTimeFormatter.ofPattern("yyyyMM"); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 计算剩余天数,不足一天按一天算 |
| | | * @param expireDate |
| | | * @return |
| | | */ |
| | | public static int retrieveRemainingDays(Date expireDate) { |
| | | Date nowDate = new Date(); |
| | | Calendar startDate = Calendar.getInstance(); |
| | | startDate.setTime(nowDate); |
| | | Calendar endDate = Calendar.getInstance(); |
| | | endDate.setTime(expireDate); |
| | | Calendar date = (Calendar) startDate.clone(); |
| | | int daysBetween = 0; |
| | | while (date.before(endDate)) { |
| | | date.add(Calendar.DAY_OF_MONTH, 1); |
| | | daysBetween++; |
| | | } |
| | | return daysBetween; |
| | | } |
| | | |
| | | /** |
| | | * 获取当前月第一天 |
| | | * |
| | | * @return |
New file |
| | |
| | | package com.panzhihua.common.utlis; |
| | | |
| | | import org.json.JSONObject; |
| | | import org.json.XML; |
| | | public class SmsUtil { |
| | | |
| | | private final static String URL = "https://106.ihuyi.com/webservice/sms.php?method=Submit"; |
| | | private final static String ACCOUNT="C87595580"; |
| | | private final static String PASSWORD="b66d918a598ad126b85b13e82a38e165"; |
| | | private final static String CONTENT="您有一笔订单还未付款,超时未付款订单将自动取消。"; |
| | | public static int sendCode(String mobile, String code){ |
| | | try { |
| | | String requestUrl=URL+"&account="+ACCOUNT+"&password="+PayUtil.MD5(PASSWORD)+"&mobile="+mobile+"&content="+"您的验证码是:"+code+"。请不要把验证码泄露给其他人。"; |
| | | String res=HttpClientUtil.httpGet(requestUrl, null,null); |
| | | JSONObject jsonObject=XML.toJSONObject(res); |
| | | if(jsonObject.get("SubmitResult")!=null){ |
| | | JSONObject result= (JSONObject) jsonObject.get("SubmitResult"); |
| | | if(result.get("code").equals(2)){ |
| | | return 1; |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | public int sendContent(String mobile){ |
| | | try { |
| | | String requestUrl=URL+"&account="+ACCOUNT+"&password="+PayUtil.MD5(PASSWORD)+"&mobile="+mobile+"&content="+CONTENT; |
| | | String res=HttpClientUtil.httpGet(requestUrl, null,null); |
| | | JSONObject jsonObject=XML.toJSONObject(res); |
| | | if(jsonObject.get("SubmitResult")!=null){ |
| | | JSONObject result= (JSONObject) jsonObject.get("SubmitResult"); |
| | | if(result.get("code").equals(2)){ |
| | | return 1; |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return 0; |
| | | } |
| | | } |
| | |
| | | parameters.put("paySign", sign); |
| | | return parameters; |
| | | } |
| | | public static String h5pay(String appid, String mchId, String payKey, String notifyUrl, String body, |
| | | String openid, String outTradeNo, BigDecimal money, String tradeType, String clientIp) { |
| | | String nonceStr = PayUtil.makeUUID(32); |
| | | SortedMap<Object, Object> params = new TreeMap<>(); |
| | | params.put("appid", appid); |
| | | params.put("body", body); |
| | | params.put("mch_id", mchId); |
| | | params.put("nonce_str", nonceStr); |
| | | params.put("notify_url", notifyUrl); |
| | | params.put("openid", openid); |
| | | params.put("out_trade_no", outTradeNo);// 商品订单号 |
| | | params.put("spbill_create_ip", clientIp);// 用户真实ip |
| | | params.put("total_fee", PayUtil.moneyToIntegerStr(money));// 费用的参数转型 |
| | | params.put("trade_type", tradeType);// 对接类型 |
| | | params.put("sign", PayUtil.createSign(PayCpmstant.DEFAULT_ENCODING, params, payKey));// MD5签名 |
| | | // 转换成xml |
| | | String xmlData = PayUtil.getRequestXml(params); |
| | | // 请求微信后台,获取支付id |
| | | String resXml = HttpClientUtil.httpsRequest(PayCpmstant.UNIFIEDORDER_URL, xmlData); |
| | | log.info("请求微信支付返回参数:" + resXml); |
| | | |
| | | org.json.JSONObject resultData = XML.toJSONObject(resXml); |
| | | JSONObject data = JSON.parseObject(resultData.get("xml").toString()); |
| | | JSONObject result = new JSONObject(); |
| | | |
| | | if (data.get("return_msg").equals(PayCpmstant.RETURN_MSG) |
| | | && data.get("return_code").equals(PayCpmstant.RETURN_CODE)) { |
| | | // 将微信统一下单成功的参数拼接再签名 |
| | | // 统一下单返回prepay_id |
| | | if(tradeType.equals("JSAPI")) { |
| | | String prepayId = "prepay_id=" + data.getString("prepay_id"); |
| | | // 时间戳 |
| | | Long timeStamp = System.currentTimeMillis() / 1000; |
| | | // 封装需要签名的字段 |
| | | SortedMap<Object, Object> payParams = new TreeMap<>(); |
| | | payParams.put("appId", appid); |
| | | payParams.put("nonceStr", nonceStr); |
| | | payParams.put("package", prepayId); |
| | | payParams.put("signType", PayCpmstant.SIGN_TYPE); |
| | | payParams.put("timeStamp", timeStamp); |
| | | // 将参数以及签名计算完成封装返回给前端 |
| | | result.put("timeStamp", timeStamp); |
| | | result.put("nonceStr", nonceStr); |
| | | result.put("package", prepayId); |
| | | result.put("signType", PayCpmstant.SIGN_TYPE); |
| | | result.put("paySign", PayUtil.createSign(PayCpmstant.DEFAULT_ENCODING, payParams, payKey)); |
| | | } |
| | | else if(tradeType.equals("NATIVE")) { |
| | | result.put("codeUrl",data.getString("code_url")); |
| | | } else if(tradeType.equals("MWEB")) { |
| | | result.put("mWebUrl",data.getString("mweb_url")); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | return result.toJSONString(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.api; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.api.ApiController; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsOrderVO; |
| | | import com.panzhihua.common.utlis.SmsUtil; |
| | | import com.panzhihua.service_community.entity.McsOrder; |
| | | import com.panzhihua.service_community.service.McsOrderService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 商业街订单表(McsOrder)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2022-01-04 16:10:07 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("mcsOrder") |
| | | public class McsOrderApi { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private McsOrderService mcsOrderService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | return this.mcsOrderService.pageList(commonPage); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable("id") Long id) { |
| | | return this.mcsOrderService.detail(id); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param mcsOrderVO 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping |
| | | public R insert(@RequestBody McsOrderVO mcsOrderVO) { |
| | | return this.mcsOrderService.insert(mcsOrderVO); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param mcsOrderVO 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody McsOrderVO mcsOrderVO) { |
| | | McsOrder mcsOrder=new McsOrder(); |
| | | BeanUtils.copyProperties(mcsOrderVO,mcsOrder); |
| | | return R.ok(this.mcsOrderService.updateById(mcsOrder)); |
| | | } |
| | | |
| | | /** |
| | | * 微信支付 |
| | | * @param mcsOrderVO |
| | | * @return |
| | | */ |
| | | @PostMapping("/wxPay") |
| | | public R wxPay(@RequestBody McsOrderVO mcsOrderVO){ |
| | | return this.mcsOrderService.wxPay(mcsOrderVO); |
| | | } |
| | | |
| | | /** |
| | | * 发送提醒短信 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/sendContent") |
| | | public R sendContent(@RequestParam("id") Long id){ |
| | | return this.mcsOrderService.sendContent(id); |
| | | } |
| | | |
| | | /** |
| | | *微信支付回调 |
| | | * @param mcsOrderVO |
| | | * @return |
| | | */ |
| | | @PostMapping("/notify") |
| | | public R notify(@RequestBody McsOrderVO mcsOrderVO){ |
| | | return this.mcsOrderService.notify(mcsOrderVO); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.api; |
| | | |
| | | import java.util.List; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.DeleteProductDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PutUserInfoDTO; |
| | | 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.panzhihua.common.model.dtos.community.microCommercialStreet.DisableOrEnableMcsMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.LoginWithPhoneDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsEvaluateDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsGameDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsInfoDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsProductDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageJoinGameListDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsEvaluateDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsGameDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsInformationDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsProductDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageVerifyRecordDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetPopularForGameDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetShelfForGameDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetShelfForInfoDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetShelfForProductDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsConfigVO; |
| | | import com.panzhihua.service_community.service.McsConfigService; |
| | | import com.panzhihua.service_community.service.McsCouponService; |
| | | import com.panzhihua.service_community.service.McsEvaluateService; |
| | | import com.panzhihua.service_community.service.McsGameService; |
| | | import com.panzhihua.service_community.service.McsInformationService; |
| | | import com.panzhihua.service_community.service.McsLabelService; |
| | | import com.panzhihua.service_community.service.McsMerchantService; |
| | | import com.panzhihua.service_community.service.McsProductService; |
| | | import com.panzhihua.service_community.service.McsVerifiedRecordService; |
| | | |
| | | /** |
| | | * @title: MicroCommercialStreetApi |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 微商业街相关接口 |
| | | * @author: hans |
| | | * @date: 2021/12/28 14:18 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/microcommercialstreet") |
| | | public class MicroCommercialStreetApi { |
| | | |
| | | @Resource |
| | | private McsMerchantService mcsMerchantService; |
| | | @Resource |
| | | private McsConfigService mcsConfigService; |
| | | @Resource |
| | | private McsGameService mcsGameService; |
| | | @Resource |
| | | private McsInformationService mcsInformationService; |
| | | @Resource |
| | | private McsEvaluateService mcsEvaluateService; |
| | | @Resource |
| | | private McsProductService mcsProductService; |
| | | @Resource |
| | | private McsLabelService mcsLabelService; |
| | | @Resource |
| | | private McsCouponService mcsCouponService; |
| | | @Resource |
| | | private McsVerifiedRecordService mcsVerifiedRecordService; |
| | | |
| | | /** |
| | | * 新增数字商业街商家 |
| | | * @param mcsMerchantDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/merchant/add") |
| | | public R addMcsMerchant(@RequestBody McsMerchantDTO mcsMerchantDTO) { |
| | | return mcsMerchantService.addMcsMerchant(mcsMerchantDTO); |
| | | } |
| | | |
| | | /** |
| | | * 编辑数字商业街商家 |
| | | * @param mcsMerchantDTO |
| | | * @return |
| | | */ |
| | | @PutMapping("/merchant/put") |
| | | public R putMcsMerchant(@RequestBody McsMerchantDTO mcsMerchantDTO) { |
| | | return mcsMerchantService.putMcsMerchant(mcsMerchantDTO); |
| | | } |
| | | |
| | | /** |
| | | * 查询数字商业街商家详情 |
| | | * @param merchantId |
| | | * @return |
| | | */ |
| | | @GetMapping("/merchant/get") |
| | | public R getMcsMerchant(@RequestParam("merchantId") Long merchantId) { |
| | | return mcsMerchantService.getMcsMerchant(merchantId); |
| | | } |
| | | |
| | | /** |
| | | * 删除数字商业街商家 |
| | | * @param merchantId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/merchant/delete") |
| | | public R deleteMcsMerchant(@RequestParam("merchantId") Long merchantId, @RequestParam("userId") Long userId) { |
| | | return mcsMerchantService.deleteMcsMerchant(merchantId, userId); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询数字商业街商家 |
| | | * @param pageMcsMerchantDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/merchant/page") |
| | | public R pageMcsMerchant(@RequestBody PageMcsMerchantDTO pageMcsMerchantDTO) { |
| | | return mcsMerchantService.pageMcsMerchant(pageMcsMerchantDTO); |
| | | } |
| | | |
| | | /** |
| | | * 禁用/启用数字商业街商家 |
| | | * @param disableOrEnableMcsMerchantDTO |
| | | * @return |
| | | */ |
| | | @PutMapping("/merchant/disable-or-enable") |
| | | public R disableOrEnableMcsMerchant(@RequestBody DisableOrEnableMcsMerchantDTO disableOrEnableMcsMerchantDTO) { |
| | | return mcsMerchantService.disableOrEnableMcsMerchant(disableOrEnableMcsMerchantDTO); |
| | | } |
| | | |
| | | /** |
| | | * 获取所有数字商业街配置 |
| | | * @return |
| | | */ |
| | | @GetMapping("/config/all") |
| | | public R getAllMcsConfig() { |
| | | return mcsConfigService.getAllMcsConfig(); |
| | | } |
| | | |
| | | /** |
| | | * 修改数字商业街配置 |
| | | * @param configs |
| | | * @return |
| | | */ |
| | | @PutMapping("/config/put") |
| | | public R putMcsConfig(@RequestBody List<McsConfigVO> configs) { |
| | | return mcsConfigService.putMcsConfig(configs); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询戳戳游戏 |
| | | * @param pageMcsGameDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/game/page") |
| | | public R pageMcsGame(@RequestBody PageMcsGameDTO pageMcsGameDTO) { |
| | | return mcsGameService.pageMcsGame(pageMcsGameDTO); |
| | | } |
| | | |
| | | /** |
| | | * 设为/取消游戏热门 |
| | | * @param setPopularForGameDTO |
| | | * @return |
| | | */ |
| | | @PutMapping("/game/setPopular") |
| | | public R setPopularForGame(@RequestBody SetPopularForGameDTO setPopularForGameDTO) { |
| | | return mcsGameService.setPopularForGame(setPopularForGameDTO); |
| | | } |
| | | |
| | | /** |
| | | * 上架/下架戳戳游戏 |
| | | * @param setShelfForGameDTO |
| | | * @return |
| | | */ |
| | | @PutMapping("/game/setShelf") |
| | | public R setShelfForGame(@RequestBody SetShelfForGameDTO setShelfForGameDTO) { |
| | | return mcsGameService.setShelfForGame(setShelfForGameDTO); |
| | | } |
| | | |
| | | /** |
| | | * 删除戳戳游戏 |
| | | * @param gameId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/game/delete") |
| | | public R deleteMcsGame(@RequestParam("gameId") Long gameId, @RequestParam("userId") Long userId) { |
| | | return mcsGameService.deleteMcsGame(gameId, userId); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询戳戳资讯 |
| | | * @param pageMcsInformationDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/information/page") |
| | | public R pageMcsInfo(@RequestBody PageMcsInformationDTO pageMcsInformationDTO) { |
| | | return mcsInformationService.pageMcsInfo(pageMcsInformationDTO); |
| | | } |
| | | |
| | | /** |
| | | * 上架/下架戳戳资讯 |
| | | * @param setShelfForInfoDTO |
| | | * @return |
| | | */ |
| | | @PutMapping("/information/setShelf") |
| | | public R setShelfForMcsInfo(@RequestBody SetShelfForInfoDTO setShelfForInfoDTO) { |
| | | return mcsInformationService.setShelfForMcsInfo(setShelfForInfoDTO); |
| | | } |
| | | |
| | | /** |
| | | * 删除戳戳资讯 |
| | | * @param infoId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/information/delete") |
| | | public R deleteMcsInfo(@RequestParam("infoId") Long infoId, @RequestParam("userId") Long userId) { |
| | | return mcsInformationService.deleteMcsInfo(infoId, userId); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询评价记录 |
| | | * @param pageMcsEvaluateDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/evaluate/page") |
| | | public R pageMcsEvaluate(@RequestBody PageMcsEvaluateDTO pageMcsEvaluateDTO) { |
| | | return mcsEvaluateService.pageMcsEvaluate(pageMcsEvaluateDTO); |
| | | } |
| | | |
| | | /** |
| | | * 查询评价记录详情 |
| | | * @param evaluateId |
| | | * @return |
| | | */ |
| | | @GetMapping("/evaluate/get") |
| | | public R getMcsEvaluate(@RequestParam("evaluateId") Long evaluateId) { |
| | | return mcsEvaluateService.getMcsEvaluate(evaluateId); |
| | | } |
| | | |
| | | /** |
| | | * 删除评价记录 |
| | | * @param evaluateId |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/evaluate/delete") |
| | | public R deleteMcsEvaluate(@RequestParam("evaluateId") Long evaluateId) { |
| | | return mcsEvaluateService.deleteMcsEvaluate(evaluateId); |
| | | } |
| | | |
| | | /** |
| | | * 新增戳戳游戏 |
| | | * @param mcsGameDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/game/add") |
| | | public R addMcsGame(@RequestBody McsGameDTO mcsGameDTO) { |
| | | return mcsGameService.addMcsGame(mcsGameDTO); |
| | | } |
| | | |
| | | /** |
| | | * 编辑戳戳游戏 |
| | | * @param mcsGameDTO |
| | | * @return |
| | | */ |
| | | @PutMapping("/game/put") |
| | | public R putMcsGame(@RequestBody McsGameDTO mcsGameDTO) { |
| | | return mcsGameService.putMcsGame(mcsGameDTO); |
| | | } |
| | | |
| | | /** |
| | | * 发布戳戳游戏 |
| | | * @param gameId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @GetMapping("/game/publish") |
| | | public R publishMcsGame(@RequestParam("gameId") Long gameId, @RequestParam("userId") Long userId) { |
| | | return mcsGameService.publishMcsGame(gameId, userId); |
| | | } |
| | | |
| | | /** |
| | | * 结束戳戳游戏 |
| | | * @param gameId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @GetMapping("/game/finish") |
| | | public R finishMcsGame(@RequestParam("gameId") Long gameId, @RequestParam("userId") Long userId) { |
| | | return mcsGameService.finishMcsGame(gameId, userId); |
| | | } |
| | | |
| | | /** |
| | | * 戳戳游戏/资讯顶部统计数据 |
| | | * @param type |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @GetMapping("/statistics/top") |
| | | public R getTopStatistics(@RequestParam("type") Integer type, @RequestParam("userId") Long userId) { |
| | | if (type.equals(1)) { |
| | | //戳戳游戏 |
| | | return mcsGameService.getTopStatistics(userId); |
| | | } else if (type.equals(2)) { |
| | | //戳戳资讯 |
| | | return mcsInformationService.getTopStatistics(userId); |
| | | } else { |
| | | return R.fail("未知错误"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 新增戳戳资讯 |
| | | * @param mcsInfoDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/information/add") |
| | | public R addMcsInfo(@RequestBody McsInfoDTO mcsInfoDTO) { |
| | | return mcsInformationService.addMcsInfo(mcsInfoDTO); |
| | | } |
| | | |
| | | /** |
| | | * 编辑戳戳资讯 |
| | | * @param mcsInfoDTO |
| | | * @return |
| | | */ |
| | | @PutMapping("/information/put") |
| | | public R putMcsInfo(@RequestBody McsInfoDTO mcsInfoDTO) { |
| | | return mcsInformationService.putMcsInfo(mcsInfoDTO); |
| | | } |
| | | |
| | | /** |
| | | * 发布戳戳资讯 |
| | | * @param infoId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @GetMapping("/information/publish") |
| | | public R publishMcsInfo(@RequestParam("infoId") Long infoId, @RequestParam("userId") Long userId) { |
| | | return mcsInformationService.publishMcsInfo(infoId, userId); |
| | | } |
| | | |
| | | /** |
| | | * 新增产品信息 |
| | | * @param mcsProductDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/product/add") |
| | | public R addMcsProduct(@RequestBody McsProductDTO mcsProductDTO) { |
| | | return mcsProductService.addMcsProduct(mcsProductDTO); |
| | | } |
| | | |
| | | /** |
| | | * 编辑产品信息 |
| | | * @param mcsProductDTO |
| | | * @return |
| | | */ |
| | | @PutMapping("/product/put") |
| | | public R putMcsProduct(@RequestBody McsProductDTO mcsProductDTO) { |
| | | return mcsProductService.putMcsProduct(mcsProductDTO); |
| | | } |
| | | |
| | | /** |
| | | * 删除产品信息 |
| | | * @param deleteProductDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/product/delete") |
| | | public R deleteMcsProduct(@RequestBody DeleteProductDTO deleteProductDTO) { |
| | | return mcsProductService.deleteMcsProduct(deleteProductDTO); |
| | | } |
| | | |
| | | /** |
| | | * 上架/下架产品信息 |
| | | * @param setShelfForProductDTO |
| | | * @return |
| | | */ |
| | | @PutMapping("/product/setShelf") |
| | | public R setShelfForMcsProduct(@RequestBody SetShelfForProductDTO setShelfForProductDTO) { |
| | | return mcsProductService.setShelfForMcsProduct(setShelfForProductDTO); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询产品信息 |
| | | * @param pageMcsProductDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/product/page") |
| | | public R pageMcsProduct(@RequestBody PageMcsProductDTO pageMcsProductDTO) { |
| | | return mcsProductService.pageMcsProduct(pageMcsProductDTO); |
| | | } |
| | | |
| | | /** |
| | | * 获取产品标签列表 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @GetMapping("/label/list") |
| | | public R getMcsLabelList(@RequestParam("userId") Long userId) { |
| | | return mcsLabelService.getMcsLabelList(userId); |
| | | } |
| | | |
| | | /** |
| | | * 根据account查询微商业街商家信息 |
| | | * @param account |
| | | * @return |
| | | */ |
| | | @GetMapping("/getMcsMerchantByAccount") |
| | | public R getMcsMerchantByAccount(@RequestParam("account") String account) { |
| | | return mcsMerchantService.getMcsMerchantByAccount(account); |
| | | } |
| | | |
| | | /** |
| | | * 完成订单更新/新增商家信息 |
| | | * @param orderNo |
| | | * @param configId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @GetMapping("/updateAfterOrder") |
| | | public R updateMcsMerchantAfterOrder(@RequestParam(value = "orderNo") String orderNo, |
| | | @RequestParam("configId") Long configId, |
| | | @RequestParam("userId") Long userId) { |
| | | return mcsMerchantService.updateOrAddMcsMerchantAfterOrder(orderNo, configId, userId); |
| | | } |
| | | |
| | | /** |
| | | * 验证码登录 |
| | | * @param loginDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/loginWithPhone") |
| | | public R loginWithPhone(@RequestBody LoginWithPhoneDTO loginDTO) { |
| | | return mcsMerchantService.loginWithPhone(loginDTO); |
| | | } |
| | | |
| | | /** |
| | | * 首页顶部数据 |
| | | * @return |
| | | */ |
| | | @GetMapping("/index/topData") |
| | | public R getMcsIndexTopData() { |
| | | return mcsMerchantService.getMcsIndexTopData(); |
| | | } |
| | | |
| | | /** |
| | | * 戳戳卷领取 |
| | | * @param gameId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @GetMapping("/coupon/apply") |
| | | public R applyMcsCoupon(@RequestParam("gameId") Long gameId, @RequestParam("userId") Long userId) { |
| | | return mcsGameService.applyMcsCoupon(gameId, userId); |
| | | } |
| | | |
| | | /** |
| | | * h5分页查询戳戳资讯 |
| | | * @param pageMcsInformationDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/information/pageH5") |
| | | public R pageH5McsInfo(@RequestBody PageMcsInformationDTO pageMcsInformationDTO) { |
| | | return mcsInformationService.pageH5McsInfo(pageMcsInformationDTO); |
| | | } |
| | | |
| | | /** |
| | | * h5分页查询戳戳游戏 |
| | | * @param pageMcsGameDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/game/pageH5") |
| | | public R pageH5McsGame(@RequestBody PageMcsGameDTO pageMcsGameDTO) { |
| | | return mcsGameService.pageH5McsGame(pageMcsGameDTO); |
| | | } |
| | | |
| | | /** |
| | | * 游戏详情 |
| | | * @param gameId |
| | | * @return |
| | | */ |
| | | @GetMapping("/game/get") |
| | | public R getMcsGame(@RequestParam("gameId") Long gameId) { |
| | | return mcsGameService.getMcsGame(gameId); |
| | | } |
| | | |
| | | /** |
| | | * 资讯详情 |
| | | * @param infoId |
| | | * @return |
| | | */ |
| | | @GetMapping("/info/get") |
| | | public R getMcsInfo(@RequestParam("infoId") Long infoId) { |
| | | return mcsInformationService.getMcsInfo(infoId); |
| | | } |
| | | |
| | | /** |
| | | * H5分页查询数字商业街商家 |
| | | * @param pageMcsMerchantDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/merchant/pageH5") |
| | | public R pageH5McsMerchant(@RequestBody PageMcsMerchantDTO pageMcsMerchantDTO) { |
| | | return mcsMerchantService.pageH5McsMerchant(pageMcsMerchantDTO); |
| | | } |
| | | |
| | | /** |
| | | * 我的戳戳卷 |
| | | * @param type |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @GetMapping("/myCoupon") |
| | | public R getMyCoupon(@RequestParam(value = "type", required = false) Integer type, @RequestParam("userId") Long userId) { |
| | | return mcsCouponService.getMyCoupon(type, userId); |
| | | } |
| | | |
| | | /** |
| | | * 新增评价记录 |
| | | * @param mcsEvaluateDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/evaluate/add") |
| | | public R addMcsEvaluate(@RequestBody McsEvaluateDTO mcsEvaluateDTO) { |
| | | return mcsEvaluateService.addMcsEvaluate(mcsEvaluateDTO); |
| | | } |
| | | |
| | | /** |
| | | * 我的评价-参与游戏列表 |
| | | * @param pageJoinGameListDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/joinGame/page") |
| | | public R getJoinGameList(@RequestBody PageJoinGameListDTO pageJoinGameListDTO) { |
| | | return mcsCouponService.getJoinGameList(pageJoinGameListDTO); |
| | | } |
| | | |
| | | /** |
| | | * 戳戳卷核销 |
| | | * @param couponId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @GetMapping("/coupon/verify") |
| | | public R verifyMcsCoupon(@RequestParam("couponId") Long couponId, @RequestParam("userId") Long userId) { |
| | | return mcsCouponService.verifyMcsCoupon(couponId, userId); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询核销记录 |
| | | * @param pageVerifyRecordDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/verifyRecord/page") |
| | | public R pageMcsVerifyRecord(@RequestBody PageVerifyRecordDTO pageVerifyRecordDTO) { |
| | | return mcsVerifiedRecordService.pageMcsVerifyRecord(pageVerifyRecordDTO); |
| | | } |
| | | |
| | | /** |
| | | * 游戏统计 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @GetMapping("/game/statistics") |
| | | public R getMcsGameStatistics(@RequestParam("userId") Long userId) { |
| | | return mcsCouponService.getMcsGameStatistics(userId); |
| | | } |
| | | |
| | | /** |
| | | * 修改用戶信息 |
| | | * @param putUserInfoDTO |
| | | * @return |
| | | */ |
| | | @PutMapping("/putUserInfo") |
| | | public R putUserInfo(@RequestBody PutUserInfoDTO putUserInfoDTO) { |
| | | return mcsMerchantService.putUserInfo(putUserInfoDTO); |
| | | } |
| | | |
| | | /** |
| | | * 根据userId获取商家信息 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @GetMapping("/retrieveMcsMerchantInfoByUserId") |
| | | public R retrieveMcsMerchantInfoByUserId(@RequestParam("userId") Long userId) { |
| | | return mcsMerchantService.retrieveMcsMerchantInfoByUserId(userId); |
| | | } |
| | | |
| | | /** |
| | | * 定时任务-每隔5分钟执行一次,将已到期的微商业街商家旗下所有的游戏/资讯全部下架 |
| | | * @return |
| | | */ |
| | | @GetMapping("/offResourceForMcsMerchant") |
| | | public R offResourceForMcsMerchant() { |
| | | return mcsMerchantService.offResourceForMcsMerchant(); |
| | | } |
| | | |
| | | /** |
| | | * 获取产品信息详情 |
| | | * @param productId |
| | | * @return |
| | | */ |
| | | @GetMapping("/product/get") |
| | | public R getMcsProduct(@RequestParam("productId") Long productId) { |
| | | return mcsProductService.getMcsProduct(productId); |
| | | } |
| | | |
| | | /** |
| | | * 定时任务-每隔5分钟执行一次,将已到期的微商业街游戏结束 |
| | | * @return |
| | | */ |
| | | @GetMapping("/endStatusForMcsGame") |
| | | public R endStatusForMcsGame() { |
| | | return mcsGameService.endStatusForMcsGame(); |
| | | } |
| | | } |
| | |
| | | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.panzhihua.common.model.dtos.PageDTO; |
| | | import com.panzhihua.common.model.dtos.shop.*; |
| | | import com.panzhihua.common.model.dtos.shop.ComShopAddressDTO; |
| | | import com.panzhihua.common.model.dtos.shop.ComShopCartDTO; |
| | | import com.panzhihua.common.model.dtos.shop.ComShopEditNubCartDTO; |
| | | import com.panzhihua.common.model.dtos.shop.ComShopFundsExportDTO; |
| | | import com.panzhihua.common.model.dtos.shop.ComShopGoodsDTO; |
| | | import com.panzhihua.common.model.dtos.shop.ComShopOrderCreateDTO; |
| | | import com.panzhihua.common.model.dtos.shop.ComShopOrderDeliverDTO; |
| | | import com.panzhihua.common.model.dtos.shop.ComShopOrderExportDTO; |
| | | import com.panzhihua.common.model.dtos.shop.ComShopOrderPreviewDTO; |
| | | import com.panzhihua.common.model.dtos.shop.ComShopOrderQueryDTO; |
| | | import com.panzhihua.common.model.dtos.shop.ComShopOrderShipDTO; |
| | | import com.panzhihua.common.model.dtos.shop.ComShopSysConfDTO; |
| | | import com.panzhihua.common.model.dtos.shop.OrderPayDTO; |
| | | import com.panzhihua.common.model.dtos.shop.PageComOrderListDTO; |
| | | import com.panzhihua.common.model.dtos.shop.PageComShopAddressDTO; |
| | | import com.panzhihua.common.model.dtos.shop.PageComShopFundsSearchDTO; |
| | | import com.panzhihua.common.model.dtos.shop.PageComShopGoodsDTO; |
| | | import com.panzhihua.common.model.dtos.shop.PageComShopOrderSearchDTO; |
| | | import com.panzhihua.common.model.dtos.shop.PageComShopStoreDTO; |
| | | import com.panzhihua.common.model.dtos.shop.PageComShopSysConfDTO; |
| | | import com.panzhihua.common.model.dtos.shop.WxPayNotifyOrderDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.shop.AddShopGoodsVO; |
| | | import com.panzhihua.common.model.vos.shop.ComShopSysConfVO; |
| | | import com.panzhihua.common.model.vos.shop.ShopOperLogVO; |
| | | import com.panzhihua.common.model.vos.shop.ShopStoreVO; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.service_community.model.dos.ComShopSysConfDO; |
| | | import com.panzhihua.service_community.service.*; |
| | | import com.panzhihua.service_community.service.ComShopCartService; |
| | | import com.panzhihua.service_community.service.ComShopGoodsService; |
| | | import com.panzhihua.service_community.service.ComShopOperLogService; |
| | | import com.panzhihua.service_community.service.ComShopOrderService; |
| | | import com.panzhihua.service_community.service.ComShopStoreService; |
| | | import com.panzhihua.service_community.service.ComShopSysConfService; |
| | | import com.panzhihua.service_community.service.ComShopUserAddressService; |
| | | import com.panzhihua.service_community.service.ConvenientMerchantService; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | |
| | | private ComShopUserAddressService comShopUserAddressService; |
| | | @Resource |
| | | private ComShopSysConfService comShopSysConfService; |
| | | @Resource |
| | | private ConvenientMerchantService convenientMerchantService; |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | /** |
| | | * 店铺列表-分页查询 |
| | |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * check商家/店铺是否有效 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @GetMapping("/checkStoreIsValid") |
| | | public R checkStoreIsValid(@RequestParam("userId") Long userId) { |
| | | Boolean isShopValid = comShopStoreService.checkStoreIsValid(userId); |
| | | Boolean isConvenientValid = convenientMerchantService.checkStoreIsValid(userId); |
| | | Boolean isMcsValid = userService.checkUserIsValid(userId, 11); |
| | | return R.ok(isShopValid || isConvenientValid || isMcsValid); |
| | | } |
| | | } |
| | |
| | | public static final String Order_ROUTING_KEY="order.key"; |
| | | public static final String Order_EXCHANGE="order.exchange"; |
| | | |
| | | public static final String McsOrder_QUEUE="mcsOrder.queue"; |
| | | public static final String McsOrder_ROUTING_KEY="mcsOrder.key"; |
| | | public static final String McsOrder_EXCHANGE="mcsOrder.exchange"; |
| | | |
| | | |
| | | @Bean |
| | |
| | | } |
| | | |
| | | @Bean |
| | | public Queue mcsOrderQueue(){ |
| | | return new Queue(McsOrder_QUEUE,true,false,false,null); |
| | | } |
| | | |
| | | @Bean |
| | | public Exchange mcsOrderExchange(){ |
| | | Map<String, Object> arguments = new HashMap<>(); |
| | | arguments.put("x-delayed-type", ExchangeTypes.DIRECT); |
| | | return new CustomExchange(McsOrder_EXCHANGE,"x-delayed-message",true,false,arguments); |
| | | } |
| | | |
| | | @Bean |
| | | public Binding mcsOrderBinding(){ |
| | | return BindingBuilder.bind(mcsOrderQueue()).to(mcsOrderExchange()).with(McsOrder_ROUTING_KEY).noargs(); |
| | | } |
| | | |
| | | @Bean |
| | | public Queue orderQueue(){ |
| | | return new Queue(Order_QUEUE,true,false,false,null); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import com.panzhihua.service_community.entity.McsConfig; |
| | | |
| | | /** |
| | | * (McsConfig)表数据库访问层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-28 14:37:06 |
| | | */ |
| | | @Mapper |
| | | public interface McsConfigDAO extends BaseMapper<McsConfig> { |
| | | |
| | | /** |
| | | * 批量新增数据(MyBatis原生foreach方法) |
| | | * |
| | | * @param entities |
| | | * List<McsConfig> 实例对象列表 |
| | | * @return 影响行数 |
| | | */ |
| | | int insertBatch(@Param("entities") List<McsConfig> entities); |
| | | |
| | | /** |
| | | * 批量新增或按主键更新数据(MyBatis原生foreach方法) |
| | | * |
| | | * @param entities |
| | | * List<McsConfig> 实例对象列表 |
| | | * @return 影响行数 |
| | | * @throws org.springframework.jdbc.BadSqlGrammarException |
| | | * 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参 |
| | | */ |
| | | int insertOrUpdateBatch(@Param("entities") List<McsConfig> entities); |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageJoinGameListDTO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.GameStatisticsVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsCouponVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.MyCouponVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import com.panzhihua.service_community.entity.McsCoupon; |
| | | |
| | | /** |
| | | * (McsCoupon)表数据库访问层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-28 14:37:07 |
| | | */ |
| | | @Mapper |
| | | public interface McsCouponDAO extends BaseMapper<McsCoupon> { |
| | | |
| | | /** |
| | | * 批量新增数据(MyBatis原生foreach方法) |
| | | * |
| | | * @param entities |
| | | * List<McsCoupon> 实例对象列表 |
| | | * @return 影响行数 |
| | | */ |
| | | int insertBatch(@Param("entities") List<McsCoupon> entities); |
| | | |
| | | /** |
| | | * 批量新增或按主键更新数据(MyBatis原生foreach方法) |
| | | * |
| | | * @param entities |
| | | * List<McsCoupon> 实例对象列表 |
| | | * @return 影响行数 |
| | | * @throws org.springframework.jdbc.BadSqlGrammarException |
| | | * 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参 |
| | | */ |
| | | int insertOrUpdateBatch(@Param("entities") List<McsCoupon> entities); |
| | | |
| | | /** |
| | | * 获取我的戳戳卷统计数据 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | MyCouponVO getMyCouponData(@Param("userId") Long userId); |
| | | |
| | | /** |
| | | * 获取用户戳戳卷列表 |
| | | * @param type |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | List<McsCouponVO> getCouponList(@Param("type") Integer type, @Param("userId") Long userId); |
| | | |
| | | /** |
| | | * 我的评价-参与游戏列表 |
| | | * @param page |
| | | * @param pageJoinGameListDTO |
| | | * @return |
| | | */ |
| | | IPage<McsCouponVO> pageJoinGameList(@Param("page") Page page, @Param("pageJoinGameListDTO") PageJoinGameListDTO pageJoinGameListDTO); |
| | | |
| | | /** |
| | | * 游戏统计 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | GameStatisticsVO getMcsGameStatistics(@Param("userId") Long userId); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsEvaluateDTO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsEvaluateVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import com.panzhihua.service_community.entity.McsEvaluate; |
| | | |
| | | /** |
| | | * (McsEvaluate)表数据库访问层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-28 14:37:08 |
| | | */ |
| | | @Mapper |
| | | public interface McsEvaluateDAO extends BaseMapper<McsEvaluate> { |
| | | |
| | | /** |
| | | * 批量新增数据(MyBatis原生foreach方法) |
| | | * |
| | | * @param entities |
| | | * List<McsEvaluate> 实例对象列表 |
| | | * @return 影响行数 |
| | | */ |
| | | int insertBatch(@Param("entities") List<McsEvaluate> entities); |
| | | |
| | | /** |
| | | * 批量新增或按主键更新数据(MyBatis原生foreach方法) |
| | | * |
| | | * @param entities |
| | | * List<McsEvaluate> 实例对象列表 |
| | | * @return 影响行数 |
| | | * @throws org.springframework.jdbc.BadSqlGrammarException |
| | | * 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参 |
| | | */ |
| | | int insertOrUpdateBatch(@Param("entities") List<McsEvaluate> entities); |
| | | |
| | | /** |
| | | * 分页查询戳戳游戏评价记录 |
| | | * @param page |
| | | * @param pageMcsEvaluateDTO |
| | | * @return |
| | | */ |
| | | IPage<McsEvaluateVO> pageMcsEvaluate(@Param("page") Page page, @Param("pageMcsEvaluateDTO") PageMcsEvaluateDTO pageMcsEvaluateDTO); |
| | | |
| | | /** |
| | | * 获取评价详情 |
| | | * @param evaluateId |
| | | * @return |
| | | */ |
| | | McsEvaluateVO getMcsEvaluate(@Param("evaluateId") Long evaluateId); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsGameDTO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsGameVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import com.panzhihua.service_community.entity.McsGame; |
| | | |
| | | /** |
| | | * (McsGame)表数据库访问层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-28 14:37:09 |
| | | */ |
| | | @Mapper |
| | | public interface McsGameDAO extends BaseMapper<McsGame> { |
| | | |
| | | /** |
| | | * 批量新增数据(MyBatis原生foreach方法) |
| | | * |
| | | * @param entities |
| | | * List<McsGame> 实例对象列表 |
| | | * @return 影响行数 |
| | | */ |
| | | int insertBatch(@Param("entities") List<McsGame> entities); |
| | | |
| | | /** |
| | | * 批量新增或按主键更新数据(MyBatis原生foreach方法) |
| | | * |
| | | * @param entities |
| | | * List<McsGame> 实例对象列表 |
| | | * @return 影响行数 |
| | | * @throws org.springframework.jdbc.BadSqlGrammarException |
| | | * 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参 |
| | | */ |
| | | int insertOrUpdateBatch(@Param("entities") List<McsGame> entities); |
| | | |
| | | /** |
| | | * 分页查询戳戳游戏 |
| | | * @param page |
| | | * @param pageMcsGameDTO |
| | | * @return |
| | | */ |
| | | IPage<McsGameVO> pageMcsGame(@Param("page") Page page, @Param("pageMcsGameDTO") PageMcsGameDTO pageMcsGameDTO); |
| | | |
| | | /** |
| | | * 查询商家已发布数 |
| | | * @param merchantId |
| | | * @return |
| | | */ |
| | | Integer selectPublishCount(@Param("merchantId") Long merchantId); |
| | | |
| | | /** |
| | | * 查询商家下已被领取的卷总数 |
| | | * @param merchantId |
| | | * @return |
| | | */ |
| | | Integer selectAppliedCount(@Param("merchantId") Long merchantId); |
| | | |
| | | /** |
| | | * 查询商家下已被核销的卷总数 |
| | | * @param merchantId |
| | | * @return |
| | | */ |
| | | Integer selectVerifiedCount(@Param("merchantId") Long merchantId); |
| | | |
| | | /** |
| | | * 获取热门游戏 |
| | | * @return |
| | | */ |
| | | McsGameVO selectPopularGame(); |
| | | |
| | | /** |
| | | * h5分页游戏查询 |
| | | * @param page |
| | | * @param minX |
| | | * @param maxX |
| | | * @param minY |
| | | * @param maxY |
| | | * @param pageMcsGameDTO |
| | | * @return |
| | | */ |
| | | IPage<McsGameVO> pageH5McsGame(@Param("page") Page page, @Param("minX") Double minX, @Param("maxX") Double maxX, |
| | | @Param("minY") Double minY, @Param("maxY") Double maxY, @Param("pageMcsGameDTO") PageMcsGameDTO pageMcsGameDTO); |
| | | |
| | | /** |
| | | * 游戏详情 |
| | | * @param gameId |
| | | * @return |
| | | */ |
| | | McsGameVO selectDetailById(@Param("gameId") Long gameId); |
| | | |
| | | /** |
| | | * 通过商家id批量下架戳戳游戏 |
| | | * @param needDealIds |
| | | * @return |
| | | */ |
| | | Integer setOffByMerchantIds(@Param("needDealIds") List<Long> needDealIds); |
| | | |
| | | /** |
| | | * 获取需要处理的到期数据 |
| | | * @return |
| | | */ |
| | | List<McsGame> selectNeedDealExpire(); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsInformationDTO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsInformationVO; |
| | | import com.panzhihua.service_community.entity.McsInformation; |
| | | |
| | | /** |
| | | * (McsInformation)表数据库访问层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-28 14:37:10 |
| | | */ |
| | | @Mapper |
| | | public interface McsInformationDAO extends BaseMapper<McsInformation> { |
| | | |
| | | /** |
| | | * 批量新增数据(MyBatis原生foreach方法) |
| | | * |
| | | * @param entities |
| | | * List<McsInformation> 实例对象列表 |
| | | * @return 影响行数 |
| | | */ |
| | | int insertBatch(@Param("entities") List<McsInformation> entities); |
| | | |
| | | /** |
| | | * 批量新增或按主键更新数据(MyBatis原生foreach方法) |
| | | * |
| | | * @param entities |
| | | * List<McsInformation> 实例对象列表 |
| | | * @return 影响行数 |
| | | * @throws org.springframework.jdbc.BadSqlGrammarException |
| | | * 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参 |
| | | */ |
| | | int insertOrUpdateBatch(@Param("entities") List<McsInformation> entities); |
| | | |
| | | /** |
| | | * 分页查询资讯 |
| | | * @param page |
| | | * @param pageMcsInformationDTO |
| | | * @return |
| | | */ |
| | | IPage<McsInformationVO> pageMcsInfo(@Param("page") Page page, @Param("pageMcsInformationDTO") PageMcsInformationDTO pageMcsInformationDTO); |
| | | |
| | | /** |
| | | * H5分页查询资讯 |
| | | * @param page |
| | | * @param pageMcsInformationDTO |
| | | * @return |
| | | */ |
| | | IPage<McsInformationVO> pageH5McsInfo(@Param("page") Page page, @Param("pageMcsInformationDTO") PageMcsInformationDTO pageMcsInformationDTO); |
| | | |
| | | /** |
| | | * 通过商家id批量下架戳戳资讯 |
| | | * @param needDealIds |
| | | * @return |
| | | */ |
| | | Integer setOffByMerchantIds(@Param("needDealIds") List<Long> needDealIds); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsLabelVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import com.panzhihua.service_community.entity.McsLabel; |
| | | |
| | | /** |
| | | * (McsLabel)表数据库访问层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-28 14:37:10 |
| | | */ |
| | | @Mapper |
| | | public interface McsLabelDAO extends BaseMapper<McsLabel> { |
| | | |
| | | /** |
| | | * 批量新增数据(MyBatis原生foreach方法) |
| | | * |
| | | * @param entities |
| | | * List<McsLabel> 实例对象列表 |
| | | * @return 影响行数 |
| | | */ |
| | | int insertBatch(@Param("entities") List<McsLabel> entities); |
| | | |
| | | /** |
| | | * 批量新增或按主键更新数据(MyBatis原生foreach方法) |
| | | * |
| | | * @param entities |
| | | * List<McsLabel> 实例对象列表 |
| | | * @return 影响行数 |
| | | * @throws org.springframework.jdbc.BadSqlGrammarException |
| | | * 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参 |
| | | */ |
| | | int insertOrUpdateBatch(@Param("entities") List<McsLabel> entities); |
| | | |
| | | /** |
| | | * 获取产品标签列表 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | List<McsLabelVO> selectVOList(@Param("userId") Long userId); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsMerchantDTO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.IndexTopStatisticsVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsMerchantVO; |
| | | import com.panzhihua.service_community.entity.McsMerchant; |
| | | |
| | | /** |
| | | * (McsMerchant)表数据库访问层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-28 14:37:11 |
| | | */ |
| | | @Mapper |
| | | public interface McsMerchantDAO extends BaseMapper<McsMerchant> { |
| | | |
| | | /** |
| | | * 批量新增数据(MyBatis原生foreach方法) |
| | | * |
| | | * @param entities |
| | | * List<McsMerchant> 实例对象列表 |
| | | * @return 影响行数 |
| | | */ |
| | | int insertBatch(@Param("entities") List<McsMerchant> entities); |
| | | |
| | | /** |
| | | * 批量新增或按主键更新数据(MyBatis原生foreach方法) |
| | | * |
| | | * @param entities |
| | | * List<McsMerchant> 实例对象列表 |
| | | * @return 影响行数 |
| | | * @throws org.springframework.jdbc.BadSqlGrammarException |
| | | * 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参 |
| | | */ |
| | | int insertOrUpdateBatch(@Param("entities") List<McsMerchant> entities); |
| | | |
| | | /** |
| | | * 根据id查询商家信息 |
| | | * @param merchantId |
| | | * @return |
| | | */ |
| | | McsMerchantVO getMcsMerchantById(@Param("merchantId") Long merchantId); |
| | | |
| | | /** |
| | | * 分页查询数字商业街商家 |
| | | * @param page |
| | | * @param pageMcsMerchantDTO |
| | | * @return |
| | | */ |
| | | IPage<McsMerchantVO> pageMcsMerchant(@Param("page") Page page, @Param("pageMcsMerchantDTO") PageMcsMerchantDTO pageMcsMerchantDTO); |
| | | |
| | | /** |
| | | * 根据账号查询商家 |
| | | * @param account |
| | | * @return |
| | | */ |
| | | McsMerchantVO getMcsMerchantByAccount(@Param("account") String account); |
| | | |
| | | /** |
| | | * 首页顶部数据 |
| | | * @return |
| | | */ |
| | | IndexTopStatisticsVO getMcsIndexTopData(); |
| | | |
| | | /** |
| | | * H5分页查询数字商业街商家 |
| | | * @param page |
| | | * @param pageMcsMerchantDTO |
| | | * @return |
| | | */ |
| | | IPage<McsMerchantVO> pageH5McsMerchant(@Param("page") Page page, @Param("pageMcsMerchantDTO") PageMcsMerchantDTO pageMcsMerchantDTO); |
| | | |
| | | /** |
| | | * 查询需要处理的已到期商家 |
| | | * @return |
| | | */ |
| | | List<Long> selectNeedDealExpiredMerchant(); |
| | | |
| | | /** |
| | | * 修改is_pause状态为TRUE |
| | | * @param needDealIds |
| | | * @return |
| | | */ |
| | | Integer updateIsPauseStatus(@Param("needDealIds") List<Long> needDealIds); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsOrderVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import com.panzhihua.service_community.entity.McsOrder; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * 商业街订单表(McsOrder)表数据库访问层 |
| | | * |
| | | * @author makejava |
| | | * @since 2022-01-04 16:10:06 |
| | | */ |
| | | @Mapper |
| | | public interface McsOrderDao extends BaseMapper<McsOrder> { |
| | | /** |
| | | * 分页查询 |
| | | * @param page |
| | | * @param commonPage |
| | | * @return |
| | | */ |
| | | IPage<McsOrderVO> pageList(Page page, @Param("commonPage")CommonPage commonPage); |
| | | |
| | | /** |
| | | * 详情接口 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | McsOrderVO detail(Long id); |
| | | |
| | | /** |
| | | * 订单id查询电话 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | String selectPhone(Long id); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsProductDTO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsProductVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import com.panzhihua.service_community.entity.McsProduct; |
| | | |
| | | /** |
| | | * (McsProduct)表数据库访问层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-28 14:37:12 |
| | | */ |
| | | @Mapper |
| | | public interface McsProductDAO extends BaseMapper<McsProduct> { |
| | | |
| | | /** |
| | | * 批量新增数据(MyBatis原生foreach方法) |
| | | * |
| | | * @param entities |
| | | * List<McsProduct> 实例对象列表 |
| | | * @return 影响行数 |
| | | */ |
| | | int insertBatch(@Param("entities") List<McsProduct> entities); |
| | | |
| | | /** |
| | | * 批量新增或按主键更新数据(MyBatis原生foreach方法) |
| | | * |
| | | * @param entities |
| | | * List<McsProduct> 实例对象列表 |
| | | * @return 影响行数 |
| | | * @throws org.springframework.jdbc.BadSqlGrammarException |
| | | * 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参 |
| | | */ |
| | | int insertOrUpdateBatch(@Param("entities") List<McsProduct> entities); |
| | | |
| | | /** |
| | | * 分页查询商家产品信息 |
| | | * @param page |
| | | * @param pageMcsProductDTO |
| | | * @return |
| | | */ |
| | | IPage<McsProductVO> pageMcsProduct(@Param("page") Page page, @Param("pageMcsProductDTO") PageMcsProductDTO pageMcsProductDTO); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import com.panzhihua.service_community.entity.McsProductLabel; |
| | | |
| | | /** |
| | | * (McsProductLabel)表数据库访问层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-28 14:37:12 |
| | | */ |
| | | @Mapper |
| | | public interface McsProductLabelDAO extends BaseMapper<McsProductLabel> { |
| | | |
| | | /** |
| | | * 批量新增数据(MyBatis原生foreach方法) |
| | | * |
| | | * @param entities |
| | | * List<McsProductLabel> 实例对象列表 |
| | | * @return 影响行数 |
| | | */ |
| | | int insertBatch(@Param("entities") List<McsProductLabel> entities); |
| | | |
| | | /** |
| | | * 批量新增或按主键更新数据(MyBatis原生foreach方法) |
| | | * |
| | | * @param entities |
| | | * List<McsProductLabel> 实例对象列表 |
| | | * @return 影响行数 |
| | | * @throws org.springframework.jdbc.BadSqlGrammarException |
| | | * 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参 |
| | | */ |
| | | int insertOrUpdateBatch(@Param("entities") List<McsProductLabel> entities); |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageVerifyRecordDTO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsVerifyRecordVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import com.panzhihua.service_community.entity.McsVerifiedRecord; |
| | | |
| | | /** |
| | | * (McsVerifiedRecord)表数据库访问层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-28 14:37:13 |
| | | */ |
| | | @Mapper |
| | | public interface McsVerifiedRecordDAO extends BaseMapper<McsVerifiedRecord> { |
| | | |
| | | /** |
| | | * 批量新增数据(MyBatis原生foreach方法) |
| | | * |
| | | * @param entities |
| | | * List<McsVerifiedRecord> 实例对象列表 |
| | | * @return 影响行数 |
| | | */ |
| | | int insertBatch(@Param("entities") List<McsVerifiedRecord> entities); |
| | | |
| | | /** |
| | | * 批量新增或按主键更新数据(MyBatis原生foreach方法) |
| | | * |
| | | * @param entities |
| | | * List<McsVerifiedRecord> 实例对象列表 |
| | | * @return 影响行数 |
| | | * @throws org.springframework.jdbc.BadSqlGrammarException |
| | | * 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参 |
| | | */ |
| | | int insertOrUpdateBatch(@Param("entities") List<McsVerifiedRecord> entities); |
| | | |
| | | /** |
| | | * 分页查询核销记录 |
| | | * @param pageVerifyRecordDTO |
| | | * @return |
| | | */ |
| | | IPage<McsVerifyRecordVO> pageMcsVerifyRecord(@Param("page") Page page, @Param("pageVerifyRecordDTO") PageVerifyRecordDTO pageVerifyRecordDTO); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * (McsConfig)表实体类 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-28 14:37:07 |
| | | */ |
| | | @Data |
| | | @TableName(value = "mcs_config") |
| | | @SuppressWarnings("serial") |
| | | public class McsConfig implements Serializable { |
| | | private static final long serialVersionUID = 304699800613967550L; |
| | | |
| | | private Long id; |
| | | /** |
| | | * 商业街配置项名称 |
| | | */ |
| | | private String name; |
| | | /** |
| | | * 配置项 |
| | | */ |
| | | @TableField("`key`") |
| | | private String key; |
| | | /** |
| | | * 配置内容 |
| | | */ |
| | | private String value; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private Date createdAt; |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | private Long createdBy; |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | private Date updatedAt; |
| | | /** |
| | | * 由谁更新 |
| | | */ |
| | | private Long updatedBy; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * (McsCoupon)表实体类 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-28 14:37:08 |
| | | */ |
| | | @Data |
| | | @TableName(value = "mcs_coupon") |
| | | @SuppressWarnings("serial") |
| | | public class McsCoupon implements Serializable { |
| | | private static final long serialVersionUID = 236342407932267836L; |
| | | |
| | | @TableId(type = IdType.INPUT) |
| | | private Long id; |
| | | /** |
| | | * 关联id |
| | | */ |
| | | private Long gameId; |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private Long userId; |
| | | /** |
| | | * 二维码 |
| | | */ |
| | | private String qrCode; |
| | | /** |
| | | * 戳戳币 |
| | | */ |
| | | private Integer coin; |
| | | /** |
| | | * 奖品 |
| | | */ |
| | | private String award; |
| | | /** |
| | | * 是否核验 |
| | | */ |
| | | private Boolean isVerified; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private Date createdAt; |
| | | /** |
| | | * 最后更新时间 |
| | | */ |
| | | private Date updatedAt; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * (McsEvaluate)表实体类 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-28 14:37:08 |
| | | */ |
| | | @Data |
| | | @TableName(value = "mcs_evaluate") |
| | | @SuppressWarnings("serial") |
| | | public class McsEvaluate implements Serializable { |
| | | private static final long serialVersionUID = -64045498558186286L; |
| | | |
| | | private Long id; |
| | | /** |
| | | * 戳戳券码id |
| | | */ |
| | | private Long couponId; |
| | | /** |
| | | * 所属游戏id |
| | | */ |
| | | private Long gameId; |
| | | /** |
| | | * 评价用户id |
| | | */ |
| | | private Long userId; |
| | | /** |
| | | * 评分(1.差 2.一般 3.还不错 4.很满意 5.强烈推荐) |
| | | */ |
| | | private Integer star; |
| | | /** |
| | | * 评价内容 |
| | | */ |
| | | private String content; |
| | | /** |
| | | * 评价图片(多张逗号隔开) |
| | | */ |
| | | private String photos; |
| | | /** |
| | | * 评价时间 |
| | | */ |
| | | private Date createdAt; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * (McsGame)表实体类 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-28 14:37:09 |
| | | */ |
| | | @Data |
| | | @TableName(value = "mcs_game") |
| | | @SuppressWarnings("serial") |
| | | public class McsGame implements Serializable { |
| | | private static final long serialVersionUID = 996990563935718402L; |
| | | |
| | | private Long id; |
| | | /** |
| | | * 游戏名称 |
| | | */ |
| | | private String name; |
| | | /** |
| | | * 戳戳卷数量 |
| | | */ |
| | | private Integer coupons; |
| | | /** |
| | | * 剩余戳戳卷数量 |
| | | */ |
| | | private Integer surplusCoupons; |
| | | /** |
| | | * 游戏类别(1.戳戳币游戏 2.体验游戏) |
| | | */ |
| | | private Integer type; |
| | | /** |
| | | * 奖励类型(1.免费产品 2.免费服务) |
| | | */ |
| | | private Integer awardType; |
| | | /** |
| | | * 戳戳币分配方式(1.随机分配 2.平均分配) |
| | | */ |
| | | private Integer allocation; |
| | | /** |
| | | * 戳戳币总额 |
| | | */ |
| | | private Integer coins; |
| | | /** |
| | | * 剩余戳戳币 |
| | | */ |
| | | private Integer surplusCoins; |
| | | /** |
| | | * 地址 |
| | | */ |
| | | private String address; |
| | | /** |
| | | * 纬度 |
| | | */ |
| | | private String lat; |
| | | /** |
| | | * 经度 |
| | | */ |
| | | private String lon; |
| | | /** |
| | | * 失效时间 |
| | | */ |
| | | private Date expireAt; |
| | | /** |
| | | * 封面 |
| | | */ |
| | | private String cover; |
| | | /** |
| | | * 其他图片(多张图片以逗号隔开) |
| | | */ |
| | | private String otherImages; |
| | | /** |
| | | * 游戏介绍 |
| | | */ |
| | | private String introduction; |
| | | /** |
| | | * 状态(1.未发布 2.进行中 3.已下架 4.已结束) |
| | | */ |
| | | private Integer status; |
| | | /** |
| | | * 是否设为热门 |
| | | */ |
| | | private Boolean isPopular; |
| | | /** |
| | | * 发布时间 |
| | | */ |
| | | private Date publishAt; |
| | | /** |
| | | * 是否删除 |
| | | */ |
| | | private Boolean isDel; |
| | | /** |
| | | * 所属商家 |
| | | */ |
| | | private Long merchantId; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private Date createdAt; |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | private Long createdBy; |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | private Date updatedAt; |
| | | /** |
| | | * 由谁更新 |
| | | */ |
| | | private Long updatedBy; |
| | | |
| | | |
| | | /** |
| | | * 状态(1.未发布 2.进行中 3.已下架 4.已结束) |
| | | */ |
| | | public interface Status { |
| | | int wfb = 1; |
| | | int jxz = 2; |
| | | int yxj = 3; |
| | | int yjs = 4; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * (McsInformation)表实体类 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-28 14:37:10 |
| | | */ |
| | | @Data |
| | | @TableName(value = "mcs_information") |
| | | @SuppressWarnings("serial") |
| | | public class McsInformation implements Serializable { |
| | | private static final long serialVersionUID = -78188903489439933L; |
| | | |
| | | private Long id; |
| | | /** |
| | | * 资讯标题 |
| | | */ |
| | | private String name; |
| | | /** |
| | | * 地址 |
| | | */ |
| | | private String address; |
| | | /** |
| | | * 纬度 |
| | | */ |
| | | private String lat; |
| | | /** |
| | | * 经度 |
| | | */ |
| | | private String lon; |
| | | /** |
| | | * 封面 |
| | | */ |
| | | private String cover; |
| | | /** |
| | | * 资讯内容 |
| | | */ |
| | | private String content; |
| | | /** |
| | | * 状态(1.未发布 2.已发布 3.已下架) |
| | | */ |
| | | private Integer status; |
| | | /** |
| | | * 发布时间 |
| | | */ |
| | | private Date publishAt; |
| | | /** |
| | | * 是否删除 |
| | | */ |
| | | private Boolean isDel; |
| | | /** |
| | | * 所属商家 |
| | | */ |
| | | private Long merchantId; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private Date createdAt; |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | private Long createdBy; |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | private Date updatedAt; |
| | | /** |
| | | * 由谁更新 |
| | | */ |
| | | private Long updatedBy; |
| | | |
| | | /** |
| | | * 状态(1.未发布 2.已发布 3.已下架) |
| | | */ |
| | | public interface Status{ |
| | | int wfb = 1; |
| | | int yfb = 2; |
| | | int yxj = 3; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * (McsLabel)表实体类 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-28 14:37:10 |
| | | */ |
| | | @Data |
| | | @TableName(value = "mcs_label") |
| | | @SuppressWarnings("serial") |
| | | public class McsLabel implements Serializable { |
| | | private static final long serialVersionUID = -23139583272426139L; |
| | | |
| | | private Long id; |
| | | /** |
| | | * 标签名称 |
| | | */ |
| | | private String name; |
| | | /** |
| | | * 说明 |
| | | */ |
| | | private String introduction; |
| | | /** |
| | | * 是否删除 |
| | | */ |
| | | private Boolean isDel; |
| | | /** |
| | | * 所属商家 |
| | | */ |
| | | private Long merchantId; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private Date createdAt; |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | private Long createdBy; |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | private Date updatedAt; |
| | | /** |
| | | * 由谁更新 |
| | | */ |
| | | private Long updatedBy; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.entity; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldStrategy; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * (McsMerchant)表实体类 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-28 14:37:11 |
| | | */ |
| | | @Data |
| | | @TableName(value = "mcs_merchant") |
| | | @SuppressWarnings("serial") |
| | | public class McsMerchant implements Serializable { |
| | | private static final long serialVersionUID = 535915125894031919L; |
| | | |
| | | private Long id; |
| | | /** |
| | | * 商家名称 |
| | | */ |
| | | private String name; |
| | | /** |
| | | * 手机号 |
| | | */ |
| | | private String phone; |
| | | /** |
| | | * 商家账号 |
| | | */ |
| | | private String account; |
| | | /** |
| | | * 商家logo |
| | | */ |
| | | @TableField(value = "logo", updateStrategy = FieldStrategy.IGNORED) |
| | | private String logo; |
| | | /** |
| | | * 关联用户id |
| | | */ |
| | | private Long userId; |
| | | /** |
| | | * 商家级别(1.临时商家 2.合作商家) |
| | | */ |
| | | private Integer level; |
| | | /** |
| | | * 戳戳点亮上限(发布次数上限) |
| | | */ |
| | | private Integer publishLimit; |
| | | /** |
| | | * 到期时间 |
| | | */ |
| | | private Date expireAt; |
| | | /** |
| | | * 是否暂停服务 |
| | | */ |
| | | private Boolean isPause; |
| | | /** |
| | | * 首次点亮时间 |
| | | */ |
| | | private Date firstLitAt; |
| | | /** |
| | | * 商家地址 |
| | | */ |
| | | private String address; |
| | | /** |
| | | * 纬度 |
| | | */ |
| | | private String lat; |
| | | /** |
| | | * 经度 |
| | | */ |
| | | private String lon; |
| | | /** |
| | | * 商家简介 |
| | | */ |
| | | @TableField(value = "introduction", updateStrategy = FieldStrategy.IGNORED) |
| | | private String introduction; |
| | | /** |
| | | * 是否删除 |
| | | */ |
| | | private Boolean isDel; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private Date createdAt; |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | private Long createdBy; |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | private Date updatedAt; |
| | | /** |
| | | * 由谁更新 |
| | | */ |
| | | private Long updatedBy; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.entity; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * 商业街订单表(McsOrder)表实体类 |
| | | * |
| | | * @author makejava |
| | | * @since 2022-01-04 16:10:06 |
| | | */ |
| | | @Data |
| | | @Builder |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @ApiModel("商业街订单表") |
| | | public class McsOrder implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -92724536016243196L; |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 订单编号 |
| | | */ |
| | | @ApiModelProperty(value = "订单编号") |
| | | private String orderNo; |
| | | |
| | | /** |
| | | * 支付配置id |
| | | */ |
| | | @ApiModelProperty(value = "支付配置id") |
| | | private Long configId; |
| | | |
| | | /** |
| | | * 数量 |
| | | */ |
| | | @ApiModelProperty(value = "数量") |
| | | private Integer num; |
| | | |
| | | /** |
| | | * 支付状态 0 待支付 1已支付 2 已取消 3 已退款 |
| | | */ |
| | | @ApiModelProperty(value = "支付状态 0 待支付 1已支付 2 已取消 3 已退款") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 支付金额 |
| | | */ |
| | | @ApiModelProperty(value = "支付金额") |
| | | private BigDecimal money; |
| | | |
| | | /** |
| | | * 支付时间 |
| | | */ |
| | | @ApiModelProperty(value = "支付时间") |
| | | private Date payTime; |
| | | |
| | | /** |
| | | * 商家id |
| | | */ |
| | | @ApiModelProperty(value = "商家id") |
| | | private Long merchantId; |
| | | |
| | | /** |
| | | * 支付流水号 |
| | | */ |
| | | @ApiModelProperty(value = "支付流水号") |
| | | private String payNo; |
| | | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | @ApiModelProperty(value = "用户id") |
| | | private Long userId; |
| | | |
| | | private Date createTime; |
| | | |
| | | private String merchantName; |
| | | |
| | | private String paymentMethod; |
| | | |
| | | /** |
| | | * 商家地址 |
| | | */ |
| | | private String address; |
| | | /** |
| | | * 纬度 |
| | | */ |
| | | private String lat; |
| | | /** |
| | | * 经度 |
| | | */ |
| | | private String lon; |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * (McsProduct)表实体类 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-28 14:37:12 |
| | | */ |
| | | @Data |
| | | @TableName(value = "mcs_product") |
| | | @SuppressWarnings("serial") |
| | | public class McsProduct implements Serializable { |
| | | private static final long serialVersionUID = 415357403059379804L; |
| | | |
| | | @TableId(type = IdType.INPUT) |
| | | private Long id; |
| | | /** |
| | | * 产品名称 |
| | | */ |
| | | private String name; |
| | | /** |
| | | * 产品图片 |
| | | */ |
| | | private String image; |
| | | /** |
| | | * 产品介绍 |
| | | */ |
| | | private String introduction; |
| | | /** |
| | | * 浏览量 |
| | | */ |
| | | private Integer viewNum; |
| | | /** |
| | | * 状态(1.上架中 2.已下架) |
| | | */ |
| | | private Integer status; |
| | | /** |
| | | * 是否删除 |
| | | */ |
| | | private Boolean isDel; |
| | | /** |
| | | * 所属商家 |
| | | */ |
| | | private Long merchantId; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private Date createdAt; |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | private Long createdBy; |
| | | /** |
| | | * 最后更新时间 |
| | | */ |
| | | private Date updatedAt; |
| | | /** |
| | | * 由谁更新 |
| | | */ |
| | | private Long updatedBy; |
| | | |
| | | /** |
| | | * 状态(1.上架中 2.已下架) |
| | | */ |
| | | public interface Status { |
| | | int sjz = 1; |
| | | int yxj = 2; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * (McsProductLabel)表实体类 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-28 14:37:13 |
| | | */ |
| | | @Data |
| | | @TableName(value = "mcs_product_label") |
| | | @SuppressWarnings("serial") |
| | | public class McsProductLabel implements Serializable { |
| | | private static final long serialVersionUID = 292891837724574338L; |
| | | |
| | | private Long id; |
| | | /** |
| | | * 产品id |
| | | */ |
| | | private Long productId; |
| | | /** |
| | | * 标签id |
| | | */ |
| | | private Long labelId; |
| | | /** |
| | | * 标签名 |
| | | */ |
| | | private String labelName; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * (McsVerifiedRecord)表实体类 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-28 14:37:14 |
| | | */ |
| | | @Data |
| | | @TableName(value = "mcs_verified_record") |
| | | @SuppressWarnings("serial") |
| | | public class McsVerifiedRecord implements Serializable { |
| | | private static final long serialVersionUID = -81350642843928838L; |
| | | |
| | | private Long id; |
| | | /** |
| | | * 戳戳券码id |
| | | */ |
| | | private Long couponId; |
| | | /** |
| | | * 商家id |
| | | */ |
| | | private Long merchantId; |
| | | /** |
| | | * 核验所属资源名称 |
| | | */ |
| | | private String name; |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private String nickName; |
| | | /** |
| | | * 游戏id |
| | | */ |
| | | private Long gameId; |
| | | /** |
| | | * 获得奖励 |
| | | */ |
| | | private String award; |
| | | /** |
| | | * 核验时间 |
| | | */ |
| | | private Date verifiedAt; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.message; |
| | | |
| | | import com.panzhihua.service_community.dao.McsOrderDao; |
| | | import com.panzhihua.service_community.entity.McsOrder; |
| | | import org.springframework.amqp.rabbit.annotation.RabbitListener; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @author zzj |
| | | */ |
| | | @Component |
| | | public class McsOrderMessage { |
| | | public static final String DELAYED_QUEUE="mcsOrder.queue"; |
| | | @Resource |
| | | private McsOrderDao mcsOrderDao; |
| | | @RabbitListener(queues=DELAYED_QUEUE) |
| | | public void cancelOrder(McsOrder mcsOrder){ |
| | | McsOrder nowOrder=mcsOrderDao.selectById(mcsOrder.getId()); |
| | | if(nowOrder.getStatus()==0){ |
| | | mcsOrder.setStatus(2); |
| | | mcsOrderDao.updateById(mcsOrder); |
| | | } |
| | | } |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | R getUserStoreInfo(String account); |
| | | |
| | | /** |
| | | * check商家/店铺是否有效 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | Boolean checkStoreIsValid(Long userId); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | R timedTaskWriteDataToMerchantJobHandler(); |
| | | |
| | | /** |
| | | * check商家/店铺是否有效 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | Boolean checkStoreIsValid(Long userId); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsConfigVO; |
| | | import com.panzhihua.service_community.entity.McsConfig; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * (McsConfig)表服务接口 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-28 14:37:07 |
| | | */ |
| | | public interface McsConfigService extends IService<McsConfig> { |
| | | |
| | | /** |
| | | * 获取所有数字商业街配置 |
| | | * @return |
| | | */ |
| | | R getAllMcsConfig(); |
| | | |
| | | /** |
| | | * 修改数字商业街配置 |
| | | * @param configs |
| | | * @return |
| | | */ |
| | | R putMcsConfig(List<McsConfigVO> configs); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageJoinGameListDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.entity.McsCoupon; |
| | | |
| | | /** |
| | | * (McsCoupon)表服务接口 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-28 14:37:08 |
| | | */ |
| | | public interface McsCouponService extends IService<McsCoupon> { |
| | | |
| | | /** |
| | | * 我的戳戳卷 |
| | | * @return |
| | | * @param type |
| | | * @param userId |
| | | */ |
| | | R getMyCoupon(Integer type, Long userId); |
| | | |
| | | /** |
| | | * 我的评价-参与游戏列表 |
| | | * @param pageJoinGameListDTO |
| | | * @return |
| | | */ |
| | | R getJoinGameList(PageJoinGameListDTO pageJoinGameListDTO); |
| | | |
| | | /** |
| | | * 戳戳卷核销 |
| | | * @param couponId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | R verifyMcsCoupon(Long couponId, Long userId); |
| | | |
| | | /** |
| | | * 游戏统计 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | R getMcsGameStatistics(Long userId); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsEvaluateDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsEvaluateDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.entity.McsEvaluate; |
| | | |
| | | /** |
| | | * (McsEvaluate)表服务接口 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-28 14:37:08 |
| | | */ |
| | | public interface McsEvaluateService extends IService<McsEvaluate> { |
| | | |
| | | /** |
| | | * 分页查询评价记录 |
| | | * @param pageMcsEvaluateDTO |
| | | * @return |
| | | */ |
| | | R pageMcsEvaluate(PageMcsEvaluateDTO pageMcsEvaluateDTO); |
| | | |
| | | /** |
| | | * 查询评价记录详情 |
| | | * @param evaluateId |
| | | * @return |
| | | */ |
| | | R getMcsEvaluate(Long evaluateId); |
| | | |
| | | /** |
| | | * 删除评价记录 |
| | | * @param evaluateId |
| | | * @return |
| | | */ |
| | | R deleteMcsEvaluate(Long evaluateId); |
| | | |
| | | /** |
| | | * 新增评价记录 |
| | | * @param mcsEvaluateDTO |
| | | * @return |
| | | */ |
| | | R addMcsEvaluate(McsEvaluateDTO mcsEvaluateDTO); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsGameDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsGameDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetPopularForGameDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetShelfForGameDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.entity.McsGame; |
| | | |
| | | /** |
| | | * (McsGame)表服务接口 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-28 14:37:09 |
| | | */ |
| | | public interface McsGameService extends IService<McsGame> { |
| | | |
| | | /** |
| | | * 分页查询戳戳游戏 |
| | | * @param pageMcsGameDTO |
| | | * @return |
| | | */ |
| | | R pageMcsGame(PageMcsGameDTO pageMcsGameDTO); |
| | | |
| | | /** |
| | | * 设为/取消游戏热门 |
| | | * @param setPopularForGameDTO |
| | | * @return |
| | | */ |
| | | R setPopularForGame(SetPopularForGameDTO setPopularForGameDTO); |
| | | |
| | | /** |
| | | * 上架/下架戳戳游戏 |
| | | * @param setShelfForGameDTO |
| | | * @return |
| | | */ |
| | | R setShelfForGame(SetShelfForGameDTO setShelfForGameDTO); |
| | | |
| | | /** |
| | | * 删除戳戳游戏 |
| | | * @param gameId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | R deleteMcsGame(Long gameId, Long userId); |
| | | |
| | | /** |
| | | * 新增戳戳游戏 |
| | | * @param mcsGameDTO |
| | | * @return |
| | | */ |
| | | R addMcsGame(McsGameDTO mcsGameDTO); |
| | | |
| | | /** |
| | | * 编辑戳戳游戏 |
| | | * @param mcsGameDTO |
| | | * @return |
| | | */ |
| | | R putMcsGame(McsGameDTO mcsGameDTO); |
| | | |
| | | /** |
| | | * 发布戳戳游戏 |
| | | * @param gameId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | R publishMcsGame(Long gameId, Long userId); |
| | | |
| | | /** |
| | | * 结束戳戳游戏 |
| | | * @param gameId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | R finishMcsGame(Long gameId, Long userId); |
| | | |
| | | /** |
| | | * 戳戳游戏顶部统计数据 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | R getTopStatistics(Long userId); |
| | | |
| | | /** |
| | | * 戳戳卷领取 |
| | | * @param gameId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | R applyMcsCoupon(Long gameId, Long userId); |
| | | |
| | | /** |
| | | * h5分页查询戳戳游戏 |
| | | * @param pageMcsGameDTO |
| | | * @return |
| | | */ |
| | | R pageH5McsGame(PageMcsGameDTO pageMcsGameDTO); |
| | | |
| | | /** |
| | | * 游戏详情 |
| | | * @param gameId |
| | | * @return |
| | | */ |
| | | R getMcsGame(Long gameId); |
| | | |
| | | /** |
| | | * 定时任务-每隔5分钟执行一次,将已到期的微商业街游戏结束 |
| | | * @return |
| | | */ |
| | | R endStatusForMcsGame(); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsInfoDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsInformationDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetShelfForInfoDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.entity.McsInformation; |
| | | |
| | | /** |
| | | * (McsInformation)表服务接口 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-28 14:37:10 |
| | | */ |
| | | public interface McsInformationService extends IService<McsInformation> { |
| | | |
| | | /** |
| | | * 分页查询戳戳资讯 |
| | | * @param pageMcsInformationDTO |
| | | * @return |
| | | */ |
| | | R pageMcsInfo(PageMcsInformationDTO pageMcsInformationDTO); |
| | | |
| | | /** |
| | | * 上架/下架戳戳资讯 |
| | | * @param setShelfForInfoDTO |
| | | * @return |
| | | */ |
| | | R setShelfForMcsInfo(SetShelfForInfoDTO setShelfForInfoDTO); |
| | | |
| | | /** |
| | | * 删除戳戳资讯 |
| | | * @param infoId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | R deleteMcsInfo(Long infoId, Long userId); |
| | | |
| | | /** |
| | | * 戳戳资讯顶部统计数据 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | R getTopStatistics(Long userId); |
| | | |
| | | /** |
| | | * 新增戳戳资讯 |
| | | * @param mcsInfoDTO |
| | | * @return |
| | | */ |
| | | R addMcsInfo(McsInfoDTO mcsInfoDTO); |
| | | |
| | | /** |
| | | * 编辑戳戳资讯 |
| | | * @param mcsInfoDTO |
| | | * @return |
| | | */ |
| | | R putMcsInfo(McsInfoDTO mcsInfoDTO); |
| | | |
| | | /** |
| | | * 发布戳戳资讯 |
| | | * @param infoId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | R publishMcsInfo(Long infoId, Long userId); |
| | | |
| | | /** |
| | | * h5分页查询戳戳资讯 |
| | | * @param pageMcsInformationDTO |
| | | * @return |
| | | */ |
| | | R pageH5McsInfo(PageMcsInformationDTO pageMcsInformationDTO); |
| | | |
| | | /** |
| | | * 资讯详情 |
| | | * @param infoId |
| | | * @return |
| | | */ |
| | | R getMcsInfo(Long infoId); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.entity.McsLabel; |
| | | |
| | | /** |
| | | * (McsLabel)表服务接口 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-28 14:37:11 |
| | | */ |
| | | public interface McsLabelService extends IService<McsLabel> { |
| | | |
| | | /** |
| | | * 获取产品标签列表 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | R getMcsLabelList(Long userId); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.DisableOrEnableMcsMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.LoginWithPhoneDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PutUserInfoDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.entity.McsMerchant; |
| | | |
| | | /** |
| | | * (McsMerchant)表服务接口 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-28 14:37:11 |
| | | */ |
| | | public interface McsMerchantService extends IService<McsMerchant> { |
| | | |
| | | /** |
| | | * 新增数字商业街商家 |
| | | * @param mcsMerchantDTO |
| | | * @return |
| | | */ |
| | | R addMcsMerchant(McsMerchantDTO mcsMerchantDTO); |
| | | |
| | | /** |
| | | * 编辑数字商业街商家 |
| | | * @param mcsMerchantDTO |
| | | * @return |
| | | */ |
| | | R putMcsMerchant(McsMerchantDTO mcsMerchantDTO); |
| | | |
| | | /** |
| | | * 查询数字商业街商家详情 |
| | | * @param merchantId |
| | | * @return |
| | | */ |
| | | R getMcsMerchant(Long merchantId); |
| | | |
| | | /** |
| | | * 删除数字商业街商家 |
| | | * @param merchantId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | R deleteMcsMerchant(Long merchantId, Long userId); |
| | | |
| | | /** |
| | | * 分页查询数字商业街商家 |
| | | * @param pageMcsMerchantDTO |
| | | * @return |
| | | */ |
| | | R pageMcsMerchant(PageMcsMerchantDTO pageMcsMerchantDTO); |
| | | |
| | | /** |
| | | * 禁用/启用数字商业街商家 |
| | | * @param disableOrEnableMcsMerchantDTO |
| | | * @return |
| | | */ |
| | | R disableOrEnableMcsMerchant(DisableOrEnableMcsMerchantDTO disableOrEnableMcsMerchantDTO); |
| | | |
| | | /** |
| | | * 根据account查询微商业街商家信息 |
| | | * @param account |
| | | * @return |
| | | */ |
| | | R getMcsMerchantByAccount(String account); |
| | | |
| | | /** |
| | | * 完成订单更新/新增商家信息 |
| | | * |
| | | * @param orderNo |
| | | * @param configId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | R updateOrAddMcsMerchantAfterOrder(String orderNo, Long configId, Long userId); |
| | | |
| | | /** |
| | | * 验证码登录 |
| | | * @param loginDTO |
| | | * @return |
| | | */ |
| | | R loginWithPhone(LoginWithPhoneDTO loginDTO); |
| | | |
| | | /** |
| | | * 首页顶部数据 |
| | | * @return |
| | | */ |
| | | R getMcsIndexTopData(); |
| | | |
| | | /** |
| | | * H5分页查询数字商业街商家 |
| | | * @param pageMcsMerchantDTO |
| | | * @return |
| | | */ |
| | | R pageH5McsMerchant(PageMcsMerchantDTO pageMcsMerchantDTO); |
| | | |
| | | /** |
| | | * 修改用戶信息 |
| | | * @param putUserInfoDTO |
| | | * @return |
| | | */ |
| | | R putUserInfo(PutUserInfoDTO putUserInfoDTO); |
| | | |
| | | /** |
| | | * 根据userId获取商家信息 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | R retrieveMcsMerchantInfoByUserId(Long userId); |
| | | |
| | | /** |
| | | * 定时任务-每隔5分钟执行一次,将已到期的微商业街商家旗下所有的游戏/资讯全部下架 |
| | | * @return |
| | | */ |
| | | R offResourceForMcsMerchant(); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsOrderVO; |
| | | import com.panzhihua.service_community.entity.McsOrder; |
| | | |
| | | /** |
| | | * 商业街订单表(McsOrder)表服务接口 |
| | | * |
| | | * @author makejava |
| | | * @since 2022-01-04 16:10:07 |
| | | */ |
| | | public interface McsOrderService extends IService<McsOrder> { |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param commonPage |
| | | * @return |
| | | */ |
| | | R pageList(CommonPage commonPage); |
| | | |
| | | /** |
| | | * 创建订单 |
| | | * @param mcsOrderVO |
| | | * @return |
| | | */ |
| | | R insert(McsOrderVO mcsOrderVO); |
| | | |
| | | /** |
| | | * 详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | R detail(Long id); |
| | | |
| | | /** |
| | | * 支付 |
| | | * @param mcsOrderVO |
| | | * @return |
| | | */ |
| | | R wxPay(McsOrderVO mcsOrderVO); |
| | | |
| | | /** |
| | | *订单id查询手机号 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | R sendContent(Long id); |
| | | |
| | | /** |
| | | *微信支付回调 |
| | | * @param mcsOrderVO |
| | | * @return |
| | | */ |
| | | R notify(McsOrderVO mcsOrderVO); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.service_community.entity.McsProductLabel; |
| | | |
| | | /** |
| | | * (McsProductLabel)表服务接口 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-28 14:37:13 |
| | | */ |
| | | public interface McsProductLabelService extends IService<McsProductLabel> { |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.DeleteProductDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsProductDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsProductDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetShelfForProductDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.entity.McsProduct; |
| | | |
| | | /** |
| | | * (McsProduct)表服务接口 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-28 14:37:12 |
| | | */ |
| | | public interface McsProductService extends IService<McsProduct> { |
| | | |
| | | /** |
| | | * 新增产品信息 |
| | | * @param mcsProductDTO |
| | | * @return |
| | | */ |
| | | R addMcsProduct(McsProductDTO mcsProductDTO); |
| | | |
| | | /** |
| | | * 编辑产品信息 |
| | | * @param mcsProductDTO |
| | | * @return |
| | | */ |
| | | R putMcsProduct(McsProductDTO mcsProductDTO); |
| | | |
| | | /** |
| | | * 删除产品信息 |
| | | * @param deleteProductDTO |
| | | * @return |
| | | */ |
| | | R deleteMcsProduct(DeleteProductDTO deleteProductDTO); |
| | | |
| | | /** |
| | | * 上架/下架产品信息 |
| | | * @param setShelfForProductDTO |
| | | * @return |
| | | */ |
| | | R setShelfForMcsProduct(SetShelfForProductDTO setShelfForProductDTO); |
| | | |
| | | /** |
| | | * 分页查询产品信息 |
| | | * @param pageMcsProductDTO |
| | | * @return |
| | | */ |
| | | R pageMcsProduct(PageMcsProductDTO pageMcsProductDTO); |
| | | |
| | | /** |
| | | * 获取产品信息详情 |
| | | * @param productId |
| | | * @return |
| | | */ |
| | | R getMcsProduct(Long productId); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageVerifyRecordDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.entity.McsVerifiedRecord; |
| | | |
| | | /** |
| | | * (McsVerifiedRecord)表服务接口 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-28 14:37:14 |
| | | */ |
| | | public interface McsVerifiedRecordService extends IService<McsVerifiedRecord> { |
| | | |
| | | /** |
| | | * 分页查询核销记录 |
| | | * @param pageVerifyRecordDTO |
| | | * @return |
| | | */ |
| | | R pageMcsVerifyRecord(PageVerifyRecordDTO pageVerifyRecordDTO); |
| | | } |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import static com.baomidou.mybatisplus.core.toolkit.ObjectUtils.isNull; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * check商家/店铺是否有效 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Boolean checkStoreIsValid(Long userId) { |
| | | ComShopStoreDO comShopStoreDO = this.baseMapper.selectOne(new LambdaQueryWrapper<ComShopStoreDO>() |
| | | .eq(ComShopStoreDO::getDeleteStatus, 1).eq(ComShopStoreDO::getSysUserId, userId)); |
| | | if (isNull(comShopStoreDO) || comShopStoreDO.getStatus() != 1) { |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | } |
| | |
| | | this.baseMapper.batchUpdateMerchantViewNum(viewVOList); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * check商家/店铺是否有效 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Boolean checkStoreIsValid(Long userId) { |
| | | R<LoginUserInfoVO> loginUserInfo = userService.getUserInfoByUserId(userId.toString()); |
| | | LoginUserInfoVO loginUserInfoVO = |
| | | JSONObject.parseObject(JSONObject.toJSONString(loginUserInfo.getData()), LoginUserInfoVO.class); |
| | | if (isNull(loginUserInfoVO) || !loginUserInfoVO.getType().equals(10) || loginUserInfoVO.getStatus() != 1) { |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import static java.util.Objects.nonNull; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsConfigVO; |
| | | import com.panzhihua.service_community.dao.McsConfigDAO; |
| | | import com.panzhihua.service_community.entity.McsConfig; |
| | | import com.panzhihua.service_community.service.McsConfigService; |
| | | |
| | | /** |
| | | * (McsConfig)表服务实现类 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-28 14:37:07 |
| | | */ |
| | | @Service("mcsConfigService") |
| | | public class McsConfigServiceImpl extends ServiceImpl<McsConfigDAO, McsConfig> implements McsConfigService { |
| | | |
| | | /** |
| | | * 获取所有数字商业街配置 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R getAllMcsConfig() { |
| | | List<McsConfig> mcsConfigs = this.baseMapper.selectList(null); |
| | | List<McsConfigVO> configList = new ArrayList<>(); |
| | | if (!mcsConfigs.isEmpty()) { |
| | | mcsConfigs.forEach(e -> { |
| | | McsConfigVO configVO = new McsConfigVO(); |
| | | BeanUtils.copyProperties(e, configVO); |
| | | configList.add(configVO); |
| | | }); |
| | | } |
| | | return R.ok(configList); |
| | | } |
| | | |
| | | /** |
| | | * 修改数字商业街配置 |
| | | * @param configs |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R putMcsConfig(List<McsConfigVO> configs) { |
| | | if (nonNull(configs) && !configs.isEmpty()) { |
| | | List<McsConfig> mcsConfigs = new ArrayList<>(); |
| | | configs.forEach(e -> { |
| | | McsConfig mcsConfig = this.baseMapper.selectOne(new QueryWrapper<McsConfig>().lambda().eq(McsConfig::getKey, e.getKey())); |
| | | if (nonNull(mcsConfig)) { |
| | | mcsConfig.setValue(e.getValue()); |
| | | mcsConfigs.add(mcsConfig); |
| | | } |
| | | }); |
| | | if (!mcsConfigs.isEmpty()) { |
| | | this.updateBatchById(mcsConfigs); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.GameStatisticsVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.VerifiedReturnVO; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.service_community.dao.McsGameDAO; |
| | | import com.panzhihua.service_community.dao.McsMerchantDAO; |
| | | import com.panzhihua.service_community.dao.McsVerifiedRecordDAO; |
| | | import com.panzhihua.service_community.entity.McsGame; |
| | | import com.panzhihua.service_community.entity.McsMerchant; |
| | | import com.panzhihua.service_community.entity.McsVerifiedRecord; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageJoinGameListDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsCouponVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.MyCouponVO; |
| | | import com.panzhihua.service_community.dao.McsCouponDAO; |
| | | import com.panzhihua.service_community.entity.McsCoupon; |
| | | import com.panzhihua.service_community.service.McsCouponService; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | |
| | | /** |
| | | * (McsCoupon)表服务实现类 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-28 14:37:08 |
| | | */ |
| | | @Service("mcsCouponService") |
| | | public class McsCouponServiceImpl extends ServiceImpl<McsCouponDAO, McsCoupon> implements McsCouponService { |
| | | |
| | | @Resource |
| | | private McsVerifiedRecordDAO mcsVerifiedRecordDAO; |
| | | @Resource |
| | | private McsGameDAO mcsGameDAO; |
| | | @Resource |
| | | private UserService userService; |
| | | @Resource |
| | | private McsMerchantDAO mcsMerchantDAO; |
| | | |
| | | /** |
| | | * 我的戳戳卷 |
| | | * @return |
| | | * @param type |
| | | * @param userId |
| | | */ |
| | | @Override |
| | | public R getMyCoupon(Integer type, Long userId) { |
| | | MyCouponVO myCouponVO = this.baseMapper.getMyCouponData(userId); |
| | | List<McsCouponVO> mcsCoupons = this.baseMapper.getCouponList(type, userId); |
| | | myCouponVO.setCouponList(mcsCoupons); |
| | | return R.ok(myCouponVO); |
| | | } |
| | | |
| | | /** |
| | | * 我的评价-参与游戏列表 |
| | | * @param pageJoinGameListDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R getJoinGameList(PageJoinGameListDTO pageJoinGameListDTO) { |
| | | Page page = new Page<>(); |
| | | page.setSize(pageJoinGameListDTO.getPageSize()); |
| | | page.setCurrent(pageJoinGameListDTO.getPageNum()); |
| | | IPage<McsCouponVO> mcsCoupons = this.baseMapper.pageJoinGameList(page, pageJoinGameListDTO); |
| | | return R.ok(mcsCoupons); |
| | | } |
| | | |
| | | /** |
| | | * 戳戳卷核销 |
| | | * @param couponId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R verifyMcsCoupon(Long couponId, Long userId) { |
| | | McsCoupon mcsCoupon = this.baseMapper.selectById(couponId); |
| | | if (isNull(mcsCoupon)) { |
| | | return R.fail("无效券码"); |
| | | } |
| | | McsGame mcsGame = mcsGameDAO.selectById(mcsCoupon.getGameId()); |
| | | if (isNull(mcsGame)) { |
| | | return R.fail("资源不存在"); |
| | | } |
| | | McsMerchant mcsMerchant = mcsMerchantDAO.selectById(mcsGame.getMerchantId()); |
| | | if (isNull(mcsMerchant)) { |
| | | return R.fail("资源不存在"); |
| | | } |
| | | if (!mcsMerchant.getUserId().equals(userId)) { |
| | | return R.fail("限指定商家核验"); |
| | | } |
| | | if (mcsCoupon.getIsVerified()) { |
| | | return R.fail("该券已核销"); |
| | | } |
| | | Date nowDate = new Date(); |
| | | if (mcsGame.getExpireAt().before(nowDate)) { |
| | | return R.fail("已过期"); |
| | | } |
| | | R<LoginUserInfoVO> userInfoVOR = userService.getUserInfoByUserId(mcsCoupon.getUserId().toString()); |
| | | String nickName; |
| | | if (R.isOk(userInfoVOR) && nonNull(userInfoVOR.getData())) { |
| | | LoginUserInfoVO loginUserInfoVO = JSONObject.parseObject(JSONObject.toJSONString(userInfoVOR.getData()), LoginUserInfoVO.class); |
| | | nickName = loginUserInfoVO.getName(); |
| | | } else { |
| | | nickName = "默认昵称"; |
| | | } |
| | | McsVerifiedRecord mcsVerifiedRecord = new McsVerifiedRecord(); |
| | | mcsVerifiedRecord.setCouponId(couponId); |
| | | mcsVerifiedRecord.setAward(mcsCoupon.getAward()); |
| | | mcsVerifiedRecord.setName(mcsGame.getName()); |
| | | mcsVerifiedRecord.setNickName(nickName); |
| | | mcsVerifiedRecord.setGameId(mcsGame.getId()); |
| | | mcsVerifiedRecord.setMerchantId(mcsGame.getMerchantId()); |
| | | int num = mcsVerifiedRecordDAO.insert(mcsVerifiedRecord); |
| | | if (num > 0) { |
| | | mcsCoupon.setIsVerified(true); |
| | | this.baseMapper.updateById(mcsCoupon); |
| | | VerifiedReturnVO verifiedReturnVO = new VerifiedReturnVO(); |
| | | verifiedReturnVO.setAward(mcsCoupon.getAward()); |
| | | verifiedReturnVO.setAwardType(mcsGame.getAwardType()); |
| | | verifiedReturnVO.setCouponId(couponId); |
| | | verifiedReturnVO.setCover(mcsGame.getCover()); |
| | | verifiedReturnVO.setGameName(mcsGame.getName()); |
| | | verifiedReturnVO.setNickName(nickName); |
| | | verifiedReturnVO.setVerifiedAt(nowDate); |
| | | return R.ok(verifiedReturnVO); |
| | | } |
| | | return R.fail("核验失败,请重试"); |
| | | } |
| | | |
| | | /** |
| | | * 游戏统计 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R getMcsGameStatistics(Long userId) { |
| | | GameStatisticsVO gameStatisticsVO = this.baseMapper.getMcsGameStatistics(userId); |
| | | return R.ok(gameStatisticsVO); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsEvaluateDTO; |
| | | import com.panzhihua.service_community.dao.McsCouponDAO; |
| | | import com.panzhihua.service_community.entity.McsCoupon; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsEvaluateDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsEvaluateVO; |
| | | import com.panzhihua.service_community.dao.McsEvaluateDAO; |
| | | import com.panzhihua.service_community.entity.McsEvaluate; |
| | | import com.panzhihua.service_community.service.McsEvaluateService; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | |
| | | /** |
| | | * (McsEvaluate)表服务实现类 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-28 14:37:09 |
| | | */ |
| | | @Service("mcsEvaluateService") |
| | | public class McsEvaluateServiceImpl extends ServiceImpl<McsEvaluateDAO, McsEvaluate> implements McsEvaluateService { |
| | | |
| | | @Resource |
| | | private McsCouponDAO mcsCouponDAO; |
| | | |
| | | /** |
| | | * 分页查询评价记录 |
| | | * @param pageMcsEvaluateDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R pageMcsEvaluate(PageMcsEvaluateDTO pageMcsEvaluateDTO) { |
| | | Page page = new Page<>(); |
| | | page.setSize(pageMcsEvaluateDTO.getPageSize()); |
| | | page.setCurrent(pageMcsEvaluateDTO.getPageNum()); |
| | | IPage<McsEvaluateVO> mcsEvaluates = this.baseMapper.pageMcsEvaluate(page, pageMcsEvaluateDTO); |
| | | return R.ok(mcsEvaluates); |
| | | } |
| | | |
| | | /** |
| | | * 查询评价记录详情 |
| | | * @param evaluateId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R getMcsEvaluate(Long evaluateId) { |
| | | return R.ok(this.baseMapper.getMcsEvaluate(evaluateId)); |
| | | } |
| | | |
| | | /** |
| | | * 删除评价记录 |
| | | * @param evaluateId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R deleteMcsEvaluate(Long evaluateId) { |
| | | this.baseMapper.deleteById(evaluateId); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 新增评价记录 |
| | | * @param mcsEvaluateDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R addMcsEvaluate(McsEvaluateDTO mcsEvaluateDTO) { |
| | | McsCoupon mcsCoupon = mcsCouponDAO.selectById(mcsEvaluateDTO.getCouponId()); |
| | | if (isNull(mcsCoupon)) { |
| | | return R.fail("资源不存在"); |
| | | } |
| | | McsEvaluate mcsEvaluate = this.baseMapper.selectOne(new QueryWrapper<McsEvaluate>().lambda().eq(McsEvaluate::getCouponId, mcsEvaluateDTO.getCouponId())); |
| | | if (nonNull(mcsEvaluate)) { |
| | | return R.fail("请勿重复评论"); |
| | | } |
| | | mcsEvaluate = new McsEvaluate(); |
| | | BeanUtils.copyProperties(mcsEvaluateDTO, mcsEvaluate); |
| | | mcsEvaluate.setGameId(mcsCoupon.getGameId()); |
| | | int num = this.baseMapper.insert(mcsEvaluate); |
| | | if (num > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail("请求失败,请重试"); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | import static org.apache.commons.lang3.StringUtils.isNotEmpty; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Random; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsGameDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsGameDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetPopularForGameDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetShelfForGameDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsCouponVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsGameVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.TopStatisticsVO; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.common.utlis.Snowflake; |
| | | import com.panzhihua.service_community.dao.McsCouponDAO; |
| | | import com.panzhihua.service_community.dao.McsEvaluateDAO; |
| | | import com.panzhihua.service_community.dao.McsGameDAO; |
| | | import com.panzhihua.service_community.dao.McsMerchantDAO; |
| | | import com.panzhihua.service_community.entity.McsCoupon; |
| | | import com.panzhihua.service_community.entity.McsGame; |
| | | import com.panzhihua.service_community.entity.McsMerchant; |
| | | import com.panzhihua.service_community.service.McsGameService; |
| | | import com.panzhihua.service_community.util.NearbyUtil; |
| | | import com.panzhihua.service_community.util.QRCodeUtil; |
| | | import com.spatial4j.core.shape.Rectangle; |
| | | |
| | | /** |
| | | * (McsGame)表服务实现类 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-28 14:37:09 |
| | | */ |
| | | @Service("mcsGameService") |
| | | public class McsGameServiceImpl extends ServiceImpl<McsGameDAO, McsGame> implements McsGameService { |
| | | |
| | | @Resource |
| | | private McsMerchantDAO mcsMerchantDAO; |
| | | @Resource |
| | | private McsCouponDAO mcsCouponDAO; |
| | | @Resource |
| | | private McsEvaluateDAO mcsEvaluateDAO; |
| | | |
| | | /** |
| | | * 分页查询戳戳游戏 |
| | | * @param pageMcsGameDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R pageMcsGame(PageMcsGameDTO pageMcsGameDTO) { |
| | | Page page = new Page<>(); |
| | | page.setSize(pageMcsGameDTO.getPageSize()); |
| | | page.setCurrent(pageMcsGameDTO.getPageNum()); |
| | | IPage<McsGameVO> mcsGames = this.baseMapper.pageMcsGame(page, pageMcsGameDTO); |
| | | return R.ok(mcsGames); |
| | | } |
| | | |
| | | /** |
| | | * 设为/取消游戏热门 |
| | | * @param setPopularForGameDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R setPopularForGame(SetPopularForGameDTO setPopularForGameDTO) { |
| | | McsGame mcsGame = this.baseMapper.selectById(setPopularForGameDTO.getGameId()); |
| | | if (isNull(mcsGame)) { |
| | | return R.fail("修改数据不存在"); |
| | | } |
| | | Integer type = setPopularForGameDTO.getType(); |
| | | if (type.equals(1)) { |
| | | //设为热门 |
| | | List<McsGame> popularGames = this.baseMapper.selectList(new QueryWrapper<McsGame>().lambda().eq(McsGame::getIsPopular, true)); |
| | | if (nonNull(popularGames) && !popularGames.isEmpty()) { |
| | | popularGames.forEach(e -> e.setIsPopular(false)); |
| | | this.updateBatchById(popularGames); |
| | | } |
| | | mcsGame.setIsPopular(true); |
| | | } else if (type.equals(2)) { |
| | | //取消热门 |
| | | mcsGame.setIsPopular(false); |
| | | } else { |
| | | return R.fail("未知错误"); |
| | | } |
| | | int num = this.baseMapper.updateById(mcsGame); |
| | | if (num > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail("修改失败,请重新尝试"); |
| | | } |
| | | |
| | | /** |
| | | * 上架/下架戳戳游戏 |
| | | * @param setShelfForGameDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R setShelfForGame(SetShelfForGameDTO setShelfForGameDTO) { |
| | | McsGame mcsGame = this.baseMapper.selectById(setShelfForGameDTO.getGameId()); |
| | | if (isNull(mcsGame)) { |
| | | return R.fail("修改数据不存在"); |
| | | } |
| | | Integer type = setShelfForGameDTO.getType(); |
| | | if (type.equals(1)) { |
| | | //上架 |
| | | McsMerchant mcsMerchant = mcsMerchantDAO.selectById(mcsGame.getMerchantId()); |
| | | Integer publishLimit = mcsMerchant.getPublishLimit(); |
| | | Integer publishCount = this.baseMapper.selectPublishCount(mcsGame.getMerchantId()); |
| | | if (publishCount >= publishLimit) { |
| | | return R.fail("空闲戳戳点不足"); |
| | | } |
| | | mcsGame.setStatus(2); |
| | | } else if (type.equals(2)) { |
| | | //下架 |
| | | mcsGame.setStatus(3); |
| | | } else { |
| | | return R.fail("未知错误"); |
| | | } |
| | | int num = this.baseMapper.updateById(mcsGame); |
| | | if (num > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail("修改失败,请重新尝试"); |
| | | } |
| | | |
| | | /** |
| | | * 删除戳戳游戏 |
| | | * @param gameId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R deleteMcsGame(Long gameId, Long userId) { |
| | | McsGame mcsGame = this.baseMapper.selectById(gameId); |
| | | if (isNull(mcsGame)) { |
| | | return R.fail("修改数据不存在"); |
| | | } |
| | | mcsGame.setIsDel(true); |
| | | mcsGame.setStatus(McsGame.Status.yxj); |
| | | mcsGame.setUpdatedBy(userId); |
| | | int num = this.baseMapper.updateById(mcsGame); |
| | | if (num > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail("删除失败,请重新尝试"); |
| | | } |
| | | |
| | | /** |
| | | * 新增戳戳游戏 |
| | | * @param mcsGameDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R addMcsGame(McsGameDTO mcsGameDTO) { |
| | | Long userId = mcsGameDTO.getCreatedBy(); |
| | | McsMerchant mcsMerchant = mcsMerchantDAO.selectOne(new QueryWrapper<McsMerchant>().lambda().eq(McsMerchant::getUserId, userId)); |
| | | if (isNull(mcsMerchant)) { |
| | | return R.fail("未查询到商家信息"); |
| | | } |
| | | Integer type = mcsGameDTO.getType(); |
| | | McsGame mcsGame = new McsGame(); |
| | | if (type.equals(1)) { |
| | | //1.戳戳币游戏 |
| | | Integer allocation = mcsGameDTO.getAllocation(); |
| | | Integer coins = mcsGameDTO.getCoins(); |
| | | if (isNull(allocation)) { |
| | | return R.fail("缺少分配方式"); |
| | | } |
| | | if (isNull(coins)) { |
| | | return R.fail("未设置戳戳币额度"); |
| | | } |
| | | if (allocation.equals(1)) { |
| | | mcsGame.setSurplusCoins(mcsGameDTO.getCoins()); |
| | | } |
| | | } else if (type.equals(2)) { |
| | | //2.体验游戏 |
| | | Integer awardType = mcsGameDTO.getAwardType(); |
| | | if (isNull(awardType)) { |
| | | return R.fail("缺少奖励类型"); |
| | | } |
| | | } else { |
| | | return R.fail("未知错误"); |
| | | } |
| | | BeanUtils.copyProperties(mcsGameDTO, mcsGame); |
| | | mcsGame.setSurplusCoupons(mcsGameDTO.getCoupons()); |
| | | mcsGame.setStatus(McsGame.Status.wfb); |
| | | mcsGame.setMerchantId(mcsMerchant.getId()); |
| | | int num = this.baseMapper.insert(mcsGame); |
| | | if (num > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail("新增失败,请重新尝试"); |
| | | } |
| | | |
| | | /** |
| | | * 编辑戳戳游戏 |
| | | * @param mcsGameDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R putMcsGame(McsGameDTO mcsGameDTO) { |
| | | McsGame mcsGame = this.baseMapper.selectById(mcsGameDTO.getId()); |
| | | if (isNull(mcsGame)) { |
| | | return R.fail("资源不存在"); |
| | | } |
| | | Integer type = mcsGameDTO.getType(); |
| | | if (type.equals(1)) { |
| | | //1.戳戳币游戏 |
| | | Integer allocation = mcsGameDTO.getAllocation(); |
| | | Integer coins = mcsGameDTO.getCoins(); |
| | | if (isNull(allocation)) { |
| | | return R.fail("缺少分配方式"); |
| | | } |
| | | if (isNull(coins)) { |
| | | return R.fail("未设置戳戳币额度"); |
| | | } |
| | | Integer beforeCoins = mcsGame.getCoins(); |
| | | Integer beforeSurplusCoins = mcsGame.getSurplusCoins(); |
| | | if (isNull(beforeSurplusCoins)) { |
| | | beforeSurplusCoins = beforeCoins; |
| | | } |
| | | Integer beforeUsedCoins = beforeCoins - beforeSurplusCoins; |
| | | Integer surplusCoins = coins - beforeUsedCoins; |
| | | if (surplusCoins < 0) { |
| | | return R.fail("戳戳币总额少于已发出的数量"); |
| | | } |
| | | mcsGame.setSurplusCoins(surplusCoins); |
| | | } else if (type.equals(2)) { |
| | | //2.体验游戏 |
| | | Integer awardType = mcsGameDTO.getAwardType(); |
| | | if (isNull(awardType)) { |
| | | return R.fail("缺少奖励类型"); |
| | | } |
| | | } else { |
| | | return R.fail("未知错误"); |
| | | } |
| | | Integer beforeCoupons = mcsGame.getCoupons(); |
| | | Integer beforeSurplusCoupons = mcsGame.getSurplusCoupons(); |
| | | Integer beforeUsedCoupons = beforeCoupons - beforeSurplusCoupons; |
| | | BeanUtils.copyProperties(mcsGameDTO, mcsGame); |
| | | Integer coupons = mcsGame.getCoupons(); |
| | | Integer surplusCoupons = coupons - beforeUsedCoupons; |
| | | if (surplusCoupons < 0) { |
| | | return R.fail("卷总数少于已发出的数量"); |
| | | } |
| | | mcsGame.setSurplusCoupons(surplusCoupons); |
| | | int num = this.baseMapper.updateById(mcsGame); |
| | | if (num > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail("编辑失败,请重新尝试"); |
| | | } |
| | | |
| | | /** |
| | | * 发布戳戳游戏 |
| | | * @param gameId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R publishMcsGame(Long gameId, Long userId) { |
| | | McsGame mcsGame = this.baseMapper.selectById(gameId); |
| | | if (isNull(mcsGame)) { |
| | | return R.fail("资源不存在"); |
| | | } |
| | | McsMerchant mcsMerchant = mcsMerchantDAO.selectById(mcsGame.getMerchantId()); |
| | | Integer publishLimit = mcsMerchant.getPublishLimit(); |
| | | Integer publishCount = this.baseMapper.selectPublishCount(mcsGame.getMerchantId()); |
| | | if (publishCount >= publishLimit) { |
| | | return R.fail("空闲戳戳点不足"); |
| | | } |
| | | mcsGame.setStatus(McsGame.Status.jxz); |
| | | mcsGame.setPublishAt(new Date()); |
| | | mcsGame.setUpdatedBy(userId); |
| | | int num = this.baseMapper.updateById(mcsGame); |
| | | if (num > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail("发布失败,请重新尝试"); |
| | | } |
| | | |
| | | /** |
| | | * 结束戳戳游戏 |
| | | * @param gameId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R finishMcsGame(Long gameId, Long userId) { |
| | | McsGame mcsGame = this.baseMapper.selectById(gameId); |
| | | if (isNull(mcsGame)) { |
| | | return R.fail("资源不存在"); |
| | | } |
| | | mcsGame.setStatus(McsGame.Status.yjs); |
| | | mcsGame.setUpdatedBy(userId); |
| | | int num = this.baseMapper.updateById(mcsGame); |
| | | if (num > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail("结束失败,请重新尝试"); |
| | | } |
| | | |
| | | /** |
| | | * 戳戳游戏顶部统计数据 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R getTopStatistics(Long userId) { |
| | | McsMerchant mcsMerchant = mcsMerchantDAO.selectOne(new QueryWrapper<McsMerchant>().lambda().eq(McsMerchant::getUserId, userId)); |
| | | if (isNull(mcsMerchant)) { |
| | | return R.fail("未查询到商家信息"); |
| | | } |
| | | TopStatisticsVO topStatisticsVO = new TopStatisticsVO(); |
| | | topStatisticsVO.setExpireAt(mcsMerchant.getExpireAt()); |
| | | if (nonNull(mcsMerchant.getExpireAt())) { |
| | | int surplusLitDays = DateUtils.retrieveRemainingDays(mcsMerchant.getExpireAt()); |
| | | topStatisticsVO.setSurplusLitDays(surplusLitDays > 0 ? surplusLitDays : 0); |
| | | } |
| | | Integer appliedCount = this.baseMapper.selectAppliedCount(mcsMerchant.getId()); |
| | | topStatisticsVO.setAppliedTotal(appliedCount); |
| | | Integer verifiedCount = this.baseMapper.selectVerifiedCount(mcsMerchant.getId()); |
| | | topStatisticsVO.setVerifiedTotal(verifiedCount); |
| | | |
| | | Integer publishLimit = mcsMerchant.getPublishLimit(); |
| | | Integer publishCount = this.baseMapper.selectPublishCount(mcsMerchant.getId()); |
| | | Integer idleTotal = publishLimit - publishCount; |
| | | topStatisticsVO.setIdleTotal(idleTotal > 0 ? idleTotal : 0); |
| | | return R.ok(topStatisticsVO); |
| | | } |
| | | |
| | | /** |
| | | * 戳戳卷领取 |
| | | * @param gameId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R applyMcsCoupon(Long gameId, Long userId) { |
| | | McsGame mcsGame = this.baseMapper.selectById(gameId); |
| | | if (isNull(mcsGame) || mcsGame.getIsDel()) { |
| | | return R.fail("游戏已下架"); |
| | | } |
| | | Integer userAppliedCount = mcsCouponDAO.selectCount(new QueryWrapper<McsCoupon>().lambda().eq(McsCoupon::getGameId, gameId).eq(McsCoupon::getUserId, userId)); |
| | | if (userAppliedCount > 0) { |
| | | return R.fail("请勿重复领取"); |
| | | } |
| | | Integer surplusCoupons = mcsGame.getSurplusCoupons(); |
| | | if (surplusCoupons <= 0) { |
| | | return R.fail("抢光了"); |
| | | } |
| | | McsCoupon mcsCoupon = new McsCoupon(); |
| | | Long snowflakeId = Snowflake.getId(); |
| | | mcsCoupon.setId(snowflakeId); |
| | | mcsCoupon.setGameId(gameId); |
| | | mcsCoupon.setUserId(userId); |
| | | mcsCoupon.setQrCode(QRCodeUtil.getBase64QRCode(snowflakeId.toString())); |
| | | Integer type = mcsGame.getType(); |
| | | if (type.equals(1)) { |
| | | //戳戳币游戏 |
| | | Integer allocation = mcsGame.getAllocation(); |
| | | if (allocation.equals(1)) { |
| | | //随机分配 |
| | | Integer surplusCoins = mcsGame.getSurplusCoins(); |
| | | Integer coin = getRandomCoins(surplusCoins, mcsGame.getSurplusCoupons()); |
| | | mcsCoupon.setCoin(coin); |
| | | mcsCoupon.setAward("戳戳币:" + coin); |
| | | mcsGame.setSurplusCoins(surplusCoins - coin); |
| | | } else { |
| | | //固定值 |
| | | mcsCoupon.setCoin(mcsGame.getCoins()); |
| | | mcsCoupon.setAward("戳戳币:" + mcsGame.getCoins()); |
| | | } |
| | | } else { |
| | | //体验游戏 |
| | | Integer awardType = mcsGame.getAwardType(); |
| | | if (awardType.equals(1)) { |
| | | mcsCoupon.setAward("免费产品"); |
| | | } else { |
| | | mcsCoupon.setAward("免费服务"); |
| | | } |
| | | } |
| | | int num = mcsCouponDAO.insert(mcsCoupon); |
| | | if (num > 0) { |
| | | mcsGame.setSurplusCoupons(surplusCoupons - 1); |
| | | this.baseMapper.updateById(mcsGame); |
| | | McsCouponVO mcsCouponVO = new McsCouponVO(); |
| | | mcsCouponVO.setId(snowflakeId); |
| | | mcsCouponVO.setIsVerified(false); |
| | | mcsCouponVO.setQrCode(mcsCoupon.getQrCode()); |
| | | mcsCouponVO.setAward(mcsCoupon.getAward()); |
| | | return R.ok(mcsCouponVO); |
| | | } |
| | | return R.fail("领取失败,请重试"); |
| | | } |
| | | |
| | | /** |
| | | * h5分页查询戳戳游戏 |
| | | * @param pageMcsGameDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R pageH5McsGame(PageMcsGameDTO pageMcsGameDTO) { |
| | | Page page = new Page<>(); |
| | | page.setSize(pageMcsGameDTO.getPageSize()); |
| | | page.setCurrent(pageMcsGameDTO.getPageNum()); |
| | | String lat = pageMcsGameDTO.getLat(); |
| | | String lon = pageMcsGameDTO.getLon(); |
| | | Integer distance = pageMcsGameDTO.getDistance(); |
| | | IPage<McsGameVO> mcsGames; |
| | | if (isNotEmpty(lat) && isNotEmpty(lon) && nonNull(distance)) { |
| | | Rectangle rectangle = new NearbyUtil().getRectangle(pageMcsGameDTO.getDistance(), |
| | | Double.parseDouble(pageMcsGameDTO.getLon()), Double.parseDouble(pageMcsGameDTO.getLat())); |
| | | mcsGames = this.baseMapper.pageH5McsGame(page, rectangle.getMinX(), rectangle.getMaxX(), |
| | | rectangle.getMinY(), rectangle.getMaxY(), pageMcsGameDTO); |
| | | } else { |
| | | mcsGames = this.baseMapper.pageH5McsGame(page, null, null, null, null, pageMcsGameDTO); |
| | | } |
| | | |
| | | return R.ok(mcsGames); |
| | | } |
| | | |
| | | /** |
| | | * 游戏详情 |
| | | * @param gameId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R getMcsGame(Long gameId) { |
| | | McsGameVO mcsGameVO = this.baseMapper.selectDetailById(gameId); |
| | | Integer gameCount = this.baseMapper.selectCount(new QueryWrapper<McsGame>().lambda() |
| | | .eq(McsGame::getMerchantId, mcsGameVO.getMerchantId()).eq(McsGame::getStatus, McsGame.Status.jxz).eq(McsGame::getIsDel, false)); |
| | | mcsGameVO.setGameCount(gameCount); |
| | | return R.ok(mcsGameVO); |
| | | } |
| | | |
| | | /** |
| | | * 定时任务-每隔5分钟执行一次,将已到期的微商业街游戏结束 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R endStatusForMcsGame() { |
| | | List<McsGame> games = this.baseMapper.selectNeedDealExpire(); |
| | | if (nonNull(games) && !games.isEmpty()) { |
| | | games.forEach(e -> e.setStatus(McsGame.Status.yjs)); |
| | | this.updateBatchById(games); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | int total = 500; |
| | | int people = 10; |
| | | for (int i = 1;i <= 10; i++) { |
| | | Integer decrease = getRandomCoins(total, people); |
| | | total -= decrease; |
| | | people --; |
| | | System.out.println("第:" + i + "个人领取到:" + decrease + "戳戳币,总数还剩下:" + total); |
| | | } |
| | | } |
| | | |
| | | public static Integer getRandomCoins(int totalCoins, int peopleTotal) { |
| | | List<Integer> list = new ArrayList<>(peopleTotal); |
| | | if (peopleTotal == 1) { |
| | | return totalCoins; |
| | | } |
| | | Random random = new Random(); |
| | | // 平均分配 |
| | | int average = totalCoins / peopleTotal; |
| | | int max = (int) Math.floor(totalCoins * 0.6); |
| | | int min = (int) Math.floor(average * 0.5); |
| | | float thresh = 0.95F; |
| | | int rest = totalCoins - average * peopleTotal; |
| | | for (int i = 0; i < peopleTotal; i++) { |
| | | if (i < rest) { |
| | | list.add(average + 1); |
| | | } else { |
| | | list.add(average); |
| | | } |
| | | } |
| | | // 根据阀值进行数据随机处理 |
| | | int randOfRange = 0; |
| | | int randRom = 0; |
| | | int nextIndex = 0; |
| | | int nextValue = 0; |
| | | //多余 |
| | | int surplus = 0; |
| | | //缺少 |
| | | int lack = 0; |
| | | for (int i = 0; i < peopleTotal - 1; i++) { |
| | | nextIndex = i + 1; |
| | | int itemThis = list.get(i); |
| | | int itemNext = list.get(nextIndex); |
| | | boolean isLt = itemThis < itemNext; |
| | | int rangeThis = isLt ? max - itemThis : itemThis - min; |
| | | int rangeNext = isLt ? itemNext - min : max - itemNext; |
| | | int rangeFinal = (int) Math.ceil(thresh * (Math.min(rangeThis, rangeNext) + 1)); |
| | | randOfRange = random.nextInt(rangeFinal); |
| | | randRom = isLt ? 1 : -1; |
| | | int iValue = list.get(i) + randRom * randOfRange; |
| | | nextValue = list.get(nextIndex) + randRom * randOfRange * -1; |
| | | if (iValue > max) { |
| | | surplus += (iValue - max); |
| | | list.set(i, max); |
| | | } else if (iValue < min) { |
| | | list.set(i, min); |
| | | lack += (min - iValue); |
| | | } else { |
| | | list.set(i, iValue); |
| | | } |
| | | list.set(nextIndex, nextValue); |
| | | } |
| | | if (nextValue > max) { |
| | | surplus += (nextValue - max); |
| | | list.set(nextIndex, max); |
| | | } |
| | | if (nextValue < min) { |
| | | lack += (min - nextValue); |
| | | list.set(nextIndex, min); |
| | | } |
| | | if (surplus - lack > 0) { |
| | | //分少了 给低于max的凑到max |
| | | for (int i = 0; i < list.size(); i++) { |
| | | int value = list.get(i); |
| | | if (value < max) { |
| | | int tmp = max - value; |
| | | if (surplus >= tmp) { |
| | | surplus -= tmp; |
| | | list.set(i, max); |
| | | } else { |
| | | list.set(i, value + surplus); |
| | | return list.get(random.nextInt(list.size() - 1)); |
| | | } |
| | | } |
| | | } |
| | | } else if (lack - surplus > 0) { |
| | | //分多了 给超过高于min的人凑到min |
| | | for (int i = 0; i < list.size(); i++) { |
| | | int value = list.get(i); |
| | | if (value > min) { |
| | | int tmp = value - min; |
| | | if (lack >= tmp) { |
| | | lack -= tmp; |
| | | list.set(i, min); |
| | | } else { |
| | | list.set(i, min + tmp - lack); |
| | | return list.get(random.nextInt(list.size() - 1)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return list.get(random.nextInt(list.size() - 1)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsInfoDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsInformationDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetShelfForInfoDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsInformationVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsMerchantVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.TopStatisticsVO; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.service_community.dao.McsGameDAO; |
| | | import com.panzhihua.service_community.dao.McsInformationDAO; |
| | | import com.panzhihua.service_community.dao.McsMerchantDAO; |
| | | import com.panzhihua.service_community.entity.McsInformation; |
| | | import com.panzhihua.service_community.entity.McsMerchant; |
| | | import com.panzhihua.service_community.service.McsInformationService; |
| | | |
| | | /** |
| | | * (McsInformation)表服务实现类 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-28 14:37:10 |
| | | */ |
| | | @Service("mcsInformationService") |
| | | public class McsInformationServiceImpl extends ServiceImpl<McsInformationDAO, McsInformation> |
| | | implements McsInformationService { |
| | | |
| | | @Resource |
| | | private McsGameDAO mcsGameDAO; |
| | | @Resource |
| | | private McsMerchantDAO mcsMerchantDAO; |
| | | |
| | | /** |
| | | * 分页查询戳戳资讯 |
| | | * @param pageMcsInformationDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R pageMcsInfo(PageMcsInformationDTO pageMcsInformationDTO) { |
| | | Page page = new Page<>(); |
| | | page.setSize(pageMcsInformationDTO.getPageSize()); |
| | | page.setCurrent(pageMcsInformationDTO.getPageNum()); |
| | | IPage<McsInformationVO> mcsInfos = this.baseMapper.pageMcsInfo(page, pageMcsInformationDTO); |
| | | return R.ok(mcsInfos); |
| | | } |
| | | |
| | | /** |
| | | * 上架/下架戳戳资讯 |
| | | * @param setShelfForInfoDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R setShelfForMcsInfo(SetShelfForInfoDTO setShelfForInfoDTO) { |
| | | McsInformation mcsInformation = this.baseMapper.selectById(setShelfForInfoDTO.getInfoId()); |
| | | if (isNull(mcsInformation)) { |
| | | return R.fail("修改数据不存在"); |
| | | } |
| | | Integer type = setShelfForInfoDTO.getType(); |
| | | if (type.equals(1)) { |
| | | //上架 |
| | | McsMerchant mcsMerchant = mcsMerchantDAO.selectById(mcsInformation.getMerchantId()); |
| | | Integer publishLimit = mcsMerchant.getPublishLimit(); |
| | | Integer publishCount = mcsGameDAO.selectPublishCount(mcsInformation.getMerchantId()); |
| | | if (publishCount >= publishLimit) { |
| | | return R.fail("空闲戳戳点不足"); |
| | | } |
| | | mcsInformation.setStatus(2); |
| | | } else if (type.equals(2)) { |
| | | //下架 |
| | | mcsInformation.setStatus(3); |
| | | } else { |
| | | return R.fail("未知错误"); |
| | | } |
| | | int num = this.baseMapper.updateById(mcsInformation); |
| | | if (num > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail("修改失败,请重新尝试"); |
| | | } |
| | | |
| | | /** |
| | | * 删除戳戳资讯 |
| | | * @param infoId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R deleteMcsInfo(Long infoId, Long userId) { |
| | | McsInformation mcsInformation = this.baseMapper.selectById(infoId); |
| | | if (isNull(mcsInformation)) { |
| | | return R.fail("修改数据不存在"); |
| | | } |
| | | mcsInformation.setIsDel(true); |
| | | mcsInformation.setStatus(McsInformation.Status.yxj); |
| | | mcsInformation.setUpdatedBy(userId); |
| | | int num = this.baseMapper.updateById(mcsInformation); |
| | | if (num > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail("删除失败,请重新尝试"); |
| | | } |
| | | |
| | | /** |
| | | * 戳戳资讯顶部统计数据 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R getTopStatistics(Long userId) { |
| | | McsMerchant mcsMerchant = mcsMerchantDAO.selectOne(new QueryWrapper<McsMerchant>().lambda().eq(McsMerchant::getUserId, userId)); |
| | | if (isNull(mcsMerchant)) { |
| | | return R.fail("未查询到商家信息"); |
| | | } |
| | | TopStatisticsVO topStatisticsVO = new TopStatisticsVO(); |
| | | topStatisticsVO.setExpireAt(mcsMerchant.getExpireAt()); |
| | | if (nonNull(mcsMerchant.getExpireAt())) { |
| | | int surplusLitDays = DateUtils.retrieveRemainingDays(mcsMerchant.getExpireAt()); |
| | | topStatisticsVO.setSurplusLitDays(surplusLitDays > 0 ? surplusLitDays : 0); |
| | | } |
| | | |
| | | Integer publishLimit = mcsMerchant.getPublishLimit(); |
| | | Integer publishCount = mcsGameDAO.selectPublishCount(mcsMerchant.getId()); |
| | | Integer idleTotal = publishLimit - publishCount; |
| | | topStatisticsVO.setIdleTotal(idleTotal > 0 ? idleTotal : 0); |
| | | return R.ok(topStatisticsVO); |
| | | } |
| | | |
| | | /** |
| | | * 新增戳戳资讯 |
| | | * @param mcsInfoDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R addMcsInfo(McsInfoDTO mcsInfoDTO) { |
| | | Long userId = mcsInfoDTO.getCreatedBy(); |
| | | McsMerchant mcsMerchant = mcsMerchantDAO.selectOne(new QueryWrapper<McsMerchant>().lambda().eq(McsMerchant::getUserId, userId)); |
| | | if (isNull(mcsMerchant)) { |
| | | return R.fail("未查询到商家信息"); |
| | | } |
| | | McsInformation mcsInformation = new McsInformation(); |
| | | BeanUtils.copyProperties(mcsInfoDTO, mcsInformation); |
| | | mcsInformation.setMerchantId(mcsMerchant.getId()); |
| | | mcsInformation.setStatus(McsInformation.Status.wfb); |
| | | int num = this.baseMapper.insert(mcsInformation); |
| | | if (num > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail("新增失败,请重新尝试"); |
| | | } |
| | | |
| | | /** |
| | | * 编辑戳戳资讯 |
| | | * @param mcsInfoDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R putMcsInfo(McsInfoDTO mcsInfoDTO) { |
| | | McsInformation mcsInformation = this.baseMapper.selectById(mcsInfoDTO.getId()); |
| | | if (isNull(mcsInformation)) { |
| | | return R.fail("资源不存在"); |
| | | } |
| | | BeanUtils.copyProperties(mcsInfoDTO, mcsInformation); |
| | | int num = this.baseMapper.updateById(mcsInformation); |
| | | if (num > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail("编辑失败,请重新尝试"); |
| | | } |
| | | |
| | | /** |
| | | * 发布戳戳资讯 |
| | | * @param infoId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R publishMcsInfo(Long infoId, Long userId) { |
| | | McsInformation mcsInformation = this.baseMapper.selectById(infoId); |
| | | if (isNull(mcsInformation)) { |
| | | return R.fail("资源不存在"); |
| | | } |
| | | McsMerchant mcsMerchant = mcsMerchantDAO.selectById(mcsInformation.getMerchantId()); |
| | | Integer publishLimit = mcsMerchant.getPublishLimit(); |
| | | Integer publishCount = mcsGameDAO.selectPublishCount(mcsInformation.getMerchantId()); |
| | | if (publishCount >= publishLimit) { |
| | | return R.fail("空闲戳戳点不足"); |
| | | } |
| | | mcsInformation.setStatus(McsInformation.Status.yfb); |
| | | mcsInformation.setPublishAt(new Date()); |
| | | int num = this.baseMapper.updateById(mcsInformation); |
| | | if (num > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail("发布失败,请重新尝试"); |
| | | } |
| | | |
| | | /** |
| | | * h5分页查询戳戳资讯 |
| | | * @param pageMcsInformationDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R pageH5McsInfo(PageMcsInformationDTO pageMcsInformationDTO) { |
| | | Page page = new Page<>(); |
| | | page.setSize(pageMcsInformationDTO.getPageSize()); |
| | | page.setCurrent(pageMcsInformationDTO.getPageNum()); |
| | | IPage<McsInformationVO> mcsInfos = this.baseMapper.pageH5McsInfo(page, pageMcsInformationDTO); |
| | | return R.ok(mcsInfos); |
| | | } |
| | | |
| | | /** |
| | | * 资讯详情 |
| | | * @param infoId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R getMcsInfo(Long infoId) { |
| | | McsInformation mcsInformation = this.baseMapper.selectById(infoId); |
| | | if (isNull(mcsInformation)) { |
| | | return R.fail("资源不存在"); |
| | | } |
| | | McsInformationVO mcsInformationVO = new McsInformationVO(); |
| | | BeanUtils.copyProperties(mcsInformation, mcsInformationVO); |
| | | McsMerchant mcsMerchant = mcsMerchantDAO.selectById(mcsInformation.getMerchantId()); |
| | | McsMerchantVO mcsMerchantVO = new McsMerchantVO(); |
| | | if (nonNull(mcsMerchant)) { |
| | | mcsMerchantVO.setId(mcsMerchant.getId()); |
| | | mcsMerchantVO.setName(mcsMerchant.getName()); |
| | | mcsMerchantVO.setLogo(mcsMerchant.getLogo()); |
| | | mcsMerchantVO.setIntroduction(mcsMerchant.getIntroduction()); |
| | | mcsMerchantVO.setLat(mcsMerchant.getLat()); |
| | | mcsMerchantVO.setLon(mcsMerchant.getLon()); |
| | | mcsMerchantVO.setAddress(mcsMerchant.getAddress()); |
| | | } |
| | | mcsInformationVO.setMerchantInfo(mcsMerchantVO); |
| | | return R.ok(mcsInformationVO); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.dao.McsLabelDAO; |
| | | import com.panzhihua.service_community.entity.McsLabel; |
| | | import com.panzhihua.service_community.service.McsLabelService; |
| | | |
| | | /** |
| | | * (McsLabel)表服务实现类 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-28 14:37:11 |
| | | */ |
| | | @Service("mcsLabelService") |
| | | public class McsLabelServiceImpl extends ServiceImpl<McsLabelDAO, McsLabel> implements McsLabelService { |
| | | |
| | | /** |
| | | * 获取产品标签列表 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R getMcsLabelList(Long userId) { |
| | | return R.ok(this.baseMapper.selectVOList(userId)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | import static org.apache.commons.lang3.StringUtils.isBlank; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Random; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.exceptions.ServiceException; |
| | | import com.panzhihua.common.model.dtos.community.convenient.DisableOrEnableConvenientMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.DisableOrEnableMcsMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.LoginWithPhoneDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PutUserInfoDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.IndexTopStatisticsVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsGameVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsLoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsMerchantVO; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.service_community.dao.McsConfigDAO; |
| | | import com.panzhihua.service_community.dao.McsGameDAO; |
| | | import com.panzhihua.service_community.dao.McsInformationDAO; |
| | | import com.panzhihua.service_community.dao.McsMerchantDAO; |
| | | import com.panzhihua.service_community.dao.McsOrderDao; |
| | | import com.panzhihua.service_community.entity.McsConfig; |
| | | import com.panzhihua.service_community.entity.McsMerchant; |
| | | import com.panzhihua.service_community.entity.McsOrder; |
| | | import com.panzhihua.service_community.service.McsMerchantService; |
| | | |
| | | /** |
| | | * (McsMerchant)表服务实现类 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-28 14:37:11 |
| | | */ |
| | | @Service("mcsMerchantService") |
| | | public class McsMerchantServiceImpl extends ServiceImpl<McsMerchantDAO, McsMerchant> implements McsMerchantService { |
| | | |
| | | private static final String MERCHANT_PUBLISH_LIMIT_KEY = "MERCHANT_PUBLISH_LIMIT"; |
| | | private static final String DEFAULT_IMAGE_URL = "https://www.psciio.com//idcard/91313573d071436ab1f934231b31c6e5.jpg"; |
| | | private static final int DEFAULT_PUBLISH_LIMIT = 2; |
| | | private static final String CUSTOMER_SERVICE_CONTACT_NUM="CUSTOMER_SERVICE_CONTACT_NUM"; |
| | | |
| | | @Resource |
| | | private UserService userService; |
| | | @Resource |
| | | private McsConfigDAO mcsConfigDAO; |
| | | @Resource |
| | | private McsGameDAO mcsGameDAO; |
| | | @Resource |
| | | private McsInformationDAO mcsInformationDAO; |
| | | @Resource |
| | | private StringRedisTemplate stringRedisTemplate; |
| | | @Resource |
| | | private McsOrderDao mcsOrderDao; |
| | | |
| | | /** |
| | | * 新增数字商业街商家 |
| | | * @param mcsMerchantDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R addMcsMerchant(McsMerchantDTO mcsMerchantDTO) { |
| | | McsMerchant existMerchant = this.baseMapper.selectOne(new QueryWrapper<McsMerchant>().lambda().eq(McsMerchant::getPhone, mcsMerchantDTO.getPhone())); |
| | | if (nonNull(existMerchant)) { |
| | | if (existMerchant.getIsDel()) { |
| | | this.baseMapper.deleteById(existMerchant.getId()); |
| | | } else { |
| | | return R.fail("手机号已存在"); |
| | | } |
| | | } |
| | | McsMerchant mcsMerchant = new McsMerchant(); |
| | | BeanUtils.copyProperties(mcsMerchantDTO, mcsMerchant); |
| | | Integer litDays = mcsMerchantDTO.getLitDays(); |
| | | mcsMerchant.setExpireAt(DateUtils.addDay(new Date(), litDays)); |
| | | mcsMerchant.setFirstLitAt(new Date()); |
| | | McsConfig publishLimitConfig = mcsConfigDAO.selectOne(new QueryWrapper<McsConfig>().lambda().eq(McsConfig::getKey, MERCHANT_PUBLISH_LIMIT_KEY)); |
| | | mcsMerchant.setPublishLimit(nonNull(publishLimitConfig) ? Integer.parseInt(publishLimitConfig.getValue()) : DEFAULT_PUBLISH_LIMIT); |
| | | mcsMerchant.setUserId(0L); |
| | | int insertResult = this.baseMapper.insert(mcsMerchant); |
| | | if (insertResult > 0) { |
| | | //添加user |
| | | R addUserResult = userService.addMcsMerchantUser(mcsMerchantDTO); |
| | | if (R.isOk(addUserResult)) { |
| | | LoginUserInfoVO loginUserInfoVO = JSONObject.parseObject(JSONObject.toJSONString(addUserResult.getData()), LoginUserInfoVO.class); |
| | | mcsMerchant.setUserId(loginUserInfoVO.getUserId()); |
| | | this.baseMapper.updateById(mcsMerchant); |
| | | } else { |
| | | throw new ServiceException("406", addUserResult.getMsg()); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | return R.fail("添加失败"); |
| | | } |
| | | |
| | | /** |
| | | * 编辑数字商业街商家 |
| | | * @param mcsMerchantDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R putMcsMerchant(McsMerchantDTO mcsMerchantDTO) { |
| | | McsMerchant mcsMerchant = this.baseMapper.selectById(mcsMerchantDTO.getId()); |
| | | Long userId = mcsMerchant.getUserId(); |
| | | if (isNull(mcsMerchant)) { |
| | | return R.fail("商家不存在"); |
| | | } |
| | | if (mcsMerchantDTO.getLevel().equals(1)) { |
| | | Integer litDays = mcsMerchantDTO.getLitDays(); |
| | | if (nonNull(litDays)) { |
| | | mcsMerchant.setExpireAt(DateUtils.addDay(new Date(), litDays)); |
| | | } |
| | | } |
| | | BeanUtils.copyProperties(mcsMerchantDTO, mcsMerchant); |
| | | int result = this.baseMapper.updateById(mcsMerchant); |
| | | if (result > 0) { |
| | | //修改商家绑定账户号 |
| | | mcsMerchantDTO.setUserId(userId); |
| | | R putResult = userService.putMcsMerchantUser(mcsMerchantDTO); |
| | | if (!R.isOk(putResult)) { |
| | | throw new ServiceException("406", putResult.getMsg()); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | return R.fail("修改失败,请重新尝试"); |
| | | } |
| | | |
| | | /** |
| | | * 查询数字商业街商家详情 |
| | | * @param merchantId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R getMcsMerchant(Long merchantId) { |
| | | McsMerchantVO merchantVO = this.baseMapper.getMcsMerchantById(merchantId); |
| | | if (nonNull(merchantVO)) { |
| | | retrieveMerchantSurplusLitDays(merchantVO); |
| | | } |
| | | return R.ok(merchantVO); |
| | | } |
| | | |
| | | /** |
| | | * 删除数字商业街商家 |
| | | * @param merchantId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R deleteMcsMerchant(Long merchantId, Long userId) { |
| | | McsMerchant mcsMerchant = this.baseMapper.selectById(merchantId); |
| | | if (isNull(mcsMerchant)) { |
| | | return R.fail("商家不存在"); |
| | | } |
| | | mcsMerchant.setIsDel(true); |
| | | this.baseMapper.updateById(mcsMerchant); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询数字商业街商家 |
| | | * @param pageMcsMerchantDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R pageMcsMerchant(PageMcsMerchantDTO pageMcsMerchantDTO) { |
| | | Page page = new Page<>(); |
| | | page.setSize(pageMcsMerchantDTO.getPageSize()); |
| | | page.setCurrent(pageMcsMerchantDTO.getPageNum()); |
| | | IPage<McsMerchantVO> mcsMerchants = this.baseMapper.pageMcsMerchant(page, pageMcsMerchantDTO); |
| | | List<McsMerchantVO> records = mcsMerchants.getRecords(); |
| | | if (nonNull(records) && !records.isEmpty()) { |
| | | records.forEach(e -> retrieveMerchantSurplusLitDays(e)); |
| | | } |
| | | return R.ok(mcsMerchants); |
| | | } |
| | | |
| | | /** |
| | | * 禁用/启用数字商业街商家 |
| | | * @param disableOrEnableMcsMerchantDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R disableOrEnableMcsMerchant(DisableOrEnableMcsMerchantDTO disableOrEnableMcsMerchantDTO) { |
| | | McsMerchant mcsMerchant = this.baseMapper.selectById(disableOrEnableMcsMerchantDTO.getMerchantId()); |
| | | if (isNull(mcsMerchant)) { |
| | | return R.fail("商家不存在"); |
| | | } |
| | | Integer type = disableOrEnableMcsMerchantDTO.getType(); |
| | | if (type.equals(1) || type.equals(2)) { |
| | | //启用 or 禁用 |
| | | DisableOrEnableConvenientMerchantDTO dto = new DisableOrEnableConvenientMerchantDTO(); |
| | | dto.setType(type); |
| | | dto.setUserIds(Arrays.asList(mcsMerchant.getUserId())); |
| | | R r = userService.disableOrEnableMerchantUsers(dto); |
| | | return r; |
| | | } else { |
| | | return R.fail("未知错误"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据account查询微商业街商家信息 |
| | | * @param account |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R getMcsMerchantByAccount(String account) { |
| | | McsMerchantVO merchantVO = this.baseMapper.getMcsMerchantByAccount(account); |
| | | if (isNull(merchantVO)) { |
| | | return R.fail("账号不存在"); |
| | | } |
| | | retrieveMerchantSurplusLitDays(merchantVO); |
| | | McsConfig mcsConfig=mcsConfigDAO.selectOne(new QueryWrapper<McsConfig>().lambda().eq(McsConfig::getKey,CUSTOMER_SERVICE_CONTACT_NUM)); |
| | | if(mcsConfig!=null){ |
| | | merchantVO.setCustomPhone(mcsConfig.getValue()); |
| | | } |
| | | |
| | | return R.ok(merchantVO); |
| | | } |
| | | |
| | | /** |
| | | * 完成订单更新/新增商家信息 |
| | | * |
| | | * @param orderNo |
| | | * @param configId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R updateOrAddMcsMerchantAfterOrder(String orderNo, Long configId, Long userId) { |
| | | McsOrder mcsOrder = mcsOrderDao.selectOne(new QueryWrapper<McsOrder>().lambda().eq(McsOrder::getOrderNo, orderNo)); |
| | | if (isNull(mcsOrder)) { |
| | | return R.fail("订单不存在"); |
| | | } |
| | | McsMerchant mcsMerchant = this.baseMapper.selectOne(new QueryWrapper<McsMerchant>().lambda().eq(McsMerchant::getUserId, userId)); |
| | | McsConfig mcsConfig = mcsConfigDAO.selectById(configId); |
| | | if (isNull(mcsConfig) || isBlank(mcsConfig.getValue())) { |
| | | return R.fail("套餐配置不存在"); |
| | | } |
| | | JSONObject packageObject = JSONObject.parseObject(mcsConfig.getValue()); |
| | | if (!packageObject.containsKey("day")) { |
| | | return R.fail("配置有误"); |
| | | } |
| | | Integer litDays = (Integer)packageObject.get("day"); |
| | | String merchantName = mcsOrder.getMerchantName(); |
| | | Date nowDate = new Date(); |
| | | int num; |
| | | if (isNull(mcsMerchant)) { |
| | | //新增商家 |
| | | R<LoginUserInfoVO> userInfoVOR = userService.getUserInfoByUserId(userId.toString()); |
| | | if (R.isOk(userInfoVOR) && nonNull(userInfoVOR.getData())) { |
| | | LoginUserInfoVO loginUserInfoVO = JSONObject.parseObject(JSONObject.toJSONString(userInfoVOR.getData()), LoginUserInfoVO.class); |
| | | mcsMerchant = new McsMerchant(); |
| | | mcsMerchant.setName(isBlank(merchantName) ? loginUserInfoVO.getName() : merchantName); |
| | | mcsMerchant.setPhone(loginUserInfoVO.getPhone()); |
| | | mcsMerchant.setAccount(loginUserInfoVO.getAccount()); |
| | | mcsMerchant.setLevel(1); |
| | | mcsMerchant.setExpireAt(DateUtils.addDay(nowDate, litDays)); |
| | | mcsMerchant.setFirstLitAt(nowDate); |
| | | McsConfig publishLimitConfig = mcsConfigDAO.selectOne(new QueryWrapper<McsConfig>().lambda().eq(McsConfig::getKey, MERCHANT_PUBLISH_LIMIT_KEY)); |
| | | mcsMerchant.setPublishLimit(nonNull(publishLimitConfig) ? Integer.parseInt(publishLimitConfig.getValue()) : DEFAULT_PUBLISH_LIMIT); |
| | | mcsMerchant.setUserId(userId); |
| | | mcsMerchant.setCreatedBy(userId); |
| | | mcsMerchant.setUpdatedBy(userId); |
| | | mcsMerchant.setAddress(mcsOrder.getAddress()); |
| | | mcsMerchant.setLat(mcsOrder.getLat()); |
| | | mcsMerchant.setLon(mcsOrder.getLon()); |
| | | num = this.baseMapper.insert(mcsMerchant); |
| | | McsMerchantDTO mcsMerchantDTO = new McsMerchantDTO(); |
| | | mcsMerchantDTO.setName(mcsMerchant.getName()); |
| | | userService.putMcsMerchantUser(mcsMerchantDTO); |
| | | } else { |
| | | return R.fail("获取用户信息失败"); |
| | | } |
| | | } else { |
| | | //更新商家 |
| | | Date previousExpireAt = mcsMerchant.getExpireAt(); |
| | | Date nowExpireAt; |
| | | if (isNull(previousExpireAt) || previousExpireAt.before(nowDate)) { |
| | | nowExpireAt = DateUtils.addDay(nowDate, litDays); |
| | | } else { |
| | | nowExpireAt = DateUtils.addDay(previousExpireAt, litDays); |
| | | } |
| | | mcsMerchant.setExpireAt(nowExpireAt); |
| | | mcsMerchant.setUpdatedBy(userId); |
| | | num = this.baseMapper.updateById(mcsMerchant); |
| | | } |
| | | if (num > 0) { |
| | | return R.ok(mcsMerchant.getId()); |
| | | } else { |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 验证码登录 |
| | | * @param loginDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R loginWithPhone(LoginWithPhoneDTO loginDTO) { |
| | | String phone = loginDTO.getPhone(); |
| | | String redisKey = String.join("::", phone, loginDTO.getCode()); |
| | | Boolean hasKey = stringRedisTemplate.hasKey(redisKey); |
| | | if (hasKey) { |
| | | //通过验证 |
| | | R r = userService.getSysUserByPhone(phone, 11); |
| | | if (R.isOk(r)) { |
| | | if (nonNull(r.getData())) { |
| | | //已有用户 |
| | | McsLoginUserInfoVO loginUserInfoVO = JSONObject.parseObject(JSONObject.toJSONString(r.getData()), McsLoginUserInfoVO.class); |
| | | stringRedisTemplate.delete(redisKey); |
| | | return R.ok(loginUserInfoVO); |
| | | } else { |
| | | //自动创建用户 |
| | | McsMerchantDTO mcsMerchantDTO = new McsMerchantDTO(); |
| | | mcsMerchantDTO.setAccount(phone); |
| | | mcsMerchantDTO.setPassword("88888888"); |
| | | mcsMerchantDTO.setAccountStatus(1); |
| | | mcsMerchantDTO.setPhone(phone); |
| | | mcsMerchantDTO.setName("用户" + retrieveRandomCode(5)); |
| | | mcsMerchantDTO.setImageUrl(DEFAULT_IMAGE_URL); |
| | | R addUserResult = userService.addMcsMerchantUser(mcsMerchantDTO); |
| | | if (R.isOk(addUserResult)) { |
| | | McsLoginUserInfoVO loginUserInfoVO = JSONObject.parseObject(JSONObject.toJSONString(addUserResult.getData()), McsLoginUserInfoVO.class); |
| | | loginUserInfoVO.setPlaintextPassword("88888888"); |
| | | stringRedisTemplate.delete(redisKey); |
| | | return R.ok(loginUserInfoVO); |
| | | } |
| | | return addUserResult; |
| | | } |
| | | } |
| | | return r; |
| | | } else { |
| | | return R.fail("验证码错误"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 首页顶部数据 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R getMcsIndexTopData() { |
| | | IndexTopStatisticsVO statisticsVO = this.baseMapper.getMcsIndexTopData(); |
| | | McsGameVO mcsGameVO = mcsGameDAO.selectPopularGame(); |
| | | statisticsVO.setPopularGame(mcsGameVO); |
| | | return R.ok(statisticsVO); |
| | | } |
| | | |
| | | /** |
| | | * H5分页查询数字商业街商家 |
| | | * @param pageMcsMerchantDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R pageH5McsMerchant(PageMcsMerchantDTO pageMcsMerchantDTO) { |
| | | Page page = new Page<>(); |
| | | page.setSize(pageMcsMerchantDTO.getPageSize()); |
| | | page.setCurrent(pageMcsMerchantDTO.getPageNum()); |
| | | IPage<McsMerchantVO> mcsMerchants = this.baseMapper.pageH5McsMerchant(page, pageMcsMerchantDTO); |
| | | return R.ok(mcsMerchants); |
| | | } |
| | | |
| | | /** |
| | | * 修改用戶信息 |
| | | * @param putUserInfoDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R putUserInfo(PutUserInfoDTO putUserInfoDTO) { |
| | | McsMerchant mcsMerchant = this.baseMapper.selectOne(new QueryWrapper<McsMerchant>().lambda().eq(McsMerchant::getUserId, putUserInfoDTO.getUserId())); |
| | | if (nonNull(mcsMerchant)) { |
| | | //修改商家名称 |
| | | mcsMerchant.setLogo(putUserInfoDTO.getImageUrl()); |
| | | mcsMerchant.setName(putUserInfoDTO.getName()); |
| | | this.baseMapper.updateById(mcsMerchant); |
| | | } |
| | | LoginUserInfoVO loginUserInfoVO = new LoginUserInfoVO(); |
| | | loginUserInfoVO.setImageUrl(putUserInfoDTO.getImageUrl()); |
| | | loginUserInfoVO.setName(putUserInfoDTO.getName()); |
| | | loginUserInfoVO.setUserId(putUserInfoDTO.getUserId()); |
| | | userService.putUser(loginUserInfoVO); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 根据userId获取商家信息 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R retrieveMcsMerchantInfoByUserId(Long userId) { |
| | | McsMerchant mcsMerchant = this.baseMapper.selectOne(new QueryWrapper<McsMerchant>().lambda() |
| | | .eq(McsMerchant::getUserId, userId).eq(McsMerchant::getIsDel, false)); |
| | | McsMerchantVO mcsMerchantVO = null; |
| | | if (nonNull(mcsMerchant)) { |
| | | mcsMerchantVO = new McsMerchantVO(); |
| | | BeanUtils.copyProperties(mcsMerchant, mcsMerchantVO); |
| | | } |
| | | return R.ok(mcsMerchantVO); |
| | | } |
| | | |
| | | /** |
| | | * 定时任务-每隔5分钟执行一次,将已到期的微商业街商家旗下所有的游戏/资讯全部下架 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R offResourceForMcsMerchant() { |
| | | int num = 0; |
| | | List<Long> needDealIds = this.baseMapper.selectNeedDealExpiredMerchant(); |
| | | if (nonNull(needDealIds) && !needDealIds.isEmpty()) { |
| | | mcsGameDAO.setOffByMerchantIds(needDealIds); |
| | | mcsInformationDAO.setOffByMerchantIds(needDealIds); |
| | | num = this.baseMapper.updateIsPauseStatus(needDealIds); |
| | | } |
| | | return R.ok("执行任务数:" + num); |
| | | } |
| | | |
| | | private void retrieveMerchantSurplusLitDays(McsMerchantVO merchantVO) { |
| | | Integer publishLimit = merchantVO.getPublishLimit(); |
| | | Integer publishCount = mcsGameDAO.selectPublishCount(merchantVO.getId()); |
| | | Integer idleTotal = publishLimit - publishCount; |
| | | merchantVO.setIdleTotal(idleTotal > 0 ? idleTotal : 0); |
| | | if (nonNull(merchantVO.getExpireAt())) { |
| | | int surplusLitDays = DateUtils.retrieveRemainingDays(merchantVO.getExpireAt()); |
| | | merchantVO.setSurplusLitDays(surplusLitDays > 0 ? surplusLitDays : 0); |
| | | } |
| | | } |
| | | |
| | | private String retrieveRandomCode(int length) { |
| | | Random r = new Random(); |
| | | StringBuilder rs = new StringBuilder(); |
| | | for (int i = 0; i < length; i++) { |
| | | rs.append(r.nextInt(10)); |
| | | } |
| | | return rs.toString(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsOrderVO; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.common.utlis.SmsUtil; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.common.utlis.WxPayUtils; |
| | | import com.panzhihua.service_community.dao.McsMerchantDAO; |
| | | import com.panzhihua.service_community.entity.McsMerchant; |
| | | import com.panzhihua.service_community.entity.McsOrder; |
| | | import com.panzhihua.service_community.dao.McsOrderDao; |
| | | import com.panzhihua.service_community.service.McsMerchantService; |
| | | import com.panzhihua.service_community.service.McsOrderService; |
| | | import com.panzhihua.service_community.util.QRCodeUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.amqp.rabbit.core.RabbitTemplate; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | import static java.util.Objects.nonNull; |
| | | |
| | | /** |
| | | * 商业街订单表(McsOrder)表服务实现类 |
| | | * |
| | | * @author makejava |
| | | * @since 2022-01-04 16:10:07 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class McsOrderServiceImpl extends ServiceImpl<McsOrderDao, McsOrder> implements McsOrderService { |
| | | @Value("${min.app.isTest}") |
| | | private Boolean isTest; |
| | | @Value("${min.app.appid}") |
| | | private String appid; |
| | | @Value("${min.app.payKey}") |
| | | private String payKey; |
| | | @Value("${min.app.mchId}") |
| | | private String mchId; |
| | | @Value("${mcs.notifyUrl}") |
| | | private String notifyUrl; |
| | | @Resource |
| | | private RabbitTemplate rabbitTemplate; |
| | | @Resource |
| | | private McsMerchantService mcsMerchantService; |
| | | @Resource |
| | | private McsMerchantDAO mcsMerchantDAO; |
| | | |
| | | private static String H5_LOGIN_APPID="wx475fcd33c8030df8"; |
| | | @Override |
| | | public R pageList(CommonPage commonPage) { |
| | | return R.ok(this.baseMapper.pageList(new Page(commonPage.getPage(),commonPage.getSize()),commonPage)); |
| | | } |
| | | |
| | | @Override |
| | | public R insert(McsOrderVO mcsOrderVO) { |
| | | McsMerchant mcsMerchant = mcsMerchantDAO.selectOne(new QueryWrapper<McsMerchant>().lambda() |
| | | .eq(McsMerchant::getUserId, mcsOrderVO.getUserId())); |
| | | McsOrder mcsOrder=new McsOrder(); |
| | | BeanUtils.copyProperties(mcsOrderVO,mcsOrder); |
| | | if (nonNull(mcsMerchant)) { |
| | | if (mcsMerchant.getIsDel()) { |
| | | mcsMerchantDAO.deleteById(mcsMerchant.getId()); |
| | | } else { |
| | | mcsOrder.setMerchantId(mcsMerchant.getId()); |
| | | } |
| | | } |
| | | mcsOrder.setStatus(0); |
| | | mcsOrder.setCreateTime(new Date()); |
| | | mcsOrder.setOrderNo(DateUtils.getCurrentDateStrNoSignal()); |
| | | this.baseMapper.insert(mcsOrder); |
| | | rabbitTemplate.convertAndSend("mcsOrder.exchange", "mcsOrder.key", mcsOrder, message -> { |
| | | message.getMessageProperties().setHeader("x-delay", 1000 * 1800); |
| | | return message; |
| | | }); |
| | | return R.ok(mcsOrder); |
| | | } |
| | | |
| | | @Override |
| | | public R detail(Long id) { |
| | | McsOrderVO detail = this.baseMapper.detail(id); |
| | | Date cancelAt = DateUtils.addMinutes(detail.getCreateTime(), 30); |
| | | Date nowDate = new Date(); |
| | | detail.setCancelCountdown(cancelAt.getTime() - nowDate.getTime()); |
| | | return R.ok(detail); |
| | | } |
| | | |
| | | @Override |
| | | public R wxPay(McsOrderVO mcsOrderVO) { |
| | | McsOrder mcsOrder=this.baseMapper.selectById(mcsOrderVO.getId()); |
| | | if(mcsOrder!=null&&mcsOrder.getStatus()==0){ |
| | | try { |
| | | BigDecimal money = mcsOrder.getMoney(); |
| | | if (isTest) { |
| | | money = BigDecimal.valueOf(0.01); |
| | | } |
| | | // 调用wx支付 |
| | | String realAppId=appid; |
| | | if(mcsOrderVO.getTradeType().equals("JSAPI")){ |
| | | realAppId=H5_LOGIN_APPID; |
| | | } |
| | | String result = WxPayUtils.h5pay(realAppId, mchId, payKey, notifyUrl, "点亮支付", mcsOrderVO.getOpenId(), |
| | | mcsOrder.getOrderNo(), money,mcsOrderVO.getTradeType(), mcsOrderVO.getClientIp()); |
| | | if (mcsOrderVO.getTradeType().equals("NATIVE")) { |
| | | JSONObject jsonObjectResult = JSONObject.parseObject(result); |
| | | result = QRCodeUtil.getBase64QRCode(jsonObjectResult.get("codeUrl").toString()); |
| | | } |
| | | return R.ok(result); |
| | | } catch (Exception e) { |
| | | log.error("调用微信支付异常,异常原因:" + e.getMessage()); |
| | | } |
| | | } |
| | | return R.fail("订单状态异常"); |
| | | } |
| | | |
| | | @Override |
| | | public R sendContent(Long id) { |
| | | String phone=this.baseMapper.selectPhone(id); |
| | | if(StringUtils.isNotEmpty(phone)){ |
| | | SmsUtil smsUtil=new SmsUtil(); |
| | | int result=smsUtil.sendContent(phone); |
| | | if(result>0){ |
| | | return R.ok(); |
| | | } |
| | | } |
| | | return R.fail("短信发送异常"); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public R notify(McsOrderVO mcsOrderVO) { |
| | | McsOrder mcsOrderBase=this.baseMapper.selectOne(new QueryWrapper<McsOrder>().lambda().eq(McsOrder::getOrderNo,mcsOrderVO.getOrderNo())); |
| | | mcsOrderBase.setStatus(1); |
| | | mcsOrderBase.setPayNo(mcsOrderVO.getPayNo()); |
| | | mcsOrderBase.setPayTime(mcsOrderVO.getPayTime()); |
| | | mcsOrderBase.setPaymentMethod("微信支付"); |
| | | int i=this.baseMapper.updateById(mcsOrderBase); |
| | | if(i>0){ |
| | | R r = mcsMerchantService.updateOrAddMcsMerchantAfterOrder(mcsOrderBase.getOrderNo(), mcsOrderBase.getConfigId(), mcsOrderBase.getUserId()); |
| | | if (R.isOk(r) && nonNull(r.getData())) { |
| | | mcsOrderBase.setMerchantId(JSONObject.parseObject(JSONObject.toJSONString(r.getData()), Long.class)); |
| | | this.baseMapper.updateById(mcsOrderBase); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.service_community.dao.McsProductLabelDAO; |
| | | import com.panzhihua.service_community.entity.McsProductLabel; |
| | | import com.panzhihua.service_community.service.McsProductLabelService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * (McsProductLabel)表服务实现类 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-28 14:37:13 |
| | | */ |
| | | @Service("mcsProductLabelService") |
| | | public class McsProductLabelServiceImpl extends ServiceImpl<McsProductLabelDAO, McsProductLabel> |
| | | implements McsProductLabelService { |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.DeleteProductDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsProductDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsProductDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetShelfForProductDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsProductVO; |
| | | import com.panzhihua.common.utlis.Snowflake; |
| | | import com.panzhihua.service_community.dao.McsLabelDAO; |
| | | import com.panzhihua.service_community.dao.McsMerchantDAO; |
| | | import com.panzhihua.service_community.dao.McsProductDAO; |
| | | import com.panzhihua.service_community.dao.McsProductLabelDAO; |
| | | import com.panzhihua.service_community.entity.McsLabel; |
| | | import com.panzhihua.service_community.entity.McsMerchant; |
| | | import com.panzhihua.service_community.entity.McsProduct; |
| | | import com.panzhihua.service_community.entity.McsProductLabel; |
| | | import com.panzhihua.service_community.service.McsProductService; |
| | | |
| | | /** |
| | | * (McsProduct)表服务实现类 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-28 14:37:12 |
| | | */ |
| | | @Service("mcsProductService") |
| | | public class McsProductServiceImpl extends ServiceImpl<McsProductDAO, McsProduct> implements McsProductService { |
| | | |
| | | @Resource |
| | | private McsMerchantDAO mcsMerchantDAO; |
| | | @Resource |
| | | private McsLabelDAO mcsLabelDAO; |
| | | @Resource |
| | | private McsProductLabelDAO mcsProductLabelDAO; |
| | | |
| | | /** |
| | | * 新增产品信息 |
| | | * @param mcsProductDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R addMcsProduct(McsProductDTO mcsProductDTO) { |
| | | Long userId = mcsProductDTO.getCreatedBy(); |
| | | McsMerchant mcsMerchant = mcsMerchantDAO.selectOne(new QueryWrapper<McsMerchant>().lambda().eq(McsMerchant::getUserId, userId)); |
| | | if (isNull(mcsMerchant)) { |
| | | return R.fail("商家信息不存在"); |
| | | } |
| | | McsProduct mcsProduct = new McsProduct(); |
| | | BeanUtils.copyProperties(mcsProductDTO, mcsProduct); |
| | | mcsProduct.setMerchantId(mcsMerchant.getId()); |
| | | mcsProduct.setStatus(McsProduct.Status.yxj); |
| | | mcsProduct.setId(Snowflake.getId()); |
| | | int num = this.baseMapper.insert(mcsProduct); |
| | | if (num > 0) { |
| | | List<Long> labelIds = mcsProductDTO.getLabelIds(); |
| | | if (nonNull(labelIds) && !labelIds.isEmpty()) { |
| | | List<McsLabel> mcsLabels = mcsLabelDAO.selectBatchIds(labelIds); |
| | | if (nonNull(mcsLabels) && !mcsLabels.isEmpty()) { |
| | | List<McsProductLabel> mcsProductLabelList = new ArrayList<>(); |
| | | mcsLabels.forEach(e -> { |
| | | McsProductLabel productLabel = new McsProductLabel(); |
| | | productLabel.setLabelId(e.getId()); |
| | | productLabel.setProductId(mcsProduct.getId()); |
| | | productLabel.setLabelName(e.getName()); |
| | | mcsProductLabelList.add(productLabel); |
| | | }); |
| | | mcsProductLabelDAO.insertBatch(mcsProductLabelList); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | return R.fail("新增失败,请重新尝试"); |
| | | } |
| | | |
| | | /** |
| | | * 编辑产品信息 |
| | | * @param mcsProductDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R putMcsProduct(McsProductDTO mcsProductDTO) { |
| | | McsProduct mcsProduct = this.baseMapper.selectById(mcsProductDTO.getId()); |
| | | if (isNull(mcsProduct)) { |
| | | return R.fail("资源不存在"); |
| | | } |
| | | BeanUtils.copyProperties(mcsProductDTO, mcsProduct); |
| | | int num = this.baseMapper.updateById(mcsProduct); |
| | | if (num > 0) { |
| | | List<Long> labelIds = mcsProductDTO.getLabelIds(); |
| | | mcsProductLabelDAO.delete(new QueryWrapper<McsProductLabel>().lambda().eq(McsProductLabel::getProductId, mcsProduct.getId())); |
| | | if (nonNull(labelIds) && !labelIds.isEmpty()) { |
| | | List<McsLabel> mcsLabels = mcsLabelDAO.selectBatchIds(labelIds); |
| | | if (nonNull(mcsLabels) && !mcsLabels.isEmpty()) { |
| | | List<McsProductLabel> mcsProductLabelList = new ArrayList<>(); |
| | | mcsLabels.forEach(e -> { |
| | | McsProductLabel productLabel = new McsProductLabel(); |
| | | productLabel.setLabelId(e.getId()); |
| | | productLabel.setProductId(mcsProduct.getId()); |
| | | productLabel.setLabelName(e.getName()); |
| | | mcsProductLabelList.add(productLabel); |
| | | }); |
| | | mcsProductLabelDAO.insertBatch(mcsProductLabelList); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | return R.fail("编辑失败,请重新尝试"); |
| | | } |
| | | |
| | | /** |
| | | * 删除产品信息 |
| | | * @param deleteProductDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R deleteMcsProduct(DeleteProductDTO deleteProductDTO) { |
| | | List<McsProduct> mcsProducts = this.baseMapper.selectBatchIds(deleteProductDTO.getProductIds()); |
| | | if (nonNull(mcsProducts) && !mcsProducts.isEmpty()) { |
| | | mcsProducts.forEach(e -> { |
| | | e.setIsDel(true); |
| | | e.setUpdatedBy(deleteProductDTO.getUpdatedBy()); |
| | | }); |
| | | this.updateBatchById(mcsProducts); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 上架/下架产品信息 |
| | | * @param setShelfForProductDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R setShelfForMcsProduct(SetShelfForProductDTO setShelfForProductDTO) { |
| | | Integer type = setShelfForProductDTO.getType(); |
| | | List<McsProduct> mcsProducts = this.baseMapper.selectBatchIds(setShelfForProductDTO.getProductIds()); |
| | | if (nonNull(mcsProducts) && !mcsProducts.isEmpty()) { |
| | | if (type.equals(1)) { |
| | | //上架 |
| | | mcsProducts.forEach(e -> { |
| | | e.setStatus(McsProduct.Status.sjz); |
| | | e.setUpdatedBy(setShelfForProductDTO.getUpdatedBy()); |
| | | }); |
| | | } else if (type.equals(2)) { |
| | | //下架 |
| | | mcsProducts.forEach(e -> { |
| | | e.setStatus(McsProduct.Status.yxj); |
| | | e.setUpdatedBy(setShelfForProductDTO.getUpdatedBy()); |
| | | }); |
| | | } else { |
| | | return R.fail("未知错误"); |
| | | } |
| | | this.updateBatchById(mcsProducts); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询产品信息 |
| | | * @param pageMcsProductDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R pageMcsProduct(PageMcsProductDTO pageMcsProductDTO) { |
| | | Page page = new Page<>(); |
| | | page.setSize(pageMcsProductDTO.getPageSize()); |
| | | page.setCurrent(pageMcsProductDTO.getPageNum()); |
| | | IPage<McsProductVO> mcsProduct = this.baseMapper.pageMcsProduct(page, pageMcsProductDTO); |
| | | return R.ok(mcsProduct); |
| | | } |
| | | |
| | | /** |
| | | * 获取产品信息详情 |
| | | * @param productId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R getMcsProduct(Long productId) { |
| | | McsProduct mcsProduct = this.baseMapper.selectById(productId); |
| | | if (isNull(mcsProduct)) { |
| | | return R.fail("资源不存在"); |
| | | } |
| | | McsProductVO mcsProductVO = new McsProductVO(); |
| | | BeanUtils.copyProperties(mcsProduct, mcsProductVO); |
| | | List<McsProductLabel> mcsProductLabelList = mcsProductLabelDAO.selectList(new QueryWrapper<McsProductLabel>().lambda() |
| | | .eq(McsProductLabel::getProductId, productId)); |
| | | if (nonNull(mcsProductLabelList) && !mcsProductLabelList.isEmpty()) { |
| | | List<Long> labelIds = mcsProductLabelList.stream().map(McsProductLabel::getLabelId).collect(Collectors.toList()); |
| | | mcsProductVO.setLabelIds(labelIds); |
| | | } |
| | | return R.ok(mcsProductVO); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageVerifyRecordDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsCouponVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsVerifyRecordVO; |
| | | import com.panzhihua.service_community.dao.McsVerifiedRecordDAO; |
| | | import com.panzhihua.service_community.entity.McsVerifiedRecord; |
| | | import com.panzhihua.service_community.service.McsVerifiedRecordService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * (McsVerifiedRecord)表服务实现类 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-12-28 14:37:14 |
| | | */ |
| | | @Service("mcsVerifiedRecordService") |
| | | public class McsVerifiedRecordServiceImpl extends ServiceImpl<McsVerifiedRecordDAO, McsVerifiedRecord> |
| | | implements McsVerifiedRecordService { |
| | | |
| | | /** |
| | | * 分页查询核销记录 |
| | | * @param pageVerifyRecordDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R pageMcsVerifyRecord(PageVerifyRecordDTO pageVerifyRecordDTO) { |
| | | Page page = new Page<>(); |
| | | page.setSize(pageVerifyRecordDTO.getPageSize()); |
| | | page.setCurrent(pageVerifyRecordDTO.getPageNum()); |
| | | IPage<McsVerifyRecordVO> verifyRecords = this.baseMapper.pageMcsVerifyRecord(page, pageVerifyRecordDTO); |
| | | return R.ok(verifyRecords); |
| | | } |
| | | } |
| | |
| | | </select> |
| | | |
| | | <select id="export" resultType="com.panzhihua.common.model.vos.community.ComActQuestnaireAnswerContentVO"> |
| | | select ac.*,t.nick_name from ( SELECT |
| | | qs.type as optionType,ac.*,ac.create_at as `time` |
| | | FROM |
| | | com_act_reserve_record carr |
| | | LEFT JOIN com_act_reserve qn ON carr.reserve_id = qn.id |
| | | LEFT JOIN com_act_reserve_sub qs ON carr.reserve_id = qs.reserve_id |
| | | LEFT JOIN com_act_reserve_answer_content ac ON qs.id = ac.reserve_sub_id |
| | | WHERE |
| | | carr.id in ( |
| | | SELECT distinct |
| | | select ac.*,ac.create_at as time,u.nick_name,cars.type as optionType from com_act_reserve_record carr |
| | | left join com_act_reserve_answer_content ac on ac.reserve_record_id = carr.id |
| | | left join sys_user u on carr.user_id = u.user_id |
| | | left join com_act_reserve_sub cars on ac.reserve_sub_id = cars.id |
| | | where carr.reserve_id = #{detailedAdminDTO.reserveId} and ac.reserve_record_id in ( SELECT DISTINCT |
| | | carr.id |
| | | FROM |
| | | com_act_reserve_record carr |
| | | LEFT JOIN com_act_reserve qn ON carr.reserve_id = qn.id |
| | | LEFT JOIN sys_user su ON carr.user_id = su.user_id |
| | | LEFT JOIN com_act_reserve_sub qs ON carr.id = qs.reserve_id |
| | | LEFT JOIN com_act_reserve_answer_content ac ON carr.id = ac.reserve_record_id |
| | | where qn.id =#{detailedAdminDTO.reserveId} |
| | | WHERE |
| | | carr.reserve_id =#{detailedAdminDTO.reserveId} |
| | | <if test='detailedAdminDTO.startTime != null and detailedAdminDTO.startTime != ""'> |
| | | AND carr.create_at <![CDATA[ >= ]]> #{detailedAdminDTO.startTime} |
| | | </if> |
| | |
| | | </if> |
| | | <if test="detailedAdminDTO.keyword!=null and detailedAdminDTO.keyword != """> |
| | | AND ac.answer_content like concat ('%',#{detailedAdminDTO.keyword},'%') |
| | | </if> |
| | | )and ac.reserve_record_id in (select distinct reserve_record_id from com_act_reserve_answer_content where answer_content like concat('%',#{detailedAdminDTO.keyword},'%') |
| | | <if test='detailedAdminDTO.startTime != null and detailedAdminDTO.startTime != ""'> |
| | | AND create_at <![CDATA[ >= ]]> #{detailedAdminDTO.startTime} |
| | | </if> |
| | | <if test='detailedAdminDTO.endTime != null and detailedAdminDTO.endTime != ""'> |
| | | AND create_at <![CDATA[ <= ]]> #{detailedAdminDTO.endTime} |
| | | </if> |
| | | <if test='detailedAdminDTO.beginTime != null and detailedAdminDTO.beginTime != ""'> |
| | | AND STR_TO_DATE(answer_content,'%Y-%m-%d %H:%i:%s') <![CDATA[ >= ]]> #{detailedAdminDTO.beginTime} |
| | | </if> |
| | | <if test='detailedAdminDTO.stopTime != null and detailedAdminDTO.stopTime != ""'> |
| | | AND STR_TO_DATE(answer_content,'%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> #{detailedAdminDTO.stopTime} |
| | | </if> |
| | | ) |
| | | GROUP BY ac.id ) ac left join sys_user t on ac.user_id = t.user_id |
| | | order by ac.reserve_record_id desc,ac.id asc |
| | | </if>) |
| | | order by ac.reserve_record_id DESC,ac.id ASC |
| | | </select> |
| | | <select id="pageRegisterHomeQuarantine" resultType="java.lang.String"> |
| | | SELECT answer_content FROM ( |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_community.dao.McsConfigDAO"> |
| | | |
| | | <resultMap type="com.panzhihua.service_community.entity.McsConfig" id="McsConfigMap"> |
| | | <result property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="name" column="name" jdbcType="VARCHAR"/> |
| | | <result property="key" column="key" jdbcType="VARCHAR"/> |
| | | <result property="value" column="value" jdbcType="VARCHAR"/> |
| | | <result property="createdAt" column="created_at" jdbcType="TIMESTAMP"/> |
| | | <result property="createdBy" column="created_by" jdbcType="INTEGER"/> |
| | | <result property="updatedAt" column="updated_at" jdbcType="TIMESTAMP"/> |
| | | <result property="updatedBy" column="updated_by" jdbcType="INTEGER"/> |
| | | </resultMap> |
| | | |
| | | <!-- 批量插入 --> |
| | | <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true"> |
| | | insert into smart_life.mcs_config(name, key, value, created_at, created_by, updated_at, updated_by) |
| | | values |
| | | <foreach collection="entities" item="entity" separator=","> |
| | | (#{entity.name}, #{entity.key}, #{entity.value}, #{entity.createdAt}, #{entity.createdBy}, |
| | | #{entity.updatedAt}, #{entity.updatedBy}) |
| | | </foreach> |
| | | </insert> |
| | | <!-- 批量插入或按主键更新 --> |
| | | <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true"> |
| | | insert into smart_life.mcs_config(name, key, value, created_at, created_by, updated_at, updated_by) |
| | | values |
| | | <foreach collection="entities" item="entity" separator=","> |
| | | (#{entity.name}, #{entity.key}, #{entity.value}, #{entity.createdAt}, #{entity.createdBy}, |
| | | #{entity.updatedAt}, #{entity.updatedBy}) |
| | | </foreach> |
| | | on duplicate key update |
| | | name = values(name) , key = values(key) , value = values(value) , created_at = values(created_at) , created_by = |
| | | values(created_by) , updated_at = values(updated_at) , updated_by = values(updated_by) |
| | | </insert> |
| | | |
| | | </mapper> |
| | | |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_community.dao.McsCouponDAO"> |
| | | |
| | | <resultMap type="com.panzhihua.service_community.entity.McsCoupon" id="McsCouponMap"> |
| | | <result property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="gameId" column="game_id" jdbcType="INTEGER"/> |
| | | <result property="userId" column="user_id" jdbcType="INTEGER"/> |
| | | <result property="qrCode" column="qr_code" jdbcType="VARCHAR"/> |
| | | <result property="coin" column="coin" jdbcType="INTEGER"/> |
| | | <result property="award" column="award" jdbcType="VARCHAR"/> |
| | | <result property="isVerified" column="is_verified" jdbcType="VARCHAR"/> |
| | | <result property="createdAt" column="created_at" jdbcType="TIMESTAMP"/> |
| | | <result property="updatedAt" column="updated_at" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | |
| | | <!-- 批量插入 --> |
| | | <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true"> |
| | | insert into smart_life.mcs_coupon(game_id, user_id, qr_code, is_verified, created_at, updated_at) |
| | | values |
| | | <foreach collection="entities" item="entity" separator=","> |
| | | (#{entity.gameId}, #{entity.userId}, #{entity.qrCode}, #{entity.isVerified}, #{entity.createdAt}, |
| | | #{entity.updatedAt}) |
| | | </foreach> |
| | | </insert> |
| | | <!-- 批量插入或按主键更新 --> |
| | | <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true"> |
| | | insert into smart_life.mcs_coupon(game_id, user_id, qr_code, is_verified, created_at, updated_at) |
| | | values |
| | | <foreach collection="entities" item="entity" separator=","> |
| | | (#{entity.gameId}, #{entity.userId}, #{entity.qrCode}, #{entity.isVerified}, #{entity.createdAt}, |
| | | #{entity.updatedAt}) |
| | | </foreach> |
| | | on duplicate key update |
| | | game_id = values(game_id) , user_id = values(user_id) , qr_code = values(qr_code) , is_verified = |
| | | values(is_verified) , created_at = values(created_at) , updated_at = values(updated_at) |
| | | </insert> |
| | | <select id="getMyCouponData" |
| | | resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.MyCouponVO"> |
| | | SELECT |
| | | (SELECT IF(SUM(coin) IS NULL,0,SUM(coin)) FROM mcs_coupon WHERE user_id = #{userId}) AS obtainedTotal, |
| | | (SELECT COUNT(t1.id) FROM mcs_coupon t1 LEFT JOIN mcs_game t2 ON t1.game_id = t2.id WHERE t1.user_id = #{userId} AND t1.is_verified = 1 AND t2.type = 2) AS trialTotal, |
| | | (SELECT COUNT(id) FROM mcs_coupon WHERE user_id = #{userId} AND is_verified = 1) AS joinGameTotal, |
| | | (SELECT COUNT(id) FROM mcs_coupon WHERE user_id = #{userId} AND is_verified = 0) AS unVerifiedTotal |
| | | </select> |
| | | <select id="getCouponList" |
| | | resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsCouponVO"> |
| | | SELECT t1.*, t2.type, t2.`name`, t2.expire_at |
| | | FROM mcs_coupon t1 |
| | | LEFT JOIN mcs_game t2 ON t1.game_id = t2.id |
| | | WHERE t1.user_id = #{userId} |
| | | <if test="type != null"> |
| | | AND t2.type = #{type} |
| | | </if> |
| | | </select> |
| | | <select id="pageJoinGameList" |
| | | resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsCouponVO"> |
| | | SELECT t1.*, t2.type, t2.`name`, t2.expire_at, t2.cover, t2.id AS gameId, t2.award_type, t2.allocation, |
| | | IF(t3.id IS NULL,2,1) AS isEvaluate, t3.id AS evaluateId |
| | | FROM mcs_coupon t1 |
| | | LEFT JOIN mcs_game t2 ON t1.game_id = t2.id |
| | | LEFT JOIN mcs_evaluate t3 ON t1.id = t3.coupon_id |
| | | WHERE t1.user_id = #{pageJoinGameListDTO.userId} AND t1.is_verified = 1 |
| | | <if test="pageJoinGameListDTO.keyword != null and pageJoinGameListDTO.keyword != """> |
| | | AND t2.`name` LIKE CONCAT(#{pageJoinGameListDTO.keyword}, '%') |
| | | </if> |
| | | </select> |
| | | <select id="getMcsGameStatistics" |
| | | resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.GameStatisticsVO"> |
| | | SELECT gameTotal, sendCouponTotal, |
| | | IF(ROUND((sendCouponTotal - unAppliedTotal)/sendCouponTotal * 100,2) IS NULL,0,ROUND((sendCouponTotal - unAppliedTotal)/sendCouponTotal * 100,2))AS appliedPercent, |
| | | IF(ROUND(unAppliedTotal/sendCouponTotal * 100,2) IS NULL,0,ROUND(unAppliedTotal/sendCouponTotal * 100,2)) AS unAppliedPercent, |
| | | IF(ROUND(verifiedTotal/(sendCouponTotal - unAppliedTotal) * 100,2) IS NULL,0,ROUND(verifiedTotal/(sendCouponTotal - unAppliedTotal) * 100,2)) AS verifiedPercent, |
| | | IF(ROUND((sendCouponTotal - unAppliedTotal - verifiedTotal)/(sendCouponTotal - unAppliedTotal) * 100,2) IS NULL,0,ROUND((sendCouponTotal - unAppliedTotal - verifiedTotal)/(sendCouponTotal - unAppliedTotal) * 100,2)) AS unVerifiedPercent |
| | | FROM( |
| | | SELECT |
| | | (SELECT COUNT(t1.id) FROM mcs_game t1 LEFT JOIN mcs_merchant t2 ON t1.merchant_id = t2.id WHERE t1.`status` != 1 AND t1.is_del = 0 AND t2.user_id = #{userId}) AS gameTotal, |
| | | (SELECT IF(SUM(coupons) IS NULL,0,SUM(coupons)) FROM mcs_game t1 LEFT JOIN mcs_merchant t2 ON t1.merchant_id = t2.id WHERE t1.`status` != 1 AND t1.is_del = 0 AND t2.user_id = #{userId}) AS sendCouponTotal, |
| | | (SELECT IF(SUM(surplus_coupons) IS NULL,0,SUM(surplus_coupons)) FROM mcs_game t1 LEFT JOIN mcs_merchant t2 ON t1.merchant_id = t2.id WHERE t1.`status` != 1 AND t1.is_del = 0 AND t2.user_id = #{userId}) AS unAppliedTotal, |
| | | (SELECT COUNT(t1.id) FROM mcs_verified_record t1 LEFT JOIN mcs_merchant t2 ON t1.merchant_id = t2.id LEFT JOIN mcs_game t3 ON t1.game_id = t3.id WHERE t3.is_del = 0 AND t2.user_id = #{userId}) AS verifiedTotal |
| | | ) temp |
| | | </select> |
| | | |
| | | </mapper> |
| | | |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_community.dao.McsEvaluateDAO"> |
| | | |
| | | <resultMap type="com.panzhihua.service_community.entity.McsEvaluate" id="McsEvaluateMap"> |
| | | <result property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="couponId" column="coupon_id" jdbcType="INTEGER"/> |
| | | <result property="gameId" column="game_id" jdbcType="INTEGER"/> |
| | | <result property="userId" column="user_id" jdbcType="INTEGER"/> |
| | | <result property="star" column="star" jdbcType="INTEGER"/> |
| | | <result property="content" column="content" jdbcType="VARCHAR"/> |
| | | <result property="photos" column="photos" jdbcType="VARCHAR"/> |
| | | <result property="createdAt" column="created_at" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | |
| | | <!-- 批量插入 --> |
| | | <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true"> |
| | | insert into smart_life.mcs_evaluate(coupon_id, star, content, photos, created_at) |
| | | values |
| | | <foreach collection="entities" item="entity" separator=","> |
| | | (#{entity.couponId}, #{entity.star}, #{entity.content}, #{entity.photos}, #{entity.createdAt}) |
| | | </foreach> |
| | | </insert> |
| | | <!-- 批量插入或按主键更新 --> |
| | | <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true"> |
| | | insert into smart_life.mcs_evaluate(coupon_id, star, content, photos, created_at) |
| | | values |
| | | <foreach collection="entities" item="entity" separator=","> |
| | | (#{entity.couponId}, #{entity.star}, #{entity.content}, #{entity.photos}, #{entity.createdAt}) |
| | | </foreach> |
| | | on duplicate key update |
| | | coupon_id = values(coupon_id) , star = values(star) , content = values(content) , photos = values(photos) , |
| | | created_at = values(created_at) |
| | | </insert> |
| | | <select id="pageMcsEvaluate" |
| | | resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsEvaluateVO"> |
| | | SELECT t1.id, t1.star, t1.content, t1.photos, t1.created_at, t3.`name` AS nickName, t3.phone, t3.image_url, t2.`name` AS gameName |
| | | FROM mcs_evaluate t1 |
| | | LEFT JOIN mcs_game t2 ON t1.game_id = t2.id |
| | | LEFT JOIN sys_user t3 ON t1.user_id = t3.user_id |
| | | WHERE 1=1 |
| | | <if test="pageMcsEvaluateDTO.gameId != null"> |
| | | AND t1.game_id = #{pageMcsEvaluateDTO.gameId} |
| | | </if> |
| | | <if test="pageMcsEvaluateDTO.isMy != null and pageMcsEvaluateDTO.isMy == 1"> |
| | | AND t1.user_id = #{pageMcsEvaluateDTO.userId} |
| | | </if> |
| | | <if test="pageMcsEvaluateDTO.keyword != null and pageMcsEvaluateDTO.keyword != """> |
| | | AND ( |
| | | t3.`name` LIKE CONCAT(#{pageMcsEvaluateDTO.keyword}, '%') |
| | | OR t3.phone LIKE CONCAT(#{pageMcsEvaluateDTO.keyword}, '%') |
| | | ) |
| | | </if> |
| | | </select> |
| | | <select id="getMcsEvaluate" |
| | | resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsEvaluateVO"> |
| | | SELECT t1.id, t1.star, t1.content, t1.photos, t1.created_at, t3.`name` AS nickName, t3.phone, t2.`name` AS gameName |
| | | FROM mcs_evaluate t1 |
| | | LEFT JOIN mcs_game t2 ON t1.game_id = t2.id |
| | | LEFT JOIN sys_user t3 ON t1.user_id = t3.user_id |
| | | WHERE t1.id = #{evaluateId} |
| | | </select> |
| | | |
| | | </mapper> |
| | | |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_community.dao.McsGameDAO"> |
| | | |
| | | <resultMap type="com.panzhihua.service_community.entity.McsGame" id="McsGameMap"> |
| | | <result property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="name" column="name" jdbcType="VARCHAR"/> |
| | | <result property="coupons" column="coupons" jdbcType="INTEGER"/> |
| | | <result property="surplusCoupons" column="surplus_coupons" jdbcType="INTEGER"/> |
| | | <result property="type" column="type" jdbcType="INTEGER"/> |
| | | <result property="awardType" column="award_type" jdbcType="INTEGER"/> |
| | | <result property="allocation" column="allocation" jdbcType="INTEGER"/> |
| | | <result property="coins" column="coins" jdbcType="INTEGER"/> |
| | | <result property="surplusCoins" column="surplus_coins" jdbcType="INTEGER"/> |
| | | <result property="address" column="address" jdbcType="VARCHAR"/> |
| | | <result property="lat" column="lat" jdbcType="VARCHAR"/> |
| | | <result property="lon" column="lon" jdbcType="VARCHAR"/> |
| | | <result property="expireAt" column="expire_at" jdbcType="TIMESTAMP"/> |
| | | <result property="cover" column="cover" jdbcType="VARCHAR"/> |
| | | <result property="otherImages" column="other_images" jdbcType="VARCHAR"/> |
| | | <result property="introduction" column="introduction" jdbcType="VARCHAR"/> |
| | | <result property="status" column="status" jdbcType="INTEGER"/> |
| | | <result property="isPopular" column="is_popular" jdbcType="VARCHAR"/> |
| | | <result property="publishAt" column="publish_at" jdbcType="TIMESTAMP"/> |
| | | <result property="isDel" column="is_del" jdbcType="VARCHAR"/> |
| | | <result property="merchantId" column="merchant_id" jdbcType="INTEGER"/> |
| | | <result property="createdAt" column="created_at" jdbcType="TIMESTAMP"/> |
| | | <result property="createdBy" column="created_by" jdbcType="INTEGER"/> |
| | | <result property="updatedAt" column="updated_at" jdbcType="TIMESTAMP"/> |
| | | <result property="updatedBy" column="updated_by" jdbcType="INTEGER"/> |
| | | </resultMap> |
| | | |
| | | <!-- 批量插入 --> |
| | | <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true"> |
| | | insert into smart_life.mcs_game(name, coupons, surplus_coupons, type, award_type, allocation, coins, address, |
| | | lat, lon, expire_at, cover, other_images, introduction, status, publish_at, is_del, merchant_id, created_at, |
| | | created_by, updated_at, updated_by) |
| | | values |
| | | <foreach collection="entities" item="entity" separator=","> |
| | | (#{entity.name}, #{entity.coupons}, #{entity.surplusCoupons}, #{entity.type}, #{entity.awardType}, |
| | | #{entity.allocation}, #{entity.coins}, #{entity.address}, #{entity.lat}, #{entity.lon}, #{entity.expireAt}, |
| | | #{entity.cover}, #{entity.otherImages}, #{entity.introduction}, #{entity.status}, #{entity.publishAt}, |
| | | #{entity.isDel}, #{entity.merchantId}, #{entity.createdAt}, #{entity.createdBy}, #{entity.updatedAt}, |
| | | #{entity.updatedBy}) |
| | | </foreach> |
| | | </insert> |
| | | <!-- 批量插入或按主键更新 --> |
| | | <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true"> |
| | | insert into smart_life.mcs_game(name, coupons, surplus_coupons, type, award_type, allocation, coins, address, |
| | | lat, lon, expire_at, cover, other_images, introduction, status, publish_at, is_del, merchant_id, created_at, |
| | | created_by, updated_at, updated_by) |
| | | values |
| | | <foreach collection="entities" item="entity" separator=","> |
| | | (#{entity.name}, #{entity.coupons}, #{entity.surplusCoupons}, #{entity.type}, #{entity.awardType}, |
| | | #{entity.allocation}, #{entity.coins}, #{entity.address}, #{entity.lat}, #{entity.lon}, #{entity.expireAt}, |
| | | #{entity.cover}, #{entity.otherImages}, #{entity.introduction}, #{entity.status}, #{entity.publishAt}, |
| | | #{entity.isDel}, #{entity.merchantId}, #{entity.createdAt}, #{entity.createdBy}, #{entity.updatedAt}, |
| | | #{entity.updatedBy}) |
| | | </foreach> |
| | | on duplicate key update |
| | | name = values(name) , coupons = values(coupons) , surplus_coupons = values(surplus_coupons) , type = |
| | | values(type) , award_type = values(award_type) , allocation = values(allocation) , coins = values(coins) , |
| | | address = values(address) , lat = values(lat) , lon = values(lon) , expire_at = values(expire_at) , cover = |
| | | values(cover) , other_images = values(other_images) , introduction = values(introduction) , status = |
| | | values(status) , publish_at = values(publish_at) , is_del = values(is_del) , merchant_id = values(merchant_id) , |
| | | created_at = values(created_at) , created_by = values(created_by) , updated_at = values(updated_at) , updated_by |
| | | = values(updated_by) |
| | | </insert> |
| | | <update id="setOffByMerchantIds"> |
| | | UPDATE mcs_game SET `status` = 3 WHERE merchant_id IN |
| | | <foreach collection="needDealIds" index="index" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </update> |
| | | <select id="pageMcsGame" |
| | | resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsGameVO"> |
| | | (SELECT t1.id, t1.`name`, t1.`type`, t1.coupons, t1.surplus_coupons, |
| | | t1.publish_at, t1.`status`, t1.merchant_id, t2.`name` AS merchantName, t1.is_popular, t1.cover |
| | | FROM mcs_game t1 |
| | | LEFT JOIN mcs_merchant t2 ON t1.merchant_id = t2.id |
| | | WHERE t1.is_del = 0 AND t1.`status` = 2 |
| | | <if test="pageMcsGameDTO.userId != null"> |
| | | AND t2.user_id = #{pageMcsGameDTO.userId} |
| | | </if> |
| | | <if test="pageMcsGameDTO.type != null"> |
| | | AND t1.`type` = #{pageMcsGameDTO.type} |
| | | </if> |
| | | <if test="pageMcsGameDTO.status != null"> |
| | | AND t1.`status` = #{pageMcsGameDTO.status} |
| | | </if> |
| | | <if test="pageMcsGameDTO.keyword != null and pageMcsGameDTO.keyword != """> |
| | | AND t1.`name` LIKE CONCAT(#{pageMcsGameDTO.keyword}, '%') |
| | | </if> |
| | | ORDER BY t1.created_at DESC LIMIT 99999) |
| | | UNION ALL |
| | | (SELECT t1.id, t1.`name`, t1.`type`, t1.coupons, t1.surplus_coupons, |
| | | t1.publish_at, t1.`status`, t1.merchant_id, t2.`name` AS merchantName, t1.is_popular, t1.cover |
| | | FROM mcs_game t1 |
| | | LEFT JOIN mcs_merchant t2 ON t1.merchant_id = t2.id |
| | | WHERE t1.is_del = 0 AND t1.`status` != 2 |
| | | <if test="pageMcsGameDTO.userId != null"> |
| | | AND t2.user_id = #{pageMcsGameDTO.userId} |
| | | </if> |
| | | <if test="pageMcsGameDTO.type != null"> |
| | | AND t1.`type` = #{pageMcsGameDTO.type} |
| | | </if> |
| | | <if test="pageMcsGameDTO.status != null"> |
| | | AND t1.`status` = #{pageMcsGameDTO.status} |
| | | </if> |
| | | <if test="pageMcsGameDTO.keyword != null and pageMcsGameDTO.keyword != """> |
| | | AND t1.`name` LIKE CONCAT(#{pageMcsGameDTO.keyword}, '%') |
| | | </if> |
| | | ORDER BY t1.created_at DESC LIMIT 99999) |
| | | </select> |
| | | <select id="selectPublishCount" resultType="java.lang.Integer"> |
| | | SELECT SUM(publishCount) AS publishCount FROM |
| | | ( |
| | | SELECT COUNT(1) AS publishCount FROM mcs_game WHERE merchant_id = #{merchantId} AND `status` = 2 AND is_del = 0 |
| | | UNION ALL |
| | | SELECT COUNT(1) AS publishCount FROM mcs_information WHERE merchant_id = #{merchantId} AND `status` = 2 AND is_del = 0 |
| | | ) temp |
| | | </select> |
| | | <select id="selectAppliedCount" resultType="java.lang.Integer"> |
| | | SELECT COUNT(1) |
| | | FROM mcs_coupon t1 |
| | | LEFT JOIN mcs_game t2 ON t1.game_id = t2.id |
| | | WHERE t2.merchant_id = #{merchantId} |
| | | </select> |
| | | <select id="selectVerifiedCount" resultType="java.lang.Integer"> |
| | | SELECT COUNT(1) |
| | | FROM mcs_coupon t1 |
| | | LEFT JOIN mcs_game t2 ON t1.game_id = t2.id |
| | | WHERE t1.is_verified = 1 AND t2.merchant_id = #{merchantId} |
| | | </select> |
| | | <select id="selectPopularGame" |
| | | resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsGameVO"> |
| | | SELECT t1.id, t1.`name`, t1.coupons, t1.surplus_coupons, t1.`type`, t1.award_type FROM mcs_game t1 |
| | | LEFT JOIN mcs_merchant t2 ON t1.merchant_id = t2.id |
| | | LEFT JOIN sys_user t3 ON t2.user_id = t3.user_id |
| | | WHERE t1.is_del = 0 AND t1.`status` = 2 AND t1.is_popular = 1 AND t2.is_del = 0 AND t3.`status` = 1 LIMIT 1 |
| | | </select> |
| | | <select id="pageH5McsGame" |
| | | resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsGameVO"> |
| | | SELECT t1.id, t1.`name`, t1.`type`, t1.coupons, t1.surplus_coupons, t1.award_type, t1.cover, |
| | | t1.publish_at, t1.`status`, t1.merchant_id, t1.lat, t1.lon, t2.`name` AS merchantName |
| | | FROM mcs_game t1 |
| | | LEFT JOIN mcs_merchant t2 ON t1.merchant_id = t2.id |
| | | LEFT JOIN sys_user t3 ON t2.user_id = t3.user_id |
| | | WHERE t1.is_del = 0 AND t1.`status` = 2 AND t1.expire_at > NOW() AND t3.`status` = 1 |
| | | <if test="pageMcsGameDTO.keyword != null and pageMcsGameDTO.keyword != """> |
| | | AND t1.`name` LIKE CONCAT(#{pageMcsGameDTO.keyword}, '%') |
| | | </if> |
| | | <if test="pageMcsGameDTO.merchantId != null"> |
| | | AND t1.merchant_id = #{pageMcsGameDTO.merchantId} |
| | | </if> |
| | | <if test="maxX != null"> |
| | | AND (t1.lon BETWEEN #{minX} AND #{maxX}) |
| | | AND (t1.lat BETWEEN #{minY} AND #{maxY}) |
| | | </if> |
| | | ORDER BY t1.created_at DESC |
| | | </select> |
| | | <select id="selectDetailById" |
| | | resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsGameVO"> |
| | | SELECT t1.*, t2.`name` AS merchantName, t2.logo |
| | | FROM mcs_game t1 |
| | | LEFT JOIN mcs_merchant t2 ON t1.merchant_id = t2.id |
| | | WHERE t1.id = #{gameId} |
| | | </select> |
| | | <select id="selectNeedDealExpire" resultType="com.panzhihua.service_community.entity.McsGame"> |
| | | SELECT * FROM mcs_game WHERE expire_at <= NOW() AND `status` != 4 |
| | | </select> |
| | | |
| | | </mapper> |
| | | |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_community.dao.McsInformationDAO"> |
| | | |
| | | <resultMap type="com.panzhihua.service_community.entity.McsInformation" id="McsInformationMap"> |
| | | <result property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="name" column="name" jdbcType="VARCHAR"/> |
| | | <result property="address" column="address" jdbcType="VARCHAR"/> |
| | | <result property="lat" column="lat" jdbcType="VARCHAR"/> |
| | | <result property="lon" column="lon" jdbcType="VARCHAR"/> |
| | | <result property="cover" column="cover" jdbcType="VARCHAR"/> |
| | | <result property="content" column="content" jdbcType="VARCHAR"/> |
| | | <result property="status" column="status" jdbcType="INTEGER"/> |
| | | <result property="publishAt" column="publish_at" jdbcType="TIMESTAMP"/> |
| | | <result property="isDel" column="is_del" jdbcType="VARCHAR"/> |
| | | <result property="merchantId" column="merchant_id" jdbcType="INTEGER"/> |
| | | <result property="createdAt" column="created_at" jdbcType="TIMESTAMP"/> |
| | | <result property="createdBy" column="created_by" jdbcType="INTEGER"/> |
| | | <result property="updatedAt" column="updated_at" jdbcType="TIMESTAMP"/> |
| | | <result property="updatedBy" column="updated_by" jdbcType="INTEGER"/> |
| | | </resultMap> |
| | | |
| | | <!-- 批量插入 --> |
| | | <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true"> |
| | | insert into smart_life.mcs_information(name, address, lat, lon, cover, content, status, publish_at, is_del, |
| | | merchant_id, created_at, created_by, updated_at, updated_by) |
| | | values |
| | | <foreach collection="entities" item="entity" separator=","> |
| | | (#{entity.name}, #{entity.address}, #{entity.lat}, #{entity.lon}, #{entity.cover}, #{entity.content}, |
| | | #{entity.status}, #{entity.publishAt}, #{entity.isDel}, #{entity.merchantId}, #{entity.createdAt}, |
| | | #{entity.createdBy}, #{entity.updatedAt}, #{entity.updatedBy}) |
| | | </foreach> |
| | | </insert> |
| | | <!-- 批量插入或按主键更新 --> |
| | | <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true"> |
| | | insert into smart_life.mcs_information(name, address, lat, lon, cover, content, status, publish_at, is_del, |
| | | merchant_id, created_at, created_by, updated_at, updated_by) |
| | | values |
| | | <foreach collection="entities" item="entity" separator=","> |
| | | (#{entity.name}, #{entity.address}, #{entity.lat}, #{entity.lon}, #{entity.cover}, #{entity.content}, |
| | | #{entity.status}, #{entity.publishAt}, #{entity.isDel}, #{entity.merchantId}, #{entity.createdAt}, |
| | | #{entity.createdBy}, #{entity.updatedAt}, #{entity.updatedBy}) |
| | | </foreach> |
| | | on duplicate key update |
| | | name = values(name) , address = values(address) , lat = values(lat) , lon = values(lon) , cover = values(cover) |
| | | , content = values(content) , status = values(status) , publish_at = values(publish_at) , is_del = |
| | | values(is_del) , merchant_id = values(merchant_id) , created_at = values(created_at) , created_by = |
| | | values(created_by) , updated_at = values(updated_at) , updated_by = values(updated_by) |
| | | </insert> |
| | | <update id="setOffByMerchantIds"> |
| | | UPDATE mcs_information SET `status` = 3 WHERE merchant_id IN |
| | | <foreach collection="needDealIds" index="index" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </update> |
| | | <select id="pageMcsInfo" |
| | | resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsInformationVO"> |
| | | SELECT t1.id, t1.`name`, t1.publish_at, t1.`status`, t1.merchant_id, t2.`name` AS merchantName, t1.cover |
| | | FROM mcs_information t1 |
| | | LEFT JOIN mcs_merchant t2 ON t1.merchant_id = t2.id |
| | | WHERE t1.is_del = 0 |
| | | <if test="pageMcsInformationDTO.userId != null"> |
| | | AND t2.user_id = #{pageMcsInformationDTO.userId} |
| | | </if> |
| | | <if test="pageMcsInformationDTO.status != null"> |
| | | AND t1.`status` = #{pageMcsInformationDTO.status} |
| | | </if> |
| | | <if test="pageMcsInformationDTO.keyword != null and pageMcsInformationDTO.keyword != """> |
| | | AND t1.`name` LIKE CONCAT(#{pageMcsInformationDTO.keyword}, '%') |
| | | </if> |
| | | ORDER BY t1.created_at DESC |
| | | </select> |
| | | <select id="pageH5McsInfo" |
| | | resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsInformationVO"> |
| | | SELECT * FROM ( |
| | | SELECT t1.id, t1.`name`, t1.publish_at, t1.`status`, t1.merchant_id, t1.lat, t1.lon, t1.cover, t2.`name` AS |
| | | merchantName, |
| | | ROUND(6378.138 * 2 * ASIN(SQRT(POW(SIN((t1.lat * PI() / 180 - #{pageMcsInformationDTO.lat} * PI() / 180) / 2),2) |
| | | + |
| | | COS(t1.lat * PI() / 180) * COS(#{pageMcsInformationDTO.lat} * PI() / 180) * POW(SIN((t1.lon * PI() / 180 - |
| | | #{pageMcsInformationDTO.lon} * PI() / 180) / 2),2))), 2) AS distance |
| | | FROM mcs_information t1 |
| | | LEFT JOIN mcs_merchant t2 ON t1.merchant_id = t2.id |
| | | LEFT JOIN sys_user t3 ON t2.user_id = t3.user_id |
| | | WHERE t1.is_del = 0 AND t1.`status` = 2 AND t3.`status` = 1 |
| | | <if test="pageMcsInformationDTO.keyword != null and pageMcsInformationDTO.keyword != """> |
| | | AND t1.`name` LIKE CONCAT(#{pageMcsInformationDTO.keyword}, '%') |
| | | </if> |
| | | <if test="pageMcsInformationDTO.merchantId != null"> |
| | | AND t1.merchant_id = #{pageMcsInformationDTO.merchantId} |
| | | </if> |
| | | ORDER BY t1.created_at DESC |
| | | ) temp WHERE 1=1 |
| | | <if test="pageMcsInformationDTO.distance != null"> |
| | | AND distance <= #{pageMcsInformationDTO.distance} |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| | | |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_community.dao.McsLabelDAO"> |
| | | |
| | | <resultMap type="com.panzhihua.service_community.entity.McsLabel" id="McsLabelMap"> |
| | | <result property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="name" column="name" jdbcType="VARCHAR"/> |
| | | <result property="introduction" column="introduction" jdbcType="VARCHAR"/> |
| | | <result property="isDel" column="is_del" jdbcType="VARCHAR"/> |
| | | <result property="merchantId" column="merchant_id" jdbcType="INTEGER"/> |
| | | <result property="createdAt" column="created_at" jdbcType="TIMESTAMP"/> |
| | | <result property="createdBy" column="created_by" jdbcType="INTEGER"/> |
| | | <result property="updatedAt" column="updated_at" jdbcType="TIMESTAMP"/> |
| | | <result property="updatedBy" column="updated_by" jdbcType="INTEGER"/> |
| | | </resultMap> |
| | | |
| | | <!-- 批量插入 --> |
| | | <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true"> |
| | | insert into smart_life.mcs_label(name, introduction, is_del, merchant_id, created_at, created_by, updated_at, |
| | | updated_by) |
| | | values |
| | | <foreach collection="entities" item="entity" separator=","> |
| | | (#{entity.name}, #{entity.introduction}, #{entity.isDel}, #{entity.merchantId}, #{entity.createdAt}, |
| | | #{entity.createdBy}, #{entity.updatedAt}, #{entity.updatedBy}) |
| | | </foreach> |
| | | </insert> |
| | | <!-- 批量插入或按主键更新 --> |
| | | <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true"> |
| | | insert into smart_life.mcs_label(name, introduction, is_del, merchant_id, created_at, created_by, updated_at, |
| | | updated_by) |
| | | values |
| | | <foreach collection="entities" item="entity" separator=","> |
| | | (#{entity.name}, #{entity.introduction}, #{entity.isDel}, #{entity.merchantId}, #{entity.createdAt}, |
| | | #{entity.createdBy}, #{entity.updatedAt}, #{entity.updatedBy}) |
| | | </foreach> |
| | | on duplicate key update |
| | | name = values(name) , introduction = values(introduction) , is_del = values(is_del) , merchant_id = |
| | | values(merchant_id) , created_at = values(created_at) , created_by = values(created_by) , updated_at = |
| | | values(updated_at) , updated_by = values(updated_by) |
| | | </insert> |
| | | <select id="selectVOList" |
| | | resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsLabelVO"> |
| | | SELECT id, `name`, introduction FROM mcs_label WHERE is_del = 0 |
| | | </select> |
| | | |
| | | </mapper> |
| | | |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_community.dao.McsMerchantDAO"> |
| | | |
| | | <resultMap type="com.panzhihua.service_community.entity.McsMerchant" id="McsMerchantMap"> |
| | | <result property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="name" column="name" jdbcType="VARCHAR"/> |
| | | <result property="phone" column="phone" jdbcType="VARCHAR"/> |
| | | <result property="account" column="account" jdbcType="VARCHAR"/> |
| | | <result property="logo" column="logo" jdbcType="VARCHAR"/> |
| | | <result property="userId" column="user_id" jdbcType="INTEGER"/> |
| | | <result property="level" column="level" jdbcType="INTEGER"/> |
| | | <result property="publishLimit" column="publish_limit" jdbcType="INTEGER"/> |
| | | <result property="expireAt" column="expire_at" jdbcType="TIMESTAMP"/> |
| | | <result property="isPause" column="is_pause" jdbcType="VARCHAR"/> |
| | | <result property="firstLitAt" column="first_lit_at" jdbcType="TIMESTAMP"/> |
| | | <result property="address" column="address" jdbcType="VARCHAR"/> |
| | | <result property="lat" column="lat" jdbcType="VARCHAR"/> |
| | | <result property="lon" column="lon" jdbcType="VARCHAR"/> |
| | | <result property="introduction" column="introduction" jdbcType="VARCHAR"/> |
| | | <result property="isDel" column="is_del" jdbcType="VARCHAR"/> |
| | | <result property="createdAt" column="created_at" jdbcType="TIMESTAMP"/> |
| | | <result property="createdBy" column="created_by" jdbcType="INTEGER"/> |
| | | <result property="updatedAt" column="updated_at" jdbcType="TIMESTAMP"/> |
| | | <result property="updatedBy" column="updated_by" jdbcType="INTEGER"/> |
| | | </resultMap> |
| | | |
| | | <!-- 批量插入 --> |
| | | <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true"> |
| | | insert into smart_life.mcs_merchant(name, phone, account, logo, user_id, level, publish_limit, expire_at, |
| | | address, lat, lon, introduction, is_del, created_at, created_by, updated_at, updated_by) |
| | | values |
| | | <foreach collection="entities" item="entity" separator=","> |
| | | (#{entity.name}, #{entity.phone}, #{entity.account}, #{entity.logo}, #{entity.userId}, #{entity.level}, |
| | | #{entity.publishLimit}, #{entity.expireAt}, #{entity.address}, #{entity.lat}, #{entity.lon}, |
| | | #{entity.introduction}, #{entity.isDel}, #{entity.createdAt}, #{entity.createdBy}, #{entity.updatedAt}, |
| | | #{entity.updatedBy}) |
| | | </foreach> |
| | | </insert> |
| | | <!-- 批量插入或按主键更新 --> |
| | | <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true"> |
| | | insert into smart_life.mcs_merchant(name, phone, account, logo, user_id, level, publish_limit, expire_at, |
| | | address, lat, lon, introduction, is_del, created_at, created_by, updated_at, updated_by) |
| | | values |
| | | <foreach collection="entities" item="entity" separator=","> |
| | | (#{entity.name}, #{entity.phone}, #{entity.account}, #{entity.logo}, #{entity.userId}, #{entity.level}, |
| | | #{entity.publishLimit}, #{entity.expireAt}, #{entity.address}, #{entity.lat}, #{entity.lon}, |
| | | #{entity.introduction}, #{entity.isDel}, #{entity.createdAt}, #{entity.createdBy}, #{entity.updatedAt}, |
| | | #{entity.updatedBy}) |
| | | </foreach> |
| | | on duplicate key update |
| | | name = values(name) , phone = values(phone) , account = values(account) , logo = values(logo) , user_id = |
| | | values(user_id) , level = values(level) , publish_limit = values(publish_limit) , expire_at = values(expire_at) |
| | | , address = values(address) , lat = values(lat) , lon = values(lon) , introduction = values(introduction) , |
| | | is_del = values(is_del) , created_at = values(created_at) , created_by = values(created_by) , updated_at = |
| | | values(updated_at) , updated_by = values(updated_by) |
| | | </insert> |
| | | <update id="updateIsPauseStatus"> |
| | | UPDATE mcs_merchant SET is_pause = 1 WHERE id IN |
| | | <foreach collection="needDealIds" index="index" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </update> |
| | | <select id="getMcsMerchantById" |
| | | resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsMerchantVO"> |
| | | SELECT t1.id, t1.`name`, t1.phone, t1.account, t1.`level`, t1.expire_at, t1.first_lit_at, t1.publish_limit, |
| | | t1.logo, t1.address, t1.lat, t1.lon, t1.introduction, t2.`status` AS accountStatus |
| | | FROM mcs_merchant t1 |
| | | LEFT JOIN sys_user t2 ON t1.user_id = t2.user_id |
| | | WHERE t1.id = #{merchantId} AND t1.is_del = 0 |
| | | </select> |
| | | <select id="pageMcsMerchant" |
| | | resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsMerchantVO"> |
| | | SELECT t1.id, t1.`name`, t1.phone, t1.account, t1.`level`, t1.expire_at, t1.first_lit_at, t1.publish_limit, t2.`status` AS accountStatus |
| | | FROM mcs_merchant t1 |
| | | LEFT JOIN sys_user t2 ON t1.user_id = t2.user_id |
| | | WHERE t1.is_del = 0 |
| | | <if test="pageMcsMerchantDTO.accountStatus != null"> |
| | | AND t2.`status` = #{pageMcsMerchantDTO.accountStatus} |
| | | </if> |
| | | <if test="pageMcsMerchantDTO.level != null"> |
| | | AND t1.`level` = #{pageMcsMerchantDTO.level} |
| | | </if> |
| | | <if test="pageMcsMerchantDTO.keyword != null and pageMcsMerchantDTO.keyword != """> |
| | | AND ( |
| | | t1.`name` LIKE CONCAT(#{pageMcsMerchantDTO.keyword}, '%') |
| | | OR t1.phone LIKE CONCAT(#{pageMcsMerchantDTO.keyword}, '%') |
| | | ) |
| | | </if> |
| | | ORDER BY t1.created_at DESC |
| | | </select> |
| | | <select id="getMcsMerchantByAccount" |
| | | resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsMerchantVO"> |
| | | SELECT t1.id, t1.`name`, t1.phone, t1.account, t1.`level`, t1.expire_at, t1.first_lit_at, t1.publish_limit, |
| | | t1.logo, t1.address, t1.lat, t1.lon, t1.introduction, t2.`status` AS accountStatus |
| | | FROM mcs_merchant t1 |
| | | LEFT JOIN sys_user t2 ON t1.user_id = t2.user_id |
| | | WHERE t1.account = #{account} AND t1.is_del = 0 |
| | | </select> |
| | | <select id="getMcsIndexTopData" |
| | | resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.IndexTopStatisticsVO"> |
| | | SELECT randomCoinTotal + averageCoinTotal AS coinTotal,appliedTotal,gameTotal,infoTotal FROM( |
| | | SELECT |
| | | (SELECT IF(SUM(coins) IS NULL,0,SUM(coins)) FROM mcs_game t1 |
| | | LEFT JOIN mcs_merchant t2 ON t1.merchant_id = t2.id |
| | | LEFT JOIN sys_user t3 ON t2.user_id = t3.user_id |
| | | WHERE t1.is_del = 0 AND t1.`status` = 2 AND t1.expire_at > NOW() AND t1.allocation = 1 AND t2.is_del = 0 AND t3.`status` = 1) AS randomCoinTotal, |
| | | |
| | | (SELECT IF(SUM(t1.coins * t1.coupons) IS NULL,0,SUM(t1.coins * t1.coupons)) FROM mcs_game t1 |
| | | LEFT JOIN mcs_merchant t2 ON t1.merchant_id = t2.id |
| | | LEFT JOIN sys_user t3 ON t2.user_id = t3.user_id |
| | | WHERE t1.is_del = 0 AND t1.`status` = 2 AND t1.expire_at > NOW() AND t1.allocation = 2 AND t2.is_del = 0 AND t3.`status` = 1) AS averageCoinTotal, |
| | | |
| | | (SELECT IF(SUM(coin) IS NULL,0,SUM(coin)) FROM mcs_coupon WHERE to_days(created_at) = to_days(now())) AS appliedTotal, |
| | | |
| | | (SELECT COUNT(t1.id) FROM mcs_game t1 |
| | | LEFT JOIN mcs_merchant t2 ON t1.merchant_id = t2.id |
| | | LEFT JOIN sys_user t3 ON t2.user_id = t3.user_id |
| | | WHERE t1.is_del = 0 AND t1.`status` = 2 AND t1.expire_at > NOW() AND t2.is_del = 0 AND t3.`status` = 1) AS gameTotal, |
| | | |
| | | (SELECT COUNT(t1.id) FROM mcs_information t1 |
| | | LEFT JOIN mcs_merchant t2 ON t1.merchant_id = t2.id |
| | | LEFT JOIN sys_user t3 ON t2.user_id = t3.user_id |
| | | WHERE t1.is_del = 0 AND t1.`status` = 2 AND t2.is_del = 0 AND t3.`status` = 1) AS infoTotal |
| | | ) temp |
| | | </select> |
| | | <select id="pageH5McsMerchant" |
| | | resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsMerchantVO"> |
| | | SELECT * FROM ( |
| | | SELECT t1.id, t1.`name`, t1.phone, t1.account, t1.`level`, t1.expire_at, t1.first_lit_at, t1.publish_limit, |
| | | t1.introduction, t1.logo, |
| | | ROUND(6378.138 * 2 * ASIN(SQRT(POW(SIN((t1.lat * PI() / 180 - #{pageMcsMerchantDTO.lat} * PI() / 180) / 2),2) + |
| | | COS(t1.lat * PI() / 180) * COS(#{pageMcsMerchantDTO.lat} * PI() / 180) * POW(SIN((t1.lon * PI() / 180 - |
| | | #{pageMcsMerchantDTO.lon} * PI() / 180) / 2),2))), 2) AS distance |
| | | FROM mcs_merchant t1 |
| | | LEFT JOIN sys_user t2 ON t1.user_id = t2.user_id |
| | | <if test="pageMcsMerchantDTO.type != null and pageMcsMerchantDTO.type == 1">LEFT JOIN (SELECT * FROM mcs_game |
| | | WHERE `status` = 2 GROUP BY merchant_id) t3 ON t1.id = t3.merchant_id |
| | | </if> |
| | | <if test=" |
| | | pageMcsMerchantDTO.type != null and pageMcsMerchantDTO.type == 2">LEFT JOIN (SELECT * FROM mcs_information WHERE |
| | | `status` = 2 GROUP BY merchant_id) t3 ON t1.id = t3.merchant_id |
| | | </if> |
| | | WHERE t1.is_del = 0 AND t1.expire_at > NOW() AND t2.`status` = 1 |
| | | <if test="pageMcsMerchantDTO.type != null"> |
| | | AND t3.id IS NOT NULL |
| | | </if> |
| | | <if test="pageMcsMerchantDTO.keyword != null and pageMcsMerchantDTO.keyword != """> |
| | | AND t1.`name` LIKE CONCAT(#{pageMcsMerchantDTO.keyword}, '%') |
| | | </if> |
| | | ) temp WHERE 1=1 |
| | | <if test="pageMcsMerchantDTO.distance != null"> |
| | | <if test="pageMcsMerchantDTO.isMore != null and pageMcsMerchantDTO.isMore ==1"> |
| | | AND distance > #{pageMcsMerchantDTO.distance} |
| | | </if> |
| | | <if test="pageMcsMerchantDTO.isMore == null"> |
| | | AND distance <= #{pageMcsMerchantDTO.distance} |
| | | </if> |
| | | </if> |
| | | ORDER BY distance ASC |
| | | </select> |
| | | <select id="selectNeedDealExpiredMerchant" resultType="java.lang.Long"> |
| | | SELECT id FROM mcs_merchant WHERE expire_at <= NOW() AND is_pause = 0 |
| | | </select> |
| | | |
| | | </mapper> |
| | | |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_community.dao.McsOrderDao"> |
| | | |
| | | <resultMap type="com.panzhihua.service_community.entity.McsOrder" id="McsOrderBaseResultMap"> |
| | | <result property="id" column="id"/> |
| | | <result property="orderNo" column="order_no"/> |
| | | <result property="configId" column="config_id"/> |
| | | <result property="num" column="num"/> |
| | | <result property="status" column="status"/> |
| | | <result property="money" column="money"/> |
| | | <result property="payTime" column="pay_time"/> |
| | | <result property="merchantId" column="merchant_id"/> |
| | | <result property="payNo" column="pay_no"/> |
| | | <result property="userId" column="user_id"/> |
| | | <result property="paymentMethod" column="payment_method"/> |
| | | <result property="address" column="address"/> |
| | | <result property="lat" column="lat"/> |
| | | <result property="lon" column="lon"/> |
| | | </resultMap> |
| | | |
| | | <select id="pageList" resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsOrderVO"> |
| | | select t.*,t1.`name` as payName,t2.name as merchantName,t2.account as merchantAccount from mcs_order t |
| | | left join mcs_config t1 on t.config_id = t1.id |
| | | left join mcs_merchant t2 on t.merchant_id = t2.id |
| | | <where> |
| | | <if test="commonPage.status !=null"> |
| | | and t.status = #{commonPage.status} |
| | | </if> |
| | | <if test="commonPage.keyword !=null and commonPage.keyword !=''"> |
| | | and t.order_no like concat('%',#{commonPage.keyword},'%') |
| | | </if> |
| | | <if test="commonPage.userId !=null"> |
| | | and t.user_id = #{commonPage.userId} |
| | | </if> |
| | | <if test="commonPage.merchantId !=null"> |
| | | and t.merchant_id = #{commonPage.merchantId} |
| | | </if> |
| | | </where> |
| | | order by t.create_time desc |
| | | </select> |
| | | |
| | | <select id="detail" resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsOrderVO"> |
| | | select t.*,t1.`name` as payName,t2.name as merchantName,t2.account as merchantAccount from mcs_order t |
| | | left join mcs_config t1 on t.config_id = t1.id |
| | | left join mcs_merchant t2 on t.merchant_id = t2.id |
| | | where t.id =#{id} |
| | | </select> |
| | | |
| | | <select id="selectPhone" resultType="string"> |
| | | select t1.phone from mcs_order t left join mcs_merchant t1 on t.merchant_id = t1.id where t.id=#{id} |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_community.dao.McsProductLabelDAO"> |
| | | |
| | | <resultMap type="com.panzhihua.service_community.entity.McsProductLabel" id="McsProductLabelMap"> |
| | | <result property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="productId" column="product_id" jdbcType="INTEGER"/> |
| | | <result property="labelId" column="label_id" jdbcType="INTEGER"/> |
| | | <result property="labelName" column="label_name" jdbcType="VARCHAR"/> |
| | | </resultMap> |
| | | |
| | | <!-- 批量插入 --> |
| | | <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true"> |
| | | insert into smart_life.mcs_product_label(product_id, label_id, label_name) |
| | | values |
| | | <foreach collection="entities" item="entity" separator=","> |
| | | (#{entity.productId}, #{entity.labelId}, #{entity.labelName}) |
| | | </foreach> |
| | | </insert> |
| | | <!-- 批量插入或按主键更新 --> |
| | | <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true"> |
| | | insert into smart_life.mcs_product_label(product_id, label_id, label_name) |
| | | values |
| | | <foreach collection="entities" item="entity" separator=","> |
| | | (#{entity.productId}, #{entity.labelId}, #{entity.labelName}) |
| | | </foreach> |
| | | on duplicate key update |
| | | product_id = values(product_id) , label_id = values(label_id) , label_name = values(label_name) |
| | | </insert> |
| | | |
| | | </mapper> |
| | | |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_community.dao.McsProductDAO"> |
| | | |
| | | <resultMap type="com.panzhihua.service_community.entity.McsProduct" id="McsProductMap"> |
| | | <result property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="name" column="name" jdbcType="VARCHAR"/> |
| | | <result property="image" column="image" jdbcType="VARCHAR"/> |
| | | <result property="introduction" column="introduction" jdbcType="VARCHAR"/> |
| | | <result property="viewNum" column="view_num" jdbcType="INTEGER"/> |
| | | <result property="status" column="status" jdbcType="INTEGER"/> |
| | | <result property="isDel" column="is_del" jdbcType="VARCHAR"/> |
| | | <result property="merchantId" column="merchant_id" jdbcType="INTEGER"/> |
| | | <result property="createdAt" column="created_at" jdbcType="TIMESTAMP"/> |
| | | <result property="createdBy" column="created_by" jdbcType="INTEGER"/> |
| | | <result property="updatedAt" column="updated_at" jdbcType="TIMESTAMP"/> |
| | | <result property="updatedBy" column="updated_by" jdbcType="INTEGER"/> |
| | | </resultMap> |
| | | |
| | | <!-- 批量插入 --> |
| | | <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true"> |
| | | insert into smart_life.mcs_product(name, image, introduction, view_num, status, is_del, merchant_id, created_at, |
| | | created_by, updated_at, updated_by) |
| | | values |
| | | <foreach collection="entities" item="entity" separator=","> |
| | | (#{entity.name}, #{entity.image}, #{entity.introduction}, #{entity.viewNum}, #{entity.status}, |
| | | #{entity.isDel}, #{entity.merchantId}, #{entity.createdAt}, #{entity.createdBy}, #{entity.updatedAt}, |
| | | #{entity.updatedBy}) |
| | | </foreach> |
| | | </insert> |
| | | <!-- 批量插入或按主键更新 --> |
| | | <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true"> |
| | | insert into smart_life.mcs_product(name, image, introduction, view_num, status, is_del, merchant_id, created_at, |
| | | created_by, updated_at, updated_by) |
| | | values |
| | | <foreach collection="entities" item="entity" separator=","> |
| | | (#{entity.name}, #{entity.image}, #{entity.introduction}, #{entity.viewNum}, #{entity.status}, |
| | | #{entity.isDel}, #{entity.merchantId}, #{entity.createdAt}, #{entity.createdBy}, #{entity.updatedAt}, |
| | | #{entity.updatedBy}) |
| | | </foreach> |
| | | on duplicate key update |
| | | name = values(name) , image = values(image) , introduction = values(introduction) , view_num = values(view_num) |
| | | , status = values(status) , is_del = values(is_del) , merchant_id = values(merchant_id) , created_at = |
| | | values(created_at) , created_by = values(created_by) , updated_at = values(updated_at) , updated_by = |
| | | values(updated_by) |
| | | </insert> |
| | | <select id="pageMcsProduct" |
| | | resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsProductVO"> |
| | | SELECT t1.id, t1.`name`, t1.image, t1.view_num, t1.`status`, t1.introduction, t3.productLabel |
| | | FROM mcs_product t1 |
| | | LEFT JOIN mcs_merchant t2 ON t1.merchant_id = t2.id |
| | | LEFT JOIN (SELECT product_id, GROUP_CONCAT(label_name) AS productLabel FROM mcs_product_label GROUP BY product_id) t3 ON t1.id = t3.product_id |
| | | WHERE t1.is_del = 0 AND t2.is_del = 0 |
| | | <if test="pageMcsProductDTO.merchantId != null"> |
| | | AND t1.merchant_id = #{pageMcsProductDTO.merchantId} |
| | | AND t1.status = 1 |
| | | </if> |
| | | <if test="pageMcsProductDTO.merchantId == null"> |
| | | AND t2.user_id = #{pageMcsProductDTO.userId} |
| | | </if> |
| | | <if test="pageMcsProductDTO.status != null"> |
| | | AND t1.`status` = #{pageMcsProductDTO.status} |
| | | </if> |
| | | <if test="pageMcsProductDTO.keyword != null and pageMcsProductDTO.keyword != """> |
| | | AND t1.`name` LIKE CONCAT(#{pageMcsProductDTO.keyword}, '%') |
| | | </if> |
| | | ORDER BY t1.created_at DESC |
| | | </select> |
| | | |
| | | </mapper> |
| | | |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_community.dao.McsVerifiedRecordDAO"> |
| | | |
| | | <resultMap type="com.panzhihua.service_community.entity.McsVerifiedRecord" id="McsVerifiedRecordMap"> |
| | | <result property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="couponId" column="coupon_id" jdbcType="INTEGER"/> |
| | | <result property="merchantId" column="merchant_id" jdbcType="INTEGER"/> |
| | | <result property="name" column="name" jdbcType="VARCHAR"/> |
| | | <result property="award" column="award" jdbcType="VARCHAR"/> |
| | | <result property="gameId" column="game_id" jdbcType="INTEGER"/> |
| | | <result property="nickName" column="nick_name" jdbcType="VARCHAR"/> |
| | | <result property="verifiedAt" column="verified_at" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | |
| | | <!-- 批量插入 --> |
| | | <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true"> |
| | | insert into smart_life.mcs_verified_record(coupon_id, name, award, verified_at) |
| | | values |
| | | <foreach collection="entities" item="entity" separator=","> |
| | | (#{entity.couponId}, #{entity.name}, #{entity.award}, #{entity.verifiedAt}) |
| | | </foreach> |
| | | </insert> |
| | | <!-- 批量插入或按主键更新 --> |
| | | <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true"> |
| | | insert into smart_life.mcs_verified_record(coupon_id, name, award, verified_at) |
| | | values |
| | | <foreach collection="entities" item="entity" separator=","> |
| | | (#{entity.couponId}, #{entity.name}, #{entity.award}, #{entity.verifiedAt}) |
| | | </foreach> |
| | | on duplicate key update |
| | | coupon_id = values(coupon_id) , name = values(name) , award = values(award) , verified_at = values(verified_at) |
| | | </insert> |
| | | <select id="pageMcsVerifyRecord" |
| | | resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsVerifyRecordVO"> |
| | | SELECT t1.*, t3.`type` |
| | | FROM mcs_verified_record t1 |
| | | LEFT JOIN mcs_merchant t2 ON t1.merchant_id = t2.id |
| | | LEFT JOIN mcs_game t3 ON t1.game_id = t3.id |
| | | WHERE t2.user_id = #{pageVerifyRecordDTO.userId} |
| | | <if test="pageVerifyRecordDTO.type != null"> |
| | | AND t3.`type` = #{pageVerifyRecordDTO.type} |
| | | </if> |
| | | <if test="pageVerifyRecordDTO.verifiedBegin != null"> |
| | | AND t1.verified_at >= #{pageVerifyRecordDTO.verifiedBegin} |
| | | </if> |
| | | <if test="pageVerifyRecordDTO.verifiedEnd != null"> |
| | | AND t1.verified_at <= #{pageVerifyRecordDTO.verifiedEnd} |
| | | </if> |
| | | <if test="pageVerifyRecordDTO.keyword != null and pageVerifyRecordDTO.keyword != """> |
| | | AND (t1.nick_name LIKE CONCAT('%', #{pageVerifyRecordDTO.keyword}, '%') |
| | | OR t1.coupon_id LIKE CONCAT('%', #{pageVerifyRecordDTO.keyword}, '%') |
| | | OR t1.`name` LIKE CONCAT('%', #{pageVerifyRecordDTO.keyword}, '%') |
| | | ) |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| | | |
| | |
| | | import com.panzhihua.common.model.dtos.DataKanBansDto; |
| | | import com.panzhihua.common.model.dtos.community.convenient.ConvenientMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.DisableOrEnableConvenientMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.BindUserPhoneDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.LoginWithPhoneDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsMerchantDTO; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import com.panzhihua.common.model.dtos.PageDTO; |
| | |
| | | return userService.getUserInfoByUnionId(unionId); |
| | | } |
| | | |
| | | /** |
| | | * 微商业街新增商家账号 |
| | | * @param mcsMerchantDTO |
| | | * @return 商家用户id |
| | | */ |
| | | @PostMapping("insertMcsMerchantAccount") |
| | | public R addMcsMerchantUser(@RequestBody McsMerchantDTO mcsMerchantDTO) { |
| | | return userService.addMcsMerchantUser(mcsMerchantDTO); |
| | | } |
| | | |
| | | /** |
| | | * 微商业街修改商家账号 |
| | | * @param mcsMerchantDTO |
| | | * @return |
| | | */ |
| | | @PutMapping("putMcsMerchantUser") |
| | | public R putMcsMerchantUser(@RequestBody McsMerchantDTO mcsMerchantDTO) { |
| | | return userService.putMcsMerchantUser(mcsMerchantDTO); |
| | | } |
| | | |
| | | /** |
| | | * 检查用户是否有效 |
| | | * @param userId |
| | | * @param type |
| | | * @return |
| | | */ |
| | | @PutMapping("checkUserIsValid") |
| | | public Boolean checkUserIsValid(@RequestParam("userId") Long userId, @RequestParam("type") Integer type) { |
| | | return userService.checkUserIsValid(userId, type); |
| | | } |
| | | |
| | | /** |
| | | * 根据手机号、用户类型查询用户 |
| | | * @param phone |
| | | * @param type |
| | | * @return |
| | | */ |
| | | @GetMapping("/getSysUserByPhone") |
| | | public R getSysUserByPhone(@RequestParam("phone") String phone, @RequestParam("type") Integer type) { |
| | | return userService.getSysUserByPhone(phone, type); |
| | | } |
| | | |
| | | /** |
| | | * 发送验证码 |
| | | * @param phone 手机号 |
| | | * @param clientIP 用户ip |
| | | * @param prefixKey redis Key 前缀 |
| | | * @param limit 获取次数限制 |
| | | * @param timeout 超次数获取时间等待 |
| | | * @return |
| | | */ |
| | | @GetMapping("/sendMessageCode") |
| | | public R sendMessageCode(@RequestParam("phone") String phone, |
| | | @RequestParam(value = "clientIP", required = false) String clientIP, |
| | | @RequestParam("prefixKey") String prefixKey, |
| | | @RequestParam("limit") Integer limit, |
| | | @RequestParam("timeout") Integer timeout) { |
| | | return userService.sendMessageCode(phone, clientIP, prefixKey, limit, timeout); |
| | | } |
| | | |
| | | /** |
| | | * 根据openId获取微商业街用户 |
| | | * @param openid |
| | | * @return |
| | | */ |
| | | @GetMapping("/getMcsUserByOpenId") |
| | | public R getMcsUserByOpenId(@RequestParam("openid") String openid) { |
| | | return userService.getMcsUserByOpenId(openid); |
| | | } |
| | | |
| | | /** |
| | | * 商业街用户微信授权-绑定手机号 |
| | | * @param bindUserPhoneDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/mcs/bindPhone") |
| | | public R bindOrAddMcsUser(@RequestBody BindUserPhoneDTO bindUserPhoneDTO) { |
| | | return userService.bindOrAddMcsUser(bindUserPhoneDTO); |
| | | } |
| | | |
| | | } |
| | |
| | | * 高龄认证显示提示(1.是 2.否) |
| | | */ |
| | | private Integer bigAgeTips; |
| | | /** |
| | | * 明文密码 |
| | | */ |
| | | private String plaintextPassword; |
| | | |
| | | } |
| | |
| | | import com.panzhihua.common.model.dtos.community.NoticeReadDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.ConvenientMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.DisableOrEnableConvenientMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.BindUserPhoneDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.grid.*; |
| | | import com.panzhihua.common.model.dtos.user.PageFeedBackDTO; |
| | | import com.panzhihua.common.model.dtos.user.PageUserAppletsBackstageDTO; |
| | |
| | | * @return |
| | | */ |
| | | R getUserInfoByUnionId(String unionId); |
| | | |
| | | /** |
| | | * 微商业街新增商家账号 |
| | | * @param mcsMerchantDTO |
| | | * @return 商家用户id |
| | | */ |
| | | R addMcsMerchantUser(McsMerchantDTO mcsMerchantDTO); |
| | | |
| | | /** |
| | | * 微商业街修改商家账号 |
| | | * @param mcsMerchantDTO |
| | | * @return |
| | | */ |
| | | R putMcsMerchantUser(McsMerchantDTO mcsMerchantDTO); |
| | | |
| | | /** |
| | | * 检查用户是否有效 |
| | | * @param userId |
| | | * @param type |
| | | * @return |
| | | */ |
| | | Boolean checkUserIsValid(Long userId, Integer type); |
| | | |
| | | /** |
| | | * 根据手机号、用户类型查询用户 |
| | | * @param phone |
| | | * @param type |
| | | * @return |
| | | */ |
| | | R getSysUserByPhone(String phone, Integer type); |
| | | |
| | | /** |
| | | * 发送验证码 |
| | | * @param phone 手机号 |
| | | * @param clientIP 用户ip |
| | | * @param prefixKey redis Key 前缀 |
| | | * @param limit 获取次数限制 |
| | | * @param timeout 超次数获取时间等待 |
| | | * @return |
| | | */ |
| | | R sendMessageCode(String phone, String clientIP, String prefixKey, Integer limit, Integer timeout); |
| | | |
| | | /** |
| | | * 根据openId获取微商业街用户 |
| | | * @param openid |
| | | * @return |
| | | */ |
| | | R getMcsUserByOpenId(String openid); |
| | | |
| | | /** |
| | | * 商业街用户微信授权-绑定手机号 |
| | | * @param bindUserPhoneDTO |
| | | * @return |
| | | */ |
| | | R bindOrAddMcsUser(BindUserPhoneDTO bindUserPhoneDTO); |
| | | } |
| | |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | import static org.apache.commons.lang3.StringUtils.isNotBlank; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Random; |
| | | import java.util.Set; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.constraints.NotBlank; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.BindUserPhoneDTO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsLoginUserInfoVO; |
| | | import com.panzhihua.service_user.dao.*; |
| | | import com.panzhihua.service_user.entity.SysAppConfig; |
| | | import com.panzhihua.service_user.entity.SysTemplateConfig; |
| | |
| | | import com.panzhihua.common.model.dtos.community.NoticeReadDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.ConvenientMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.DisableOrEnableConvenientMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberAddDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberEditAdminDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridMemberEditStatusDTO; |
| | |
| | | import com.panzhihua.common.model.vos.user.UserPhoneVO; |
| | | import com.panzhihua.common.utlis.IdCard; |
| | | import com.panzhihua.common.utlis.SensitiveUtil; |
| | | import com.panzhihua.common.utlis.SmsUtil; |
| | | import com.panzhihua.common.utlis.Snowflake; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.common.utlis.WxUtil; |
| | |
| | | @Slf4j |
| | | @Service |
| | | public class UserServiceImpl implements UserService { |
| | | |
| | | private static final String DEFAULT_IMAGE_URL = "https://www.psciio.com//idcard/91313573d071436ab1f934231b31c6e5.jpg"; |
| | | |
| | | @Resource |
| | | private UserDao userDao; |
| | | @Resource |
| | |
| | | BeanUtils.copyProperties(sysUserDO, loginUserInfoVO); |
| | | return R.ok(loginUserInfoVO); |
| | | } |
| | | |
| | | /** |
| | | * 微商业街新增商家账号 |
| | | * @param mcsMerchantDTO |
| | | * @return 商家用户id |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R addMcsMerchantUser(McsMerchantDTO mcsMerchantDTO) { |
| | | SysUserDO sysUserDO; |
| | | sysUserDO = userDao.selectOne(new QueryWrapper<SysUserDO>().lambda() |
| | | .eq(SysUserDO::getPhone, mcsMerchantDTO.getPhone()).eq(SysUserDO::getType, 11)); |
| | | String encode = new BCryptPasswordEncoder().encode(mcsMerchantDTO.getPassword()); |
| | | if (nonNull(sysUserDO)) { |
| | | sysUserDO.setAccount(mcsMerchantDTO.getAccount()); |
| | | sysUserDO.setStatus(mcsMerchantDTO.getAccountStatus()); |
| | | sysUserDO.setPhone(mcsMerchantDTO.getPhone()); |
| | | sysUserDO.setPassword(encode); |
| | | sysUserDO.setPlaintextPassword(mcsMerchantDTO.getPassword()); |
| | | sysUserDO.setImageUrl(mcsMerchantDTO.getLogo()); |
| | | sysUserDO.setName(mcsMerchantDTO.getName()); |
| | | userDao.updateById(sysUserDO); |
| | | McsLoginUserInfoVO loginUserInfoVO = new McsLoginUserInfoVO(); |
| | | BeanUtils.copyProperties(sysUserDO, loginUserInfoVO); |
| | | return R.ok(loginUserInfoVO); |
| | | } |
| | | // sys_user 表 |
| | | sysUserDO = new SysUserDO(); |
| | | BeanUtils.copyProperties(mcsMerchantDTO, sysUserDO); |
| | | sysUserDO.setAccount(mcsMerchantDTO.getAccount()); |
| | | sysUserDO.setType(11); |
| | | sysUserDO.setAreaId(null); |
| | | sysUserDO.setStatus(mcsMerchantDTO.getAccountStatus()); |
| | | sysUserDO.setPhone(mcsMerchantDTO.getPhone()); |
| | | sysUserDO.setPassword(encode); |
| | | sysUserDO.setPlaintextPassword(mcsMerchantDTO.getPassword()); |
| | | sysUserDO.setImageUrl(mcsMerchantDTO.getLogo()); |
| | | try { |
| | | userDao.insert(sysUserDO); |
| | | McsLoginUserInfoVO loginUserInfoVO = new McsLoginUserInfoVO(); |
| | | BeanUtils.copyProperties(sysUserDO, loginUserInfoVO); |
| | | return R.ok(loginUserInfoVO); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("修改数字商业街商家用户报错【{}】", e.getMessage()); |
| | | if (e.getMessage().contains("union_phone_type")) { |
| | | return R.fail("手机号已存在"); |
| | | } else if (e.getMessage().contains("union_account_type")) { |
| | | return R.fail("账户已经存在"); |
| | | }else if(e.getMessage().contains("23000")){ |
| | | return R.fail("手机号已存在"); |
| | | } else { |
| | | return R.fail("账户或手机号已存在,请重新填写尝试"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 微商业街修改商家账号 |
| | | * @param mcsMerchantDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R putMcsMerchantUser(McsMerchantDTO mcsMerchantDTO) { |
| | | SysUserDO sysUserDO = userDao.selectById(mcsMerchantDTO.getUserId()); |
| | | if (isNull(sysUserDO)) { |
| | | return R.fail("用户不存在"); |
| | | } |
| | | String account = mcsMerchantDTO.getAccount(); |
| | | String phone = mcsMerchantDTO.getPhone(); |
| | | Integer accountStatus = mcsMerchantDTO.getAccountStatus(); |
| | | String name = mcsMerchantDTO.getName(); |
| | | if (isNotBlank(account)) { |
| | | sysUserDO.setAccount(account); |
| | | } |
| | | if (isNotBlank(phone)) { |
| | | sysUserDO.setPhone(phone); |
| | | } |
| | | if (nonNull(accountStatus)) { |
| | | sysUserDO.setStatus(accountStatus); |
| | | } |
| | | if (isNotBlank(name)) { |
| | | sysUserDO.setName(name); |
| | | } |
| | | try { |
| | | userDao.updateById(sysUserDO); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("修改数字商业街商家用户报错【{}】", e.getMessage()); |
| | | if (e.getMessage().contains("union_phone_type")) { |
| | | return R.fail("手机号已存在"); |
| | | } else if (e.getMessage().contains("union_account_type")) { |
| | | return R.fail("账户已经存在"); |
| | | }else if(e.getMessage().contains("23000")){ |
| | | return R.fail("手机号已存在"); |
| | | } else { |
| | | return R.fail("账户或手机号已存在,请重新填写尝试"); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 检查用户是否有效 |
| | | * @param userId |
| | | * @param type |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Boolean checkUserIsValid(Long userId, Integer type) { |
| | | SysUserDO sysUserDO = userDao.selectById(userId); |
| | | if (isNull(sysUserDO) || sysUserDO.getStatus() != 1 || !sysUserDO.getType().equals(type)) { |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * 根据手机号、用户类型查询用户 |
| | | * @param phone |
| | | * @param type |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R getSysUserByPhone(String phone, Integer type) { |
| | | SysUserDO sysUserDO = userDao.selectOne(new QueryWrapper<SysUserDO>().lambda().eq(SysUserDO::getPhone, phone).eq(SysUserDO::getType, type)); |
| | | McsLoginUserInfoVO loginUserInfoVO = null; |
| | | if (nonNull(sysUserDO)) { |
| | | loginUserInfoVO = new McsLoginUserInfoVO(); |
| | | BeanUtils.copyProperties(sysUserDO, loginUserInfoVO); |
| | | } |
| | | return R.ok(loginUserInfoVO); |
| | | } |
| | | |
| | | /** |
| | | * 发送验证码 |
| | | * @param phone 手机号 |
| | | * @param clientIP 用户ip |
| | | * @param prefixKey redis Key 前缀 |
| | | * @param limit 获取次数限制 |
| | | * @param timeout 超次数获取时间等待 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R sendMessageCode(String phone, String clientIP, String prefixKey, Integer limit, Integer timeout) { |
| | | ValueOperations<String, String> opsForValue = stringRedisTemplate.opsForValue(); |
| | | if (isNotBlank(clientIP)) { |
| | | String redisKey = String.join("::", prefixKey, clientIP); |
| | | Long increment = opsForValue.increment(redisKey, 1); |
| | | if (increment > limit) { |
| | | return R.fail(String.format("请求过于频繁,请%d分钟后再次尝试!", timeout/60)); |
| | | } |
| | | stringRedisTemplate.expire(redisKey, timeout, TimeUnit.SECONDS); |
| | | } |
| | | Random r = new Random(); |
| | | StringBuilder rs = new StringBuilder(); |
| | | for (int i = 0; i < 5; i++) { |
| | | rs.append(r.nextInt(10)); |
| | | } |
| | | String code = rs.toString(); |
| | | int result = SmsUtil.sendCode(phone, code); |
| | | if (result == 1) { |
| | | String codeKey = String.join("::", phone, code); |
| | | opsForValue.set(codeKey, code, timeout, TimeUnit.SECONDS); |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | /** |
| | | * 根据openId获取微商业街用户 |
| | | * @param openid |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R getMcsUserByOpenId(String openid) { |
| | | SysUserDO sysUserDO = userDao.selectOne(new QueryWrapper<SysUserDO>().lambda().eq(SysUserDO::getOpenid, openid).eq(SysUserDO::getType, 11)); |
| | | McsLoginUserInfoVO loginUserInfoVO = null; |
| | | if (nonNull(sysUserDO) && isNotBlank(sysUserDO.getOpenid())) { |
| | | loginUserInfoVO = new McsLoginUserInfoVO(); |
| | | BeanUtils.copyProperties(sysUserDO, loginUserInfoVO); |
| | | } |
| | | return R.ok(loginUserInfoVO); |
| | | } |
| | | |
| | | /** |
| | | * 商业街用户微信授权-绑定手机号 |
| | | * @param bindUserPhoneDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R bindOrAddMcsUser(BindUserPhoneDTO bindUserPhoneDTO) { |
| | | String phone = bindUserPhoneDTO.getPhone(); |
| | | String openId = bindUserPhoneDTO.getOpenId(); |
| | | String redisKey = String.join("::", phone, bindUserPhoneDTO.getCode()); |
| | | Boolean hasKey = stringRedisTemplate.hasKey(redisKey); |
| | | if (hasKey) { |
| | | //通过验证 |
| | | SysUserDO sysUserDO = userDao.selectOne(new QueryWrapper<SysUserDO>().lambda().eq(SysUserDO::getPhone, phone).eq(SysUserDO::getType, 11)); |
| | | if (nonNull(sysUserDO)) { |
| | | //已有用户 |
| | | sysUserDO.setOpenid(openId); |
| | | int result = userDao.updateById(sysUserDO); |
| | | if (result > 0) { |
| | | McsLoginUserInfoVO loginUserInfoVO = new McsLoginUserInfoVO(); |
| | | BeanUtils.copyProperties(sysUserDO, loginUserInfoVO); |
| | | stringRedisTemplate.delete(redisKey); |
| | | return R.ok(loginUserInfoVO); |
| | | } |
| | | return R.fail("绑定失败,请重试"); |
| | | } else { |
| | | //自动创建用户 |
| | | McsMerchantDTO mcsMerchantDTO = new McsMerchantDTO(); |
| | | mcsMerchantDTO.setAccount(phone); |
| | | mcsMerchantDTO.setPassword("88888888"); |
| | | mcsMerchantDTO.setAccountStatus(1); |
| | | mcsMerchantDTO.setPhone(phone); |
| | | mcsMerchantDTO.setName("用户" + retrieveRandomCode(5)); |
| | | mcsMerchantDTO.setImageUrl(DEFAULT_IMAGE_URL); |
| | | mcsMerchantDTO.setOpenId(openId); |
| | | R addUserResult = addMcsMerchantUser(mcsMerchantDTO); |
| | | if (R.isOk(addUserResult)) { |
| | | McsLoginUserInfoVO loginUserInfoVO = JSONObject.parseObject(JSONObject.toJSONString(addUserResult.getData()), McsLoginUserInfoVO.class); |
| | | loginUserInfoVO.setPlaintextPassword("88888888"); |
| | | stringRedisTemplate.delete(redisKey); |
| | | return R.ok(loginUserInfoVO); |
| | | } |
| | | return addUserResult; |
| | | } |
| | | } else { |
| | | return R.fail("验证码错误"); |
| | | } |
| | | } |
| | | |
| | | private String retrieveRandomCode(int length) { |
| | | Random r = new Random(); |
| | | StringBuilder rs = new StringBuilder(); |
| | | for (int i = 0; i < length; i++) { |
| | | rs.append(r.nextInt(10)); |
| | | } |
| | | return rs.toString(); |
| | | } |
| | | } |
| | |
| | | <result property="workStartTime" column="work_start_time"/> |
| | | <result property="workEndTime" column="work_end_time"/> |
| | | <result property="bigAgeTips" column="big_age_tips"/> |
| | | <result property="plaintextPassword" column="plaintext_password"/> |
| | | |
| | | </resultMap> |
| | | <sql id="columns"> |
| | |
| | | <groupId>com.github.xiaoymin</groupId> |
| | | <artifactId>swagger-bootstrap-ui</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.github.binarywang</groupId> |
| | | <artifactId>weixin-java-miniapp</artifactId> |
| | | <version>3.9.9.B</version> |
| | | </dependency> |
| | | <!--添加监控依赖包--> |
| | | <dependency> |
| | | <groupId>io.micrometer</groupId> |
New file |
| | |
| | | package com.panzhihua.shop_backstage.aop; |
| | | |
| | | import static java.util.Objects.nonNull; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import org.aspectj.lang.JoinPoint; |
| | | import org.aspectj.lang.annotation.Aspect; |
| | | import org.aspectj.lang.annotation.Before; |
| | | import org.aspectj.lang.reflect.MethodSignature; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.web.context.request.RequestAttributes; |
| | | import org.springframework.web.context.request.RequestContextHolder; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.constants.Constants; |
| | | import com.panzhihua.common.constants.TokenConstant; |
| | | import com.panzhihua.common.exceptions.ServiceException; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsMerchantVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.AES; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * @title: CheckExpirationInterceptor |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 过期检测拦截器 |
| | | * @author: hans |
| | | * @date: 2022/01/11 10:36 |
| | | */ |
| | | @Aspect |
| | | @Component |
| | | @Slf4j |
| | | public class CheckExpirationInterceptor { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @Before("@annotation(com.panzhihua.shop_backstage.aop.CheckMcsMerchantExpiration)") |
| | | public void checkExpiration(JoinPoint joinPoint) { |
| | | MethodSignature signature = (MethodSignature) joinPoint.getSignature(); |
| | | log.info("拦截方法:【{}】", signature.getMethod().getName()); |
| | | // 获取RequestAttributes |
| | | RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes(); |
| | | // 从获取RequestAttributes中获取HttpServletRequest的信息 |
| | | HttpServletRequest request = (HttpServletRequest)requestAttributes.resolveReference(RequestAttributes.REFERENCE_REQUEST); |
| | | // 登录对象信息 |
| | | String userInfo = request.getHeader(TokenConstant.TOKEN_USERINFO); |
| | | boolean empty = ObjectUtils.isEmpty(userInfo); |
| | | if (empty) { |
| | | log.error("获取登录用户信息失败【{}】", joinPoint); |
| | | throw new ServiceException("获取登录用户信息失败"); |
| | | } |
| | | byte[] bytes = AES.parseHexStr2Byte(userInfo); |
| | | byte[] decrypt = AES.decrypt(bytes, Constants.AES_KEY); |
| | | userInfo = new String(decrypt); |
| | | LoginUserInfoVO loginUserInfoVO = JSONObject.parseObject(userInfo, LoginUserInfoVO.class); |
| | | R retrieveResult = communityService.retrieveMcsMerchantInfoByUserId(loginUserInfoVO.getUserId()); |
| | | if (R.isOk(retrieveResult) && nonNull(retrieveResult.getData())) { |
| | | McsMerchantVO mcsMerchantVO = JSONObject.parseObject(JSONObject.toJSONString(retrieveResult.getData()), McsMerchantVO.class); |
| | | Date expireAt = mcsMerchantVO.getExpireAt(); |
| | | if (expireAt.before(new Date())) { |
| | | throw new ServiceException("账户已过期,请及时续费"); |
| | | } |
| | | } else { |
| | | throw new ServiceException("未查询到商户信息"); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.shop_backstage.aop; |
| | | |
| | | import java.lang.annotation.Documented; |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | /** |
| | | * @title: CheckMcsMerchantExpiration |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 微商业街商家是否到期统一检测 |
| | | * @author: hans |
| | | * @date: 2022/01/11 10:28 |
| | | */ |
| | | @Target(ElementType.METHOD) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Documented |
| | | public @interface CheckMcsMerchantExpiration { |
| | | |
| | | } |
| | |
| | | |
| | | import static org.apache.commons.lang3.StringUtils.isBlank; |
| | | |
| | | import java.io.File; |
| | | import java.io.InputStream; |
| | | import java.util.ArrayList; |
| | | import java.util.Comparator; |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.validation.Valid; |
| | | |
| | | import com.panzhihua.common.model.vos.UploadFilesVO; |
| | | import org.apache.commons.io.FilenameUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "上传文件-可批量") |
| | | @PostMapping(value = "/upload/files", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | | public R uploadFiles(@RequestParam MultipartFile[] file, HttpServletRequest request) { |
| | | List<UploadFilesVO> urlList = new ArrayList<>(); |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | for (MultipartFile f : file) { |
| | | String fileExtension = FilenameUtils.getExtension(f.getOriginalFilename()); |
| | | String name = UUID.randomUUID().toString().replaceAll("-", "") + fileExtension; |
| | | try { |
| | | InputStream is = f.getInputStream(); |
| | | String fileName = |
| | | UUID.randomUUID().toString().replace("-", "") + fileExtension; |
| | | File file1 = new File(fileName); |
| | | f.transferTo(file1); |
| | | boolean delete = file1.delete(); |
| | | log.info("临时文件删除【{}】", delete); |
| | | sftp.uploadMore(FtpConstants.FTPFILEPATH_IDCARD, name, is); |
| | | UploadFilesVO fileVO = new UploadFilesVO(); |
| | | fileVO.setUrl(url + "idcard/" + name); |
| | | urlList.add(fileVO); |
| | | } catch (Exception e) { |
| | | log.error("上传文件失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | sftp.logout(); |
| | | return R.ok(urlList); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增产品分类") |
| | | @PostMapping("/product-category/add") |
| | | public R addProductCategory(@RequestBody @Validated(AddGroup.class) ConvenientProductCategoryDTO convenientProductCategoryDTO) { |
New file |
| | |
| | | package com.panzhihua.shop_backstage.api; |
| | | |
| | | |
| | | import java.io.IOException; |
| | | import java.io.PrintWriter; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import org.json.XML; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.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.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsOrderVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | |
| | | /** |
| | | * 商业街订单表(McsOrder)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2022-01-04 16:10:07 |
| | | */ |
| | | @Api(tags = {"商业街订单API"}) |
| | | @RestController |
| | | @RequestMapping("mcsOrder") |
| | | public class McsOrderApi extends BaseController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @ApiOperation(value = "分页查询订单",response = McsOrderVO.class) |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | commonPage.setUserId(this.getUserId()); |
| | | return communityService.selectAllMscOrder(commonPage); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @ApiOperation(value = "通过主键查询单条数据",response = McsOrderVO.class) |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable("id") Long id) { |
| | | return communityService.selectOneMscOrder(id); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param mcsOrderVO 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @ApiOperation("新增数据") |
| | | @PostMapping |
| | | public R insert(@RequestBody McsOrderVO mcsOrderVO) { |
| | | mcsOrderVO.setUserId(this.getUserId()); |
| | | return communityService.insertMscOrder(mcsOrderVO); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param mcsOrderVO 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @ApiOperation("修改订单") |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody McsOrderVO mcsOrderVO) { |
| | | return communityService.updateMscOrder(mcsOrderVO); |
| | | } |
| | | |
| | | /** |
| | | * 微信支付 |
| | | * @param mcsOrderVO |
| | | * @return |
| | | */ |
| | | @ApiOperation("微信支付") |
| | | @PostMapping("/wxPay") |
| | | public R wxPay(@RequestBody McsOrderVO mcsOrderVO){ |
| | | String clientIp = this.getRequest().getHeader("X-Real-IP"); |
| | | mcsOrderVO.setClientIp(clientIp); |
| | | return communityService.wxPayMscOrder(mcsOrderVO); |
| | | } |
| | | |
| | | /** |
| | | * 发送提醒短信 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation("发送提醒短信") |
| | | @GetMapping("/sendContent") |
| | | public R sendContent(@RequestParam("id") Long id){ |
| | | return communityService.sendContentMcsOrder(id); |
| | | } |
| | | /** |
| | | *微信支付回调 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation("微信支付回调") |
| | | @PostMapping("wxNotify") |
| | | public void payCallback(HttpServletRequest request, HttpServletResponse response) { |
| | | String inputLine = ""; |
| | | String notityXml = ""; |
| | | try { |
| | | while ((inputLine = request.getReader().readLine()) != null) { |
| | | notityXml += inputLine; |
| | | } |
| | | // 关闭流 |
| | | request.getReader().close(); |
| | | // 解析成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")) { |
| | | McsOrderVO mcsOrderVO = new McsOrderVO(); |
| | | // 订单号 |
| | | String orderTradeNo = resultData.getString("out_trade_no"); |
| | | mcsOrderVO.setOrderNo(orderTradeNo); |
| | | // 微信支付订单号 |
| | | String wxTradeNo = resultData.getString("transaction_id"); |
| | | mcsOrderVO.setPayNo(wxTradeNo); |
| | | // 支付完成时间 |
| | | String payTime = resultData.getString("time_end"); |
| | | mcsOrderVO.setPayTime(DateUtils.stringToDate(payTime,DateUtils.format_yyyyMMddHHmmss)); |
| | | // 现金支付金额 |
| | | mcsOrderVO.setStatus(1); |
| | | |
| | | // 根据订单号修改订单信息 |
| | | communityService.notifyMcsOrder(mcsOrderVO); |
| | | |
| | | // 封装 返回值 |
| | | 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.shop_backstage.api; |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | |
| | | import java.util.regex.Pattern; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.util.ObjectUtils; |
| | | 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.JSONObject; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.BindUserPhoneDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.DeleteProductDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.LoginWithPhoneDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsEvaluateDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsGameDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsInfoDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsProductDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageJoinGameListDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsEvaluateDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsGameDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsInformationDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsProductDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageVerifyRecordDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PutUserInfoDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetShelfForGameDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetShelfForInfoDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetShelfForProductDTO; |
| | | 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.microCommercialStreet.GameStatisticsVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.IndexTopStatisticsVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsConfigVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsCouponVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsEvaluateVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsGameVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsInformationVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsLabelVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsLoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsMerchantVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsProductVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsVerifyRecordVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.MyCouponVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.TopStatisticsVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.VerifiedReturnVO; |
| | | 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.AddGroup; |
| | | import com.panzhihua.common.validated.PutGroup; |
| | | import com.panzhihua.shop_backstage.aop.CheckMcsMerchantExpiration; |
| | | import com.panzhihua.shop_backstage.config.WxMaConfiguration; |
| | | import com.panzhihua.shop_backstage.model.request.LoginRequest; |
| | | import com.panzhihua.shop_backstage.model.vos.LoginBody; |
| | | |
| | | 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; |
| | | |
| | | /** |
| | | * @title: MicroCommercialStreetApi |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 微商业街相关接口 |
| | | * @author: hans |
| | | * @date: 2021/12/28 14:18 |
| | | */ |
| | | @Api(tags = {"微商业街"}) |
| | | @RestController |
| | | @RequestMapping("/microcommercialstreet") |
| | | @Slf4j |
| | | public class MicroCommercialStreetApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private UserService userService; |
| | | @Resource |
| | | private WxMaConfiguration wxMaConfiguration; |
| | | |
| | | @ApiOperation(value = "H5授权登录", response = LoginReturnVO.class) |
| | | @PostMapping("/auth/login") |
| | | public R mcsAuthLogin(@RequestBody LoginRequest loginRequest) { |
| | | String code = loginRequest.getCode(); |
| | | if (ObjectUtils.isEmpty(code)) { |
| | | return R.fail("缺少登录参数"); |
| | | } |
| | | log.info(code); |
| | | String openid = wxMaConfiguration.retrieveOpenId(code); |
| | | if (isNull(openid)) { |
| | | return R.fail("登录失败"); |
| | | } |
| | | R r = userService.getMcsUserByOpenId(openid); |
| | | if (R.isOk(r) && nonNull(r.getData())) { |
| | | McsLoginUserInfoVO loginUserInfoVO = JSONObject.parseObject(JSONObject.toJSONString(r.getData()), McsLoginUserInfoVO.class); |
| | | return tokenService.loginMcsUser(loginUserInfoVO.getAccount(), loginUserInfoVO.getPlaintextPassword()); |
| | | } |
| | | LoginReturnVO loginReturnVO = new LoginReturnVO(); |
| | | loginReturnVO.setOpenId(openid); |
| | | return R.ok(loginReturnVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取绑定验证码") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "phone", value = "手机号", required = true) |
| | | }) |
| | | @GetMapping("/bind/verifyCode") |
| | | public R getBindVerifyCode(@RequestParam("phone") String phone) { |
| | | if (!assertPhoneIsValid(phone)) { |
| | | return R.fail("手机号格式错误"); |
| | | } |
| | | String clientIP = this.getRequest().getHeader("X-Real-IP"); |
| | | log.info("获取验证码用户ip信息【{}】", clientIP); |
| | | try { |
| | | return userService.sendMessageCode(phone, clientIP, "MCS_BIND_WITH_PHONE", 5, 5 * 60); |
| | | } catch (Exception e) { |
| | | return R.fail("获取失败"); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "微信授权-绑定手机号", response = LoginReturnVO.class) |
| | | @PostMapping("/bindPhone") |
| | | public R bindOrAddMcsUser(@RequestBody @Valid BindUserPhoneDTO bindUserPhoneDTO) { |
| | | R r = userService.bindOrAddMcsUser(bindUserPhoneDTO); |
| | | Boolean isValid = false; |
| | | if (R.isOk(r) && r.getData() != null) { |
| | | McsLoginUserInfoVO loginUserInfoVO = JSONObject.parseObject(JSONObject.toJSONString(r.getData()), McsLoginUserInfoVO.class); |
| | | isValid = loginUserInfoVO.getStatus() == 1; |
| | | if (isValid) { |
| | | R result = tokenService.loginMcsUser(loginUserInfoVO.getAccount(), loginUserInfoVO.getPlaintextPassword()); |
| | | return result; |
| | | } else { |
| | | return R.fail("账号被禁用"); |
| | | } |
| | | } |
| | | return R.fail(r.getMsg()); |
| | | } |
| | | |
| | | @ApiOperation(value = "微商业街商家后台登录", response = LoginReturnVO.class) |
| | | @PostMapping("/merchant/login") |
| | | public R merchantLogin(@RequestBody @Valid LoginBody loginBody) { |
| | | String account = loginBody.getAccount(); |
| | | log.info("登录用户信息【{}】", loginBody); |
| | | try { |
| | | R r = communityService.getMcsMerchantByAccount(account); |
| | | Boolean isValid = false; |
| | | if (R.isOk(r) && r.getData() != null) { |
| | | McsMerchantVO merchantVO = JSONObject.parseObject(JSONObject.toJSONString(r.getData()), McsMerchantVO.class); |
| | | isValid = merchantVO.getAccountStatus() == 1; |
| | | if (isValid) { |
| | | R result = tokenService.loginMcsUser(account, loginBody.getPassword()); |
| | | return result; |
| | | } else { |
| | | return R.fail("账号被禁用"); |
| | | } |
| | | } |
| | | return R.fail(r.getMsg()); |
| | | } catch (Exception e) { |
| | | return R.fail("登陆失败了"); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "微商业街用户登录", response = LoginReturnVO.class) |
| | | @PostMapping("/loginWithPhone") |
| | | public R loginWithPhone(@RequestBody @Valid LoginWithPhoneDTO loginDTO) { |
| | | log.info("登录用户信息【{}】", loginDTO); |
| | | try { |
| | | R r = communityService.loginWithPhone(loginDTO); |
| | | Boolean isValid = false; |
| | | if (R.isOk(r) && r.getData() != null) { |
| | | McsLoginUserInfoVO loginUserInfoVO = JSONObject.parseObject(JSONObject.toJSONString(r.getData()), McsLoginUserInfoVO.class); |
| | | isValid = loginUserInfoVO.getStatus() == 1; |
| | | if (isValid) { |
| | | R result = tokenService.loginMcsUser(loginUserInfoVO.getAccount(), loginUserInfoVO.getPlaintextPassword()); |
| | | return result; |
| | | } else { |
| | | return R.fail("账号被禁用"); |
| | | } |
| | | } |
| | | return R.fail(r.getMsg()); |
| | | } catch (Exception e) { |
| | | return R.fail("登陆失败了"); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "获取登录验证码") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "phone", value = "手机号", required = true) |
| | | }) |
| | | @GetMapping("/verifyCode") |
| | | public R getLoginVerifyCode(@RequestParam("phone") String phone) { |
| | | if (!assertPhoneIsValid(phone)) { |
| | | return R.fail("手机号格式错误"); |
| | | } |
| | | String clientIP = this.getRequest().getHeader("X-Real-IP"); |
| | | log.info("获取验证码用户ip信息【{}】", clientIP); |
| | | try { |
| | | return userService.sendMessageCode(phone, clientIP, "MCS_LOGIN_WITH_PHONE", 5, 5 * 60); |
| | | } catch (Exception e) { |
| | | return R.fail("获取失败"); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "当前登录用户信息", response = McsLoginUserInfoVO.class) |
| | | @GetMapping("/userInfo") |
| | | public R detailUser() { |
| | | Long userId = this.getUserId(); |
| | | R<LoginUserInfoVO> loginUserInfoVOR = userService.detailUser(userId); |
| | | try { |
| | | LoginUserInfoVO loginUserInfoVO = |
| | | JSONObject.parseObject(JSONObject.toJSONString(loginUserInfoVOR.getData()), LoginUserInfoVO.class); |
| | | loginUserInfoVO.setPassword("******"); |
| | | R<McsMerchantVO> mcsMerchantVOR = communityService.getMcsMerchantByAccount(loginUserInfoVO.getAccount()); |
| | | McsLoginUserInfoVO mcsLoginUserInfoVO = new McsLoginUserInfoVO(); |
| | | BeanUtils.copyProperties(loginUserInfoVO, mcsLoginUserInfoVO); |
| | | if (R.isOk(mcsMerchantVOR) && mcsMerchantVOR.getData() != null) { |
| | | McsMerchantVO mcsMerchantVO = |
| | | JSONObject.parseObject(JSONObject.toJSONString(mcsMerchantVOR.getData()), McsMerchantVO.class); |
| | | mcsLoginUserInfoVO.setMcsMerchantVO(mcsMerchantVO); |
| | | } |
| | | return R.ok(mcsLoginUserInfoVO); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return R.fail("获取用户信息失败"); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "修改用戶信息") |
| | | @PutMapping("/putUserInfo") |
| | | public R putUserInfo(@RequestBody PutUserInfoDTO putUserInfoDTO) { |
| | | putUserInfoDTO.setUserId(this.getUserId()); |
| | | return communityService.putUserInfo(putUserInfoDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增戳戳游戏") |
| | | @PostMapping("/game/add") |
| | | public R addMcsGame(@RequestBody @Validated(AddGroup.class) McsGameDTO mcsGameDTO) { |
| | | Long userId = this.getUserId(); |
| | | mcsGameDTO.setCreatedBy(userId); |
| | | mcsGameDTO.setUpdatedBy(userId); |
| | | return communityService.addMcsGame(mcsGameDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "编辑戳戳游戏") |
| | | @PutMapping("/game/put") |
| | | public R putMcsGame(@RequestBody @Validated(PutGroup.class) McsGameDTO mcsGameDTO) { |
| | | mcsGameDTO.setUpdatedBy(this.getUserId()); |
| | | return communityService.putMcsGame(mcsGameDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "发布戳戳游戏") |
| | | @CheckMcsMerchantExpiration |
| | | @ApiImplicitParam(name = "gameId", value = "游戏id", required = true) |
| | | @GetMapping("/game/publish") |
| | | public R publishMcsGame(@RequestParam("gameId") Long gameId) { |
| | | return communityService.publishMcsGame(gameId, this.getUserId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "结束戳戳游戏") |
| | | @ApiImplicitParam(name = "gameId", value = "游戏id", required = true) |
| | | @GetMapping("/game/finish") |
| | | public R finishMcsGame(@RequestParam("gameId") Long gameId) { |
| | | return communityService.finishMcsGame(gameId, this.getUserId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "商家分页查询戳戳游戏", response = McsGameVO.class) |
| | | @PostMapping("/game/page") |
| | | public R pageMcsGame(@RequestBody @Valid PageMcsGameDTO pageMcsGameDTO) { |
| | | pageMcsGameDTO.setUserId(this.getUserId()); |
| | | return communityService.pageMcsGame(pageMcsGameDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "上架/下架戳戳游戏") |
| | | @CheckMcsMerchantExpiration |
| | | @PutMapping("/game/setShelf") |
| | | public R setShelfForGame(@RequestBody @Valid SetShelfForGameDTO setShelfForGameDTO) { |
| | | setShelfForGameDTO.setUpdatedBy(this.getUserId()); |
| | | return communityService.setShelfForGame(setShelfForGameDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除戳戳游戏") |
| | | @ApiImplicitParam(name = "gameId", value = "游戏id", required = true) |
| | | @DeleteMapping("/game/delete") |
| | | public R deleteMcsGame(@RequestParam("gameId") Long gameId) { |
| | | return communityService.deleteMcsGame(gameId, this.getUserId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "戳戳游戏/资讯顶部统计数据", response = TopStatisticsVO.class) |
| | | @ApiImplicitParam(name = "type", value = "类型(1.戳戳游戏 2.戳戳资讯)", required = true) |
| | | @GetMapping("/statistics/top") |
| | | public R getTopStatistics(@RequestParam("type") Integer type) { |
| | | return communityService.getTopStatistics(type, this.getUserId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增戳戳资讯") |
| | | @PostMapping("/information/add") |
| | | public R addMcsInfo(@RequestBody @Validated(AddGroup.class) McsInfoDTO mcsInfoDTO) { |
| | | Long userId = this.getUserId(); |
| | | mcsInfoDTO.setCreatedBy(userId); |
| | | mcsInfoDTO.setUpdatedBy(userId); |
| | | return communityService.addMcsInfo(mcsInfoDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "编辑戳戳资讯") |
| | | @PutMapping("/information/put") |
| | | public R putMcsInfo(@RequestBody @Validated(PutGroup.class) McsInfoDTO mcsInfoDTO) { |
| | | mcsInfoDTO.setUpdatedBy(this.getUserId()); |
| | | return communityService.putMcsInfo(mcsInfoDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "发布戳戳资讯") |
| | | @ApiImplicitParam(name = "infoId", value = "资讯id", required = true) |
| | | @CheckMcsMerchantExpiration |
| | | @GetMapping("/information/publish") |
| | | public R publishMcsInfo(@RequestParam("infoId") Long infoId) { |
| | | return communityService.publishMcsInfo(infoId, this.getUserId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "商家分页查询戳戳资讯", response = McsInformationVO.class) |
| | | @PostMapping("/information/page") |
| | | public R pageMcsInfo(@RequestBody @Valid PageMcsInformationDTO pageMcsInformationDTO) { |
| | | pageMcsInformationDTO.setUserId(this.getUserId()); |
| | | return communityService.pageMcsInfo(pageMcsInformationDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "上架/下架戳戳资讯") |
| | | @CheckMcsMerchantExpiration |
| | | @PutMapping("/information/setShelf") |
| | | public R setShelfForMcsInfo(@RequestBody @Valid SetShelfForInfoDTO setShelfForInfoDTO) { |
| | | setShelfForInfoDTO.setUpdatedBy(this.getUserId()); |
| | | return communityService.setShelfForMcsInfo(setShelfForInfoDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除戳戳资讯") |
| | | @ApiImplicitParam(name = "infoId", value = "资讯id", required = true) |
| | | @DeleteMapping("/information/delete") |
| | | public R deleteMcsInfo(@RequestParam("infoId") Long infoId) { |
| | | return communityService.deleteMcsInfo(infoId, this.getUserId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "编辑数字商业街商家") |
| | | @PutMapping("/merchant/put") |
| | | public R putMcsMerchant(@RequestBody @Validated(PutGroup.class) McsMerchantDTO mcsMerchantDTO) { |
| | | mcsMerchantDTO.setUpdatedBy(this.getUserId()); |
| | | return communityService.putMcsMerchant(mcsMerchantDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询数字商业街商家详情", response = McsMerchantVO.class) |
| | | @ApiImplicitParam(name = "merchantId", value = "商家id", required = true) |
| | | @GetMapping("/merchant/get") |
| | | public R getMcsMerchant(@RequestParam("merchantId") Long merchantId) { |
| | | return communityService.getMcsMerchant(merchantId); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增产品信息") |
| | | @PostMapping("/product/add") |
| | | public R addMcsProduct(@RequestBody @Validated(AddGroup.class) McsProductDTO mcsProductDTO) { |
| | | Long userId = this.getUserId(); |
| | | mcsProductDTO.setCreatedBy(userId); |
| | | mcsProductDTO.setUpdatedBy(userId); |
| | | return communityService.addMcsProduct(mcsProductDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "编辑产品信息") |
| | | @PutMapping("/product/put") |
| | | public R putMcsProduct(@RequestBody @Validated(PutGroup.class) McsProductDTO mcsProductDTO) { |
| | | mcsProductDTO.setUpdatedBy(this.getUserId()); |
| | | return communityService.putMcsProduct(mcsProductDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除产品信息") |
| | | @PostMapping("/product/delete") |
| | | public R deleteMcsProduct(@RequestBody @Valid DeleteProductDTO deleteProductDTO) { |
| | | deleteProductDTO.setUpdatedBy(this.getUserId()); |
| | | return communityService.deleteMcsProduct(deleteProductDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取产品信息详情") |
| | | @ApiImplicitParam(name = "productId", value = "产品id", required = true) |
| | | @GetMapping("/product/get") |
| | | public R getMcsProduct(@RequestParam("productId") Long productId) { |
| | | return communityService.getMcsProduct(productId); |
| | | } |
| | | |
| | | @ApiOperation(value = "上架/下架产品信息") |
| | | @CheckMcsMerchantExpiration |
| | | @PutMapping("/product/setShelf") |
| | | public R setShelfForMcsProduct(@RequestBody @Valid SetShelfForProductDTO setShelfForProductDTO) { |
| | | setShelfForProductDTO.setUpdatedBy(this.getUserId()); |
| | | return communityService.setShelfForMcsProduct(setShelfForProductDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询产品信息", response = McsProductVO.class) |
| | | @PostMapping("/product/page") |
| | | public R pageMcsProduct(@RequestBody @Valid PageMcsProductDTO pageMcsProductDTO) { |
| | | pageMcsProductDTO.setUserId(this.getUserId()); |
| | | return communityService.pageMcsProduct(pageMcsProductDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取产品标签列表", response = McsLabelVO.class) |
| | | @GetMapping("/label/list") |
| | | public R getMcsLabelList() { |
| | | return communityService.getMcsLabelList(this.getUserId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "首页顶部数据", response = IndexTopStatisticsVO.class) |
| | | @GetMapping("/index/topData") |
| | | public R getMcsIndexTopData() { |
| | | return communityService.getMcsIndexTopData(); |
| | | } |
| | | |
| | | @ApiOperation(value = "戳戳卷领取", response = McsCouponVO.class) |
| | | @ApiImplicitParam(name = "gameId", value = "戳戳游戏id", required = true) |
| | | @GetMapping("/coupon/apply") |
| | | public R applyMcsCoupon(@RequestParam("gameId") Long gameId) { |
| | | Long userId = this.getUserId(); |
| | | R r = communityService.retrieveMcsMerchantInfoByUserId(userId); |
| | | if (R.isOk(r) && nonNull(r.getData())) { |
| | | return R.fail("商家不能参与活动"); |
| | | } |
| | | return communityService.applyMcsCoupon(gameId, userId); |
| | | } |
| | | |
| | | @ApiOperation(value = "h5分页查询戳戳资讯", response = McsInformationVO.class) |
| | | @PostMapping("/information/pageH5") |
| | | public R pageH5McsInfo(@RequestBody @Valid PageMcsInformationDTO pageMcsInformationDTO) { |
| | | return communityService.pageH5McsInfo(pageMcsInformationDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "h5分页查询戳戳游戏", response = McsGameVO.class) |
| | | @PostMapping("/game/pageH5") |
| | | public R pageH5McsGame(@RequestBody @Valid PageMcsGameDTO pageMcsGameDTO) { |
| | | return communityService.pageH5McsGame(pageMcsGameDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "游戏详情", response = McsGameVO.class) |
| | | @ApiImplicitParam(name = "gameId", value = "游戏id", required = true) |
| | | @GetMapping("/game/get") |
| | | public R getMcsGame(@RequestParam("gameId") Long gameId) { |
| | | return communityService.getMcsGame(gameId); |
| | | } |
| | | |
| | | @ApiOperation(value = "资讯详情", response = McsInformationVO.class) |
| | | @ApiImplicitParam(name = "infoId", value = "资讯id", required = true) |
| | | @GetMapping("/info/get") |
| | | public R getMcsInfo(@RequestParam("infoId") Long infoId) { |
| | | return communityService.getMcsInfo(infoId); |
| | | } |
| | | |
| | | @ApiOperation(value = "H5分页查询数字商业街商家", response = McsMerchantVO.class) |
| | | @PostMapping("/merchant/pageH5") |
| | | public R pageH5McsMerchant(@RequestBody @Valid PageMcsMerchantDTO pageMcsMerchantDTO) { |
| | | return communityService.pageH5McsMerchant(pageMcsMerchantDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "我的戳戳卷", response = MyCouponVO.class) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "type", value = "类型(1.戳戳币 2.免费体验)") |
| | | }) |
| | | @GetMapping("/myCoupon") |
| | | public R getMyCoupon(@RequestParam(value = "type", required = false) Integer type) { |
| | | return communityService.getMyCoupon(type, this.getUserId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "我的评价-参与游戏列表", response = McsCouponVO.class) |
| | | @PostMapping("/joinGame/page") |
| | | public R getJoinGameList(@RequestBody @Valid PageJoinGameListDTO pageJoinGameListDTO) { |
| | | pageJoinGameListDTO.setUserId(this.getUserId()); |
| | | return communityService.getJoinGameList(pageJoinGameListDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取所有数字商业街配置", response = McsConfigVO.class) |
| | | @GetMapping("/config/all") |
| | | public R getAllMcsConfig() { |
| | | return communityService.getAllMcsConfig(); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增评价记录") |
| | | @PostMapping("/evaluate/add") |
| | | public R addMcsEvaluate(@RequestBody @Validated(AddGroup.class) McsEvaluateDTO mcsEvaluateDTO) { |
| | | mcsEvaluateDTO.setUserId(this.getUserId()); |
| | | return communityService.addMcsEvaluate(mcsEvaluateDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "戳戳卷核销", response = VerifiedReturnVO.class) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "couponId", value = "戳戳卷id", required = true) |
| | | }) |
| | | @CheckMcsMerchantExpiration |
| | | @GetMapping("/coupon/verify") |
| | | public R verifyMcsCoupon(@RequestParam("couponId") Long couponId) { |
| | | return communityService.verifyMcsCoupon(couponId, this.getUserId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询核销记录", response = McsVerifyRecordVO.class) |
| | | @PostMapping("/verifyRecord/page") |
| | | public R pageMcsVerifyRecord(@RequestBody @Valid PageVerifyRecordDTO pageVerifyRecordDTO) { |
| | | pageVerifyRecordDTO.setUserId(this.getUserId()); |
| | | return communityService.pageMcsVerifyRecord(pageVerifyRecordDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "游戏统计", response = GameStatisticsVO.class) |
| | | @GetMapping("/game/statistics") |
| | | public R getMcsGameStatistics() { |
| | | return communityService.getMcsGameStatistics(this.getUserId()); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "分页查询评价记录", response = McsEvaluateVO.class) |
| | | @PostMapping("/evaluate/page") |
| | | public R pageMcsEvaluate(@RequestBody @Valid PageMcsEvaluateDTO pageMcsEvaluateDTO) { |
| | | pageMcsEvaluateDTO.setUserId(this.getUserId()); |
| | | return communityService.pageMcsEvaluate(pageMcsEvaluateDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询评价记录详情", response = McsEvaluateVO.class) |
| | | @ApiImplicitParam(name = "evaluateId", value = "评论id", required = true) |
| | | @GetMapping("/evaluate/get") |
| | | public R getMcsEvaluate(@RequestParam("evaluateId") Long evaluateId) { |
| | | return communityService.getMcsEvaluate(evaluateId); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除评价记录") |
| | | @ApiImplicitParam(name = "evaluateId", value = "评论id", required = true) |
| | | @DeleteMapping("/evaluate/delete") |
| | | public R deleteMcsEvaluate(@RequestParam("evaluateId") Long evaluateId) { |
| | | return communityService.deleteMcsEvaluate(evaluateId); |
| | | } |
| | | |
| | | @ApiOperation(value = "testTimeJob") |
| | | @GetMapping("/testTimeJob") |
| | | public R testTimeJob() { |
| | | return communityService.offResourceForMcsMerchant(); |
| | | } |
| | | |
| | | private Boolean assertPhoneIsValid(String phone) { |
| | | String regexp = "^(13[0-9]|14[01456879]|15[0-3,5-9]|16[2567]|17[0-8]|18[0-9]|19[0-3,5-9])\\d{8}$"; |
| | | return Pattern.matches(regexp, phone); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.shop_backstage.config; |
| | | |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: 微信配置 |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-11-23 14:52 |
| | | **/ |
| | | @Data |
| | | @Component |
| | | @ConfigurationProperties(prefix = "wx.h5") |
| | | public class WxH5Properties { |
| | | |
| | | /** |
| | | * 设置微信小程序的appid |
| | | */ |
| | | private String appid; |
| | | |
| | | /** |
| | | * 设置微信小程序的Secret |
| | | */ |
| | | private String secret; |
| | | |
| | | /** |
| | | * 设置微信小程序消息服务器配置的token |
| | | */ |
| | | private String token; |
| | | |
| | | /** |
| | | * 设置微信小程序消息服务器配置的EncodingAESKey |
| | | */ |
| | | private String aesKey; |
| | | |
| | | /** |
| | | * 消息格式,XML或者JSON |
| | | */ |
| | | private String msgDataFormat; |
| | | |
| | | /** |
| | | * 商户号 |
| | | */ |
| | | private String mchId; |
| | | |
| | | /** |
| | | * 微信支付密钥 |
| | | */ |
| | | private String payKey; |
| | | |
| | | /** |
| | | * 微信支付回调地址 |
| | | */ |
| | | private String notifyUrl; |
| | | } |
New file |
| | |
| | | package com.panzhihua.shop_backstage.config; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.utlis.HttpUtils; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: wexin |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-11-23 15:07 |
| | | **/ |
| | | @Slf4j |
| | | @Component |
| | | public class WxMaConfiguration { |
| | | |
| | | private static final String OAUTH2_URL = "https://api.weixin.qq.com/sns/oauth2/access_token"; |
| | | |
| | | @Resource |
| | | private WxH5Properties wxH5Properties; |
| | | |
| | | public String retrieveOpenId(String code) { |
| | | HashMap<String, String> params = new HashMap<>(); |
| | | params.put("appid", wxH5Properties.getAppid()); |
| | | params.put("secret", wxH5Properties.getSecret()); |
| | | params.put("code", code); |
| | | params.put("grant_type", "authorization_code"); |
| | | String result = HttpUtils.sendGet(OAUTH2_URL, createLinkStringByGet(params)); |
| | | try { |
| | | JSONObject parseObject = JSONObject.parseObject(result); |
| | | if (parseObject.containsKey("openid")) { |
| | | String openid = parseObject.get("openid").toString(); |
| | | log.info("网页授权获取到openId:【{}】", openid); |
| | | return openid; |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("网页授权失败"); |
| | | e.printStackTrace(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | private static String createLinkStringByGet(Map<String, String> params) { |
| | | List<String> keys = new ArrayList<>(params.keySet()); |
| | | Collections.sort(keys); |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | for (int i = 0; i < keys.size(); i++) { |
| | | String key = keys.get(i); |
| | | String value = params.get(key); |
| | | if (i == keys.size() - 1) { |
| | | stringBuilder.append(key).append("=").append(value); |
| | | } else { |
| | | stringBuilder.append(key).append("=").append(value).append("&"); |
| | | } |
| | | } |
| | | return stringBuilder.toString(); |
| | | } |
| | | } |
| | |
| | | package com.panzhihua.shop_backstage.filter; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.Filter; |
| | |
| | | |
| | | String uri = request.getRequestURI(); |
| | | boolean isDoc = uri.contains("doc.html") || uri.contains("-docs"); |
| | | boolean convenientLogin = "/convenient/login".equals(uri); |
| | | boolean isConvenientReq = uri.contains("/convenient"); |
| | | boolean storeLogin = "/login".equals(uri); |
| | | boolean isLogin = uri.contains("login"); |
| | | boolean mcsGetCode = uri.contains("/microcommercialstreet/verifyCode") || uri.contains("/microcommercialstreet/bind/verifyCode"); |
| | | boolean mcsBindPhone = uri.contains("/microcommercialstreet/bindPhone"); |
| | | boolean wxNotify = uri.contains("/wxNotify"); |
| | | boolean getConfig = uri.contains("/config/all"); |
| | | boolean isUpload = "/convenient/upload/file".equals(uri); |
| | | |
| | | if (isDoc || isUpload) { |
| | | List<String> noLoginUrl = new ArrayList<>(); |
| | | |
| | | noLoginUrl.add("/microcommercialstreet/merchant/get"); |
| | | noLoginUrl.add("/microcommercialstreet/index/topData"); |
| | | noLoginUrl.add("/microcommercialstreet/information/pageH5"); |
| | | noLoginUrl.add("/microcommercialstreet/game/pageH5"); |
| | | noLoginUrl.add("/microcommercialstreet/game/get"); |
| | | noLoginUrl.add("/microcommercialstreet/info/get"); |
| | | noLoginUrl.add("/microcommercialstreet/merchant/pageH5"); |
| | | |
| | | if (isDoc || isUpload || isLogin || mcsGetCode || wxNotify || mcsBindPhone || getConfig || noLoginUrl.contains(uri)) { |
| | | //放过swagger请求 |
| | | } else { |
| | | if (!storeLogin && !isConvenientReq) { |
| | | String userInfo = request.getHeader(TokenConstant.TOKEN_USERINFO); |
| | | boolean empty = ObjectUtils.isEmpty(userInfo); |
| | | if (empty) { |
| | | log.error("获取登录用户信息失败【{}】", request); |
| | | ResultUtil.responseJson(response, R.fail(HttpStatus.UNAUTHORIZED, "token过期")); |
| | | return; |
| | | } |
| | | byte[] bytes = AES.parseHexStr2Byte(userInfo); |
| | | byte[] decrypt = AES.decrypt(bytes, Constants.AES_KEY); |
| | | userInfo = new String(decrypt); |
| | | LoginUserInfoVO loginUserInfoVO = JSONObject.parseObject(userInfo, LoginUserInfoVO.class); |
| | | String userInfo = request.getHeader(TokenConstant.TOKEN_USERINFO); |
| | | boolean empty = ObjectUtils.isEmpty(userInfo); |
| | | if (empty) { |
| | | log.error("获取登录用户信息失败【{}】", request); |
| | | ResultUtil.responseJson(response, R.fail(HttpStatus.UNAUTHORIZED, "token过期")); |
| | | return; |
| | | } |
| | | byte[] bytes = AES.parseHexStr2Byte(userInfo); |
| | | byte[] decrypt = AES.decrypt(bytes, Constants.AES_KEY); |
| | | userInfo = new String(decrypt); |
| | | LoginUserInfoVO loginUserInfoVO = JSONObject.parseObject(userInfo, LoginUserInfoVO.class); |
| | | |
| | | R r = communityService.getUserStoreInfo(loginUserInfoVO.getUserId()); |
| | | boolean shopStoreValid = false; |
| | | if (R.isOk(r) && r.getData() != null) { |
| | | ShopStoreVO shopStoreVO = |
| | | JSONObject.parseObject(JSONObject.toJSONString(r.getData()), ShopStoreVO.class); |
| | | shopStoreValid = shopStoreVO.getStatus() == 1; |
| | | } |
| | | if (!shopStoreValid) { |
| | | // 返回请求被拒绝响应 |
| | | response.setContentType("application/json"); |
| | | response.setCharacterEncoding("UTF-8"); |
| | | response.getWriter().write(JSONObject.toJSONString(R.fail(403))); |
| | | response.flushBuffer(); |
| | | return; |
| | | } |
| | | } else if (!convenientLogin && isConvenientReq) { |
| | | String userInfo = request.getHeader(TokenConstant.TOKEN_USERINFO); |
| | | boolean empty = ObjectUtils.isEmpty(userInfo); |
| | | if (empty) { |
| | | log.error("获取登录用户信息失败【{}】", request); |
| | | ResultUtil.responseJson(response, R.fail(HttpStatus.UNAUTHORIZED, "token过期")); |
| | | return; |
| | | } |
| | | byte[] bytes = AES.parseHexStr2Byte(userInfo); |
| | | byte[] decrypt = AES.decrypt(bytes, Constants.AES_KEY); |
| | | userInfo = new String(decrypt); |
| | | LoginUserInfoVO loginUserInfoVO = JSONObject.parseObject(userInfo, LoginUserInfoVO.class); |
| | | |
| | | R r = communityService.getUserMerchantInfoByAccount(loginUserInfoVO.getAccount()); |
| | | boolean merchantValid = false; |
| | | if (R.isOk(r) && r.getData() != null) { |
| | | ConvenientMerchantVO merchantVO = |
| | | JSONObject.parseObject(JSONObject.toJSONString(r.getData()), ConvenientMerchantVO.class); |
| | | merchantValid = merchantVO.getAccountStatus() == 1; |
| | | } |
| | | if (!merchantValid) { |
| | | // 返回请求被拒绝响应 |
| | | response.setContentType("application/json"); |
| | | response.setCharacterEncoding("UTF-8"); |
| | | response.getWriter().write(JSONObject.toJSONString(R.fail(403))); |
| | | response.flushBuffer(); |
| | | return; |
| | | } |
| | | R r = communityService.checkStoreIsValid(loginUserInfoVO.getUserId()); |
| | | Boolean isValid = false; |
| | | if (R.isOk(r) && r.getData() != null) { |
| | | isValid = JSONObject.parseObject(JSONObject.toJSONString(r.getData()), Boolean.class); |
| | | } |
| | | if (!isValid) { |
| | | // 返回请求被拒绝响应 |
| | | response.setContentType("application/json"); |
| | | response.setCharacterEncoding("UTF-8"); |
| | | response.getWriter().write(JSONObject.toJSONString(R.fail(403))); |
| | | response.flushBuffer(); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | filterChain.doFilter(servletRequest, servletResponse); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.shop_backstage.model.request; |
| | | |
| | | import cn.binarywang.wx.miniapp.bean.WxMaUserInfo; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: 微信登录 |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-11-23 14:12 |
| | | **/ |
| | | @Data |
| | | @ApiModel(value = "小程序登录") |
| | | public class LoginRequest { |
| | | |
| | | @ApiModelProperty(name = "code", value = "登录时获取的 code") |
| | | String code; |
| | | |
| | | @ApiModelProperty(name = "signature", value = "使用 sha1( rawData + sessionkey ) 得到字符串,用于校验用户信息") |
| | | String signature; |
| | | |
| | | @ApiModelProperty(name = "rawData", value = "不包括敏感信息的原始数据字符串,用于计算签名") |
| | | String rawData; |
| | | |
| | | @ApiModelProperty(name = "encryptedData", value = "包括敏感数据在内的完整用户信息的加密数据") |
| | | String encryptedData; |
| | | |
| | | @ApiModelProperty(name = "iv", value = "加密算法的初始向量") |
| | | String iv; |
| | | |
| | | @ApiModelProperty(name = "userInfo", value = "用户基本信息") |
| | | WxMaUserInfo userInfo; |
| | | |
| | | } |
| | |
| | | log.info("执行结果【{}】", r.toString()); |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | /** |
| | | * 定时任务-每隔5分钟执行一次,将已到期的微商业街商家旗下所有的游戏/资讯全部下架 |
| | | * @param param |
| | | * @return |
| | | */ |
| | | @XxlJob("offResourceForMcsMerchantJobHandler") |
| | | public ReturnT<String> offResourceForMcsMerchantJobHandler(String param) { |
| | | log.info("定时任务将已到期的微商业街商家旗下所有的游戏/资讯全部下架"); |
| | | R r = communityService.offResourceForMcsMerchant(); |
| | | log.info("执行结果【{}】", r.toString()); |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | /** |
| | | * 定时任务-每隔5分钟执行一次,将已到期的微商业街游戏结束 |
| | | * @param param |
| | | * @return |
| | | */ |
| | | @XxlJob("endStatusForMcsGameJobHandler") |
| | | public ReturnT<String> endStatusForMcsGameJobHandler(String param) { |
| | | log.info("定时任务,将已到期的微商业街游戏结束"); |
| | | R r = communityService.endStatusForMcsGame(); |
| | | log.info("执行结果【{}】", r.toString()); |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | } |
| | |
| | | noLoginUrl.add("/api/communitybackstage/screen/comprehensive/partydyn"); |
| | | noLoginUrl.add("/api/communitybackstage/screen/comprehensive/pagedynamic"); |
| | | noLoginUrl.add("/api/communitybackstage/screen/get/community/password"); |
| | | noLoginUrl.add("/api/shopbackstage/microcommercialstreet/verifyCode"); |
| | | noLoginUrl.add("/api/shopbackstage/mcsOrder/wxNotify"); |
| | | noLoginUrl.add("/api/shopbackstage/microcommercialstreet/bindPhone"); |
| | | noLoginUrl.add("/api/shopbackstage/microcommercialstreet/bind/verifyCode"); |
| | | noLoginUrl.add("/api/shopbackstage/microcommercialstreet/config/all"); |
| | | noLoginUrl.add("/api/shopbackstage/microcommercialstreet/merchant/get"); |
| | | noLoginUrl.add("/api/shopbackstage/microcommercialstreet/index/topData"); |
| | | noLoginUrl.add("/api/shopbackstage/microcommercialstreet/information/pageH5"); |
| | | noLoginUrl.add("/api/shopbackstage/microcommercialstreet/game/pageH5"); |
| | | noLoginUrl.add("/api/shopbackstage/microcommercialstreet/game/get"); |
| | | noLoginUrl.add("/api/shopbackstage/microcommercialstreet/info/get"); |
| | | noLoginUrl.add("/api/shopbackstage/microcommercialstreet/merchant/pageH5"); |
| | | if (noLoginUrl.contains(requestURI)) { |
| | | List<SimpleGrantedAuthority> authorities = new ArrayList<>(); |
| | | authorities.add(new SimpleGrantedAuthority(SecurityConstants.ROLE_APPLETS)); |