| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.convenient.*; |
| | | import com.panzhihua.common.model.vos.community.convenient.ConvenientElevatingPointVO; |
| | | import com.panzhihua.common.utlis.MimeTypeUtils; |
| | | import org.apache.commons.io.FilenameUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | import com.panzhihua.common.model.dtos.community.PageComCvtBusinessDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageComCvtCategoryDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageComCvtServeDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.ConvenientMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.ConvenientServiceCategoryDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.DisableOrEnableConvenientMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.PageConvenientMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.PageConvenientServiceCategoryDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.ResetPasswordConvenientMerchantDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActVO; |
| | |
| | | public R getAllServiceCategories() { |
| | | return communityService.getAllServiceCategories(this.getAreaCode()); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "分页查询自提点", response = ConvenientElevatingPointVO.class) |
| | | @PostMapping("/point/page") |
| | | public R pagePoint(@RequestBody PageConvenientElevatingPointDTO pageConvenientElevatingPointDTO) { |
| | | return communityService.pagePoint(pageConvenientElevatingPointDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增自提点") |
| | | @PostMapping("/point/add") |
| | | public R addPoint(@RequestBody @Validated(AddGroup.class) ConvenientElevatingPointDTO convenientElevatingPointDTO) { |
| | | convenientElevatingPointDTO.setCreatedBy(this.getUserId()); |
| | | return communityService.addPoint(convenientElevatingPointDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "编辑自提点") |
| | | @PutMapping("/point/put") |
| | | public R putPoint(@RequestBody @Validated(PutGroup.class) ConvenientElevatingPointDTO convenientElevatingPointDTO) { |
| | | convenientElevatingPointDTO.setUpdatedBy(this.getUserId()); |
| | | convenientElevatingPointDTO.setCreatedBy(this.getUserId()); |
| | | return communityService.putPoint(convenientElevatingPointDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除自提点") |
| | | @DeleteMapping("/point/delete") |
| | | public R deletePoint(@RequestParam("pointId") @ApiParam(value = "自提点id", required = true) |
| | | Long pointId) { |
| | | return communityService.deletePoint(pointId, this.getUserId()); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.convenient; |
| | | |
| | | 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 org.hibernate.validator.constraints.Length; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | /** |
| | | * @ClassName: ConvenientElevatingPointDTO |
| | | * @Author: yh |
| | | * @Date: 2022/11/8 10:10 |
| | | * @Description: 新增/编辑便民服务自提点 |
| | | */ |
| | | @Data |
| | | @ApiModel("新增/编辑便民服务自提点") |
| | | public class ConvenientElevatingPointDTO { |
| | | |
| | | @ApiModelProperty("自提点ID") |
| | | @NotNull(groups = {PutGroup.class}, message = "自提点ID不能为空") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("自提点名称") |
| | | @NotBlank(groups = {AddGroup.class}, message = "自提点名称不能为空") |
| | | @Length(groups = {AddGroup.class}, max = 30, message = "自提点名称最多支持30个字符") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("联系人") |
| | | @NotBlank(groups = {AddGroup.class}, message = "联系人不能为空") |
| | | private String contacts; |
| | | |
| | | |
| | | @ApiModelProperty("联系电话") |
| | | @NotBlank(groups = {AddGroup.class}, message = "联系电话不能为空") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty("微信账号") |
| | | @NotBlank(groups = {AddGroup.class}, message = "微信账号不能为空") |
| | | private String wechatAccount; |
| | | |
| | | @ApiModelProperty("所属地区") |
| | | @NotBlank(groups = {AddGroup.class}, message = "所属地区不能为空") |
| | | private String region; |
| | | |
| | | @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("状态,1.显示 2.隐藏") |
| | | @NotNull(groups = {AddGroup.class}, message = "状态不能为空") |
| | | private Integer businessStatus; |
| | | |
| | | |
| | | @ApiModelProperty(value = "所属社区id") |
| | | @NotNull(groups = {AddGroup.class}, message = "所属社区id不能为空") |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty(value = "创建人", hidden = true) |
| | | private Long createdBy; |
| | | |
| | | @ApiModelProperty(value = "更新人", hidden = true) |
| | | private Long updatedBy; |
| | | } |
| | |
| | | |
| | | private String areaCode; |
| | | |
| | | @ApiModelProperty("服务范围") |
| | | private Integer serviceRange; |
| | | |
| | | public String getPeriod() { |
| | | return period.name(); |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.convenient; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.Min; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | /** |
| | | * @title: PageConvenientElevatingPointDTO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 分页查询便民服务自提点请求参数 |
| | | * @author: yh |
| | | * @date: 2022-10-21 09:36:09 |
| | | */ |
| | | @Data |
| | | @ApiModel("分页查询便民服务自提点请求参数") |
| | | public class PageConvenientElevatingPointDTO { |
| | | |
| | | @ApiModelProperty("关键词") |
| | | private String keyword; |
| | | |
| | | @ApiModelProperty("社区id") |
| | | private Long communityId; |
| | | |
| | | |
| | | @ApiModelProperty("营业状态(1.显示 2.隐藏)") |
| | | private Integer businessStatus; |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数", example = "1") |
| | | @NotNull(message = "分页参数不能为空") |
| | | @Min(value = 1) |
| | | private Long pageNum; |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数", example = "10") |
| | | @NotNull(message = "分页参数不能为空") |
| | | @Min(value = 1) |
| | | private Long pageSize; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.convenient; |
| | | |
| | | 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; |
| | | |
| | | /** |
| | | * @ClassName: ConvenientElevatingPointVO |
| | | * @Author: yh |
| | | * @Date: 2022/11/8 9:54 |
| | | * @Description: 便民服自提点 |
| | | */ |
| | | @Data |
| | | @ApiModel("便民服自提点") |
| | | public class ConvenientElevatingPointVO { |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @ApiModelProperty("主键id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long id; |
| | | /** |
| | | * 自提点名称 |
| | | */ |
| | | @ApiModelProperty("自提点名称") |
| | | private String name; |
| | | /** |
| | | * 社区id |
| | | */ |
| | | @ApiModelProperty("社区id") |
| | | private Long communityId; |
| | | /** |
| | | * 社区名称 |
| | | */ |
| | | @ApiModelProperty("社区名称") |
| | | private String communityName; |
| | | /** |
| | | * 所属地区 |
| | | */ |
| | | @ApiModelProperty("所属地区") |
| | | private String region; |
| | | /** |
| | | * 提货点地址 |
| | | */ |
| | | @ApiModelProperty("提货点地址") |
| | | private String address; |
| | | /** |
| | | * 联系人 |
| | | */ |
| | | @ApiModelProperty("联系人") |
| | | private String contacts; |
| | | /** |
| | | * 纬度 |
| | | */ |
| | | @ApiModelProperty("纬度") |
| | | private String lat; |
| | | /** |
| | | * 经度 |
| | | */ |
| | | @ApiModelProperty("经度") |
| | | private String lon; |
| | | /** |
| | | * 联系电话 |
| | | */ |
| | | @ApiModelProperty("联系电话") |
| | | private String phone; |
| | | /** |
| | | * 微信账号 |
| | | */ |
| | | @ApiModelProperty("微信账号") |
| | | private String wechatAccount; |
| | | /** |
| | | * 状态,1:显示,2:隐藏 |
| | | */ |
| | | @ApiModelProperty("状态,1:显示,2:隐藏") |
| | | private Integer businessStatus; |
| | | /** |
| | | * 累计商品数量 |
| | | */ |
| | | @ApiModelProperty("累计商品数量") |
| | | private Long cumulativeGoodsNum; |
| | | /** |
| | | * 待提货数量 |
| | | */ |
| | | @ApiModelProperty("待提货数量") |
| | | private Long prepareGoodsNum; |
| | | /** |
| | | * 已提货数量 |
| | | */ |
| | | @ApiModelProperty("已提货数量") |
| | | private Long alreadyGoodsNum; |
| | | } |
| | |
| | | import com.panzhihua.common.model.dtos.PageBaseDTO; |
| | | import com.panzhihua.common.model.dtos.community.*; |
| | | import com.panzhihua.common.model.dtos.community.acid.*; |
| | | import com.panzhihua.common.model.dtos.community.convenient.*; |
| | | import com.panzhihua.common.model.dtos.community.dpc.AddDpcDTO; |
| | | import com.panzhihua.common.model.dtos.community.dpc.EditDpcDTO; |
| | | import com.panzhihua.common.model.dtos.community.dpc.PageDpcDTO; |
| | |
| | | import com.panzhihua.common.model.dtos.community.cluster.admin.EditClusterMemberAdminDto; |
| | | import com.panzhihua.common.model.dtos.community.cluster.admin.PageClusterAdminDto; |
| | | import com.panzhihua.common.model.dtos.community.cluster.admin.PageClusterMemberAdminDto; |
| | | import com.panzhihua.common.model.dtos.community.convenient.ConvenientMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.ConvenientProductCategoryDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.ConvenientProductDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.ConvenientServiceCategoryDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.DeleteConvenientProductDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.DisableOrEnableConvenientMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.ExportMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.OnShelfOrOffShelfProductDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.PageClassifyMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.PageConvenientMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.PageConvenientProductCategoryDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.PageConvenientProductDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.PageConvenientServiceCategoryDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.PagePopularMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.PageSearchDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.ResetPasswordConvenientMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.easyPhoto.AddEasyPhotoActivityDTO; |
| | | import com.panzhihua.common.model.dtos.community.easyPhoto.AddEasyPhotoClassifyDTO; |
| | | import com.panzhihua.common.model.dtos.community.easyPhoto.EditEasyPhotoActivityDTO; |
| | |
| | | @PostMapping("/proceedings") |
| | | R addOrUpdateProceedings(@RequestBody ComActProceedingsDTO comActProceedingsDTO); |
| | | |
| | | /** |
| | | * 自提点分页查询 |
| | | * @param pageConvenientElevatingPointDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/convenient/point/page") |
| | | R pagePoint(PageConvenientElevatingPointDTO pageConvenientElevatingPointDTO); |
| | | |
| | | /** |
| | | * 新增自提点 |
| | | * @param convenientElevatingPointDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/convenient/point/add") |
| | | R addPoint(ConvenientElevatingPointDTO convenientElevatingPointDTO); |
| | | |
| | | /** |
| | | * 编辑自提点 |
| | | * @param convenientElevatingPointDTO |
| | | * @return |
| | | */ |
| | | @PutMapping("/convenient/point/put") |
| | | R putPoint(ConvenientElevatingPointDTO convenientElevatingPointDTO); |
| | | |
| | | /** |
| | | * 删除便民服务 自提点 |
| | | * @param pointId |
| | | * @param operator |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/point/delete") |
| | | R deletePoint(@RequestParam("pointId") Long pointId, @RequestParam("operator") Long operator) |
| | | } |
| | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.convenient.ExportMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.PageClassifyMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.PagePopularMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.PageSearchDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.*; |
| | | import com.panzhihua.service_community.service.*; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | import com.panzhihua.common.model.dtos.community.PageComCvtBusinessDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageComCvtCategoryDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageComCvtServeDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.ConvenientMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.ConvenientProductCategoryDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.ConvenientProductDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.ConvenientServiceCategoryDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.DeleteConvenientProductDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.DisableOrEnableConvenientMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.OnShelfOrOffShelfProductDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.PageConvenientMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.PageConvenientProductCategoryDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.PageConvenientProductDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.PageConvenientServiceCategoryDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.ResetPasswordConvenientMerchantDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComCvtServeExcelVO; |
| | | import com.panzhihua.common.model.vos.community.convenient.ConvenientMerchantVO; |
| | | import com.panzhihua.service_community.service.ComCvtBusinessService; |
| | | import com.panzhihua.service_community.service.ComCvtCategoryService; |
| | | import com.panzhihua.service_community.service.ComCvtServeService; |
| | | import com.panzhihua.service_community.service.ConvenientMerchantService; |
| | | import com.panzhihua.service_community.service.ConvenientProductCategoryService; |
| | | import com.panzhihua.service_community.service.ConvenientProductService; |
| | | import com.panzhihua.service_community.service.ConvenientServiceCategoryService; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | |
| | | |
| | | @Resource |
| | | private ConvenientProductService convenientProductService; |
| | | |
| | | @Resource |
| | | private ConvenientElevatingPointService convenientElevatingPointService; |
| | | |
| | | /** |
| | | * 社区后台分页查询便民服务商家 |
| | |
| | | public R getProductShelfNum(@RequestParam("merchantId") Long merchantId) { |
| | | return convenientProductService.getProductShelfNum(merchantId); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 分页查询自提点 运营后台 |
| | | * @param pageConvenientElevatingPointDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/point/page") |
| | | public R pagePoint(@RequestBody PageConvenientElevatingPointDTO pageConvenientElevatingPointDTO) { |
| | | return convenientElevatingPointService.pagePoint(pageConvenientElevatingPointDTO); |
| | | } |
| | | |
| | | /** |
| | | * 便民服务新增 自提点 |
| | | * @param convenientElevatingPointDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/point/add") |
| | | public R addPoint(@RequestBody ConvenientElevatingPointDTO convenientElevatingPointDTO) { |
| | | return convenientElevatingPointService.addPoint(convenientElevatingPointDTO); |
| | | } |
| | | |
| | | /** |
| | | * 编辑便民服务 自提点 |
| | | * @param convenientElevatingPointDTO |
| | | * @return |
| | | */ |
| | | @PutMapping("/point/put") |
| | | public R putPoint(@RequestBody ConvenientElevatingPointDTO convenientElevatingPointDTO) { |
| | | return convenientElevatingPointService.putPoint(convenientElevatingPointDTO); |
| | | } |
| | | |
| | | /** |
| | | * 删除便民服务 自提点 |
| | | * @param pointId |
| | | * @param operator |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/point/delete") |
| | | public R deletePoint(@RequestParam("pointId") Long pointId, @RequestParam("operator") Long operator) { |
| | | return convenientElevatingPointService.deletePoint(pointId,operator); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.community.convenient.PageConvenientElevatingPointDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.PageConvenientMerchantDTO; |
| | | import com.panzhihua.common.model.vos.community.convenient.ConvenientElevatingPointVO; |
| | | import com.panzhihua.common.model.vos.community.convenient.ConvenientMerchantVO; |
| | | import com.panzhihua.service_community.model.dos.ConvenientElevatingPointDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @title: ConvenientElevatingPointDAO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 自提点DAO |
| | | * @author: YH |
| | | * @date: 2022-10-21 09:36:09 |
| | | */ |
| | | @Mapper |
| | | public interface ConvenientElevatingPointDAO extends BaseMapper<ConvenientElevatingPointDO> { |
| | | /** |
| | | * 分页查询自提点 运营后台 |
| | | * |
| | | * @param page 分页参数 |
| | | * @param pageConvenientElevatingPointDTO |
| | | * @return |
| | | */ |
| | | IPage<ConvenientElevatingPointVO> page(@Param("page") Page page, |
| | | @Param("pageConvenientElevatingPointDTO") PageConvenientElevatingPointDTO pageConvenientElevatingPointDTO); |
| | | |
| | | /** |
| | | * 删除 |
| | | * @param pointId |
| | | * @param operator |
| | | * @return |
| | | */ |
| | | int deletePointById(@Param("pointId") Long pointId, @Param("operator") Long operator); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.model.dos; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @ClassName: ConvenientElevatingPoint |
| | | * @Author: yh |
| | | * @Date: 2022/11/8 9:27 |
| | | * @Description: 自提点 |
| | | */ |
| | | @Data |
| | | @TableName(value = "com_convenient_elevating_point") |
| | | public class ConvenientElevatingPointDO implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @TableId(type = IdType.ASSIGN_ID) |
| | | private Long id; |
| | | /** |
| | | * 自提点名称 |
| | | */ |
| | | private String name; |
| | | /** |
| | | * 社区id |
| | | */ |
| | | private Long communityId; |
| | | /** |
| | | * 社区名称 |
| | | */ |
| | | private String communityName; |
| | | /** |
| | | * 所属地区 |
| | | */ |
| | | private String region; |
| | | /** |
| | | * 提货点地址 |
| | | */ |
| | | private String address; |
| | | /** |
| | | * 联系人 |
| | | */ |
| | | private String contacts; |
| | | /** |
| | | * 纬度 |
| | | */ |
| | | private String lat; |
| | | /** |
| | | * 经度 |
| | | */ |
| | | private String lon; |
| | | /** |
| | | * 联系电话 |
| | | */ |
| | | private String phone; |
| | | /** |
| | | * 微信账号 |
| | | */ |
| | | private String wechatAccount; |
| | | /** |
| | | * 状态,1:显示,2:隐藏 |
| | | */ |
| | | private Integer businessStatus; |
| | | /** |
| | | * 累计商品数量 |
| | | */ |
| | | private Long cumulativeGoodsNum; |
| | | /** |
| | | * 待提货数量 |
| | | */ |
| | | private Long prepareGoodsNum; |
| | | /** |
| | | * 已提货数量 |
| | | */ |
| | | private Long alreadyGoodsNum; |
| | | /** |
| | | * 是否删除 |
| | | */ |
| | | private Boolean isDel; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private Date createdAt; |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | private Long createdBy; |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | private Date updatedAt; |
| | | /** |
| | | * 更新人 |
| | | */ |
| | | private Long updatedBy; |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | |
| | | private Long updatedBy; |
| | | |
| | | private String areaCode; |
| | | |
| | | /** |
| | | * 服务范围 |
| | | */ |
| | | private Integer serviceRange; |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.community.convenient.ConvenientElevatingPointDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.PageConvenientElevatingPointDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.model.dos.ConvenientElevatingPointDO; |
| | | |
| | | /** |
| | | * @ClassName: ConvenientElevatingPointService |
| | | * @Author: yh |
| | | * @Date: 2022/11/8 10:32 |
| | | * @Description: 自提点 |
| | | */ |
| | | public interface ConvenientElevatingPointService extends IService<ConvenientElevatingPointDO> { |
| | | /** |
| | | * 分页查询自提点 |
| | | * |
| | | * @param pageConvenientElevatingPointDTO |
| | | * @return |
| | | */ |
| | | R pagePoint(PageConvenientElevatingPointDTO pageConvenientElevatingPointDTO); |
| | | |
| | | /** |
| | | * 新增 |
| | | * @param convenientElevatingPointDTO |
| | | * @return |
| | | */ |
| | | R addPoint(ConvenientElevatingPointDTO convenientElevatingPointDTO); |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param convenientElevatingPointDTO |
| | | * @return |
| | | */ |
| | | R putPoint(ConvenientElevatingPointDTO convenientElevatingPointDTO); |
| | | |
| | | /** |
| | | * 删除 |
| | | * @param pointId |
| | | * @param operator |
| | | * @return |
| | | */ |
| | | R deletePoint(Long pointId, Long operator); |
| | | } |
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.convenient.ConvenientElevatingPointDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.ConvenientMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.PageConvenientElevatingPointDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.convenient.ConvenientElevatingPointVO; |
| | | import com.panzhihua.common.utlis.Snowflake; |
| | | import com.panzhihua.service_community.dao.ComActDAO; |
| | | import com.panzhihua.service_community.dao.ConvenientElevatingPointDAO; |
| | | import com.panzhihua.service_community.model.dos.ComActDO; |
| | | import com.panzhihua.service_community.model.dos.ConvenientElevatingPointDO; |
| | | import com.panzhihua.service_community.model.dos.ConvenientMerchantDO; |
| | | import com.panzhihua.service_community.model.dos.ConvenientServiceCategoryDO; |
| | | import com.panzhihua.service_community.service.ConvenientElevatingPointService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.List; |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | import static org.apache.commons.lang3.StringUtils.isNotBlank; |
| | | |
| | | /** |
| | | * @ClassName: ConvenientElevatingPointServiceImpl |
| | | * @Author: yh |
| | | * @Date: 2022/11/8 10:34 |
| | | * @Description: 自提点 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class ConvenientElevatingPointServiceImpl extends ServiceImpl<ConvenientElevatingPointDAO, ConvenientElevatingPointDO> implements ConvenientElevatingPointService { |
| | | @Resource |
| | | private ComActDAO comActDAO; |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param pageConvenientElevatingPointDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R pagePoint(PageConvenientElevatingPointDTO pageConvenientElevatingPointDTO) { |
| | | Page page = new Page<>(); |
| | | page.setSize(pageConvenientElevatingPointDTO.getPageSize()); |
| | | page.setCurrent(pageConvenientElevatingPointDTO.getPageNum()); |
| | | IPage<ConvenientElevatingPointVO> iPage = this.baseMapper.page(page, pageConvenientElevatingPointDTO); |
| | | return R.ok(iPage); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | * @param convenientElevatingPointDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R addPoint(ConvenientElevatingPointDTO convenientElevatingPointDTO) { |
| | | ConvenientElevatingPointDO convenientElevatingPointDO = new ConvenientElevatingPointDO(); |
| | | BeanUtils.copyProperties(convenientElevatingPointDTO,convenientElevatingPointDO); |
| | | ComActDO comActDO = comActDAO.selectById(convenientElevatingPointDTO.getCommunityId()); |
| | | convenientElevatingPointDO.setCommunityName(comActDO.getName()); |
| | | this.baseMapper.insert(convenientElevatingPointDO); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param convenientElevatingPointDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R putPoint(ConvenientElevatingPointDTO convenientElevatingPointDTO) { |
| | | Long id = convenientElevatingPointDTO.getId(); |
| | | ConvenientElevatingPointDO convenientElevatingPointDO = this.baseMapper.selectById(id); |
| | | if (isNull(convenientElevatingPointDO)) { |
| | | return R.fail("自提点不存在"); |
| | | } |
| | | Long communityId = convenientElevatingPointDTO.getCommunityId(); |
| | | if (nonNull(communityId)) { |
| | | ComActDO comActDO = comActDAO.selectById(communityId); |
| | | if(comActDO!=null){ |
| | | convenientElevatingPointDO.setCommunityName(comActDO.getName()); |
| | | } else { |
| | | convenientElevatingPointDO.setCommunityName("西区社区"); |
| | | } |
| | | } |
| | | BeanUtils.copyProperties(convenientElevatingPointDTO, convenientElevatingPointDO); |
| | | this.baseMapper.updateById(convenientElevatingPointDO); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public R deletePoint(Long pointId, Long operator) { |
| | | ConvenientElevatingPointDO convenientElevatingPointDO = this.baseMapper.selectById(pointId); |
| | | if (convenientElevatingPointDO.getPrepareGoodsNum() > 0){ |
| | | return R.fail("该提货点暂时无法删除!若想删除需保证待提货数量为0"); |
| | | } |
| | | int result = this.baseMapper.deletePointById(pointId, operator); |
| | | if (result > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail("删除失败"); |
| | | } |
| | | } |
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.ConvenientElevatingPointDAO"> |
| | | <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ConvenientElevatingPointDO"> |
| | | <!--@Table com_convenient_elevating_point--> |
| | | <id column="id" jdbcType="BIGINT" property="id"/> |
| | | <result column="name" jdbcType="VARCHAR" property="name"/> |
| | | <result column="community_id" jdbcType="BIGINT" property="communityId"/> |
| | | <result column="community_name" jdbcType="VARCHAR" property="communityName"/> |
| | | <result column="region" jdbcType="VARCHAR" property="region"/> |
| | | <result column="address" jdbcType="VARCHAR" property="address"/> |
| | | <result column="contacts" jdbcType="VARCHAR" property="contacts"/> |
| | | <result column="phone" jdbcType="VARCHAR" property="phone"/> |
| | | <result column="wechat_account" jdbcType="VARCHAR" property="wechatAccount"/> |
| | | <result column="lat" jdbcType="VARCHAR" property="lat"/> |
| | | <result column="lon" jdbcType="VARCHAR" property="lon"/> |
| | | <result column="business_status" property="businessStatus"/> |
| | | <result column="cumulative_goods_num" jdbcType="BIGINT" property="cumulativeGoodsNum"/> |
| | | <result column="prepare_goods_num" jdbcType="BIGINT" property="prepareGoodsNum"/> |
| | | <result column="already_goods_num" jdbcType="BIGINT" property="alreadyGoodsNum"/> |
| | | <result column="is_del" jdbcType="BIT" property="isDel"/> |
| | | <result column="created_at" jdbcType="TIMESTAMP" property="createdAt"/> |
| | | <result column="created_by" jdbcType="BIGINT" property="createdBy"/> |
| | | <result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt"/> |
| | | <result column="updated_by" jdbcType="BIGINT" property="updatedBy"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | id, `name`, community_id, community_name, region, address, contacts, phone, wechat_account, |
| | | lat, lon, `business_status`, cumulative_goods_num, prepare_goods_num, already_goods_num, is_del, |
| | | created_at, created_by, updated_at, updated_by |
| | | </sql> |
| | | |
| | | <select id="page" resultType="com.panzhihua.common.model.vos.community.convenient.ConvenientElevatingPointVO"> |
| | | SELECT cce.* FROM com_convenient_elevating_point cce WHERE cce.is_del = 0 |
| | | <if test="pageConvenientElevatingPointDTO.businessStatus != null and pageConvenientElevatingPointDTO.businessStatus != ''"> |
| | | AND cce.business_status = #{pageConvenientElevatingPointDTO.businessStatus} |
| | | </if> |
| | | <if test="pageConvenientElevatingPointDTO.communityId != null and pageConvenientElevatingPointDTO.communityId != 0"> |
| | | AND ccm.community_id = ${pageConvenientElevatingPointDTO.communityId} |
| | | </if> |
| | | |
| | | <if test="pageConvenientElevatingPointDTO.keyword != null and pageConvenientElevatingPointDTO.keyword != """> |
| | | AND ( |
| | | cce.name LIKE CONCAT('%', #{pageConvenientElevatingPointDTO.keyword}, '%') |
| | | OR cce.address LIKE CONCAT('%', #{pageConvenientElevatingPointDTO.keyword}, '%') |
| | | OR cce.contacts LIKE CONCAT('%', #{pageConvenientElevatingPointDTO.keyword}, '%') |
| | | ) |
| | | </if> |
| | | ORDER BY cce.prepare_goods_num DESC |
| | | </select> |
| | | |
| | | <update id="deletePointById"> |
| | | UPDATE com_convenient_elevating_point SET is_del = 1, updated_by = #{operator} WHERE id = #{pointId} |
| | | </update> |
| | | </mapper> |
| | |
| | | <id column="created_by" property="createdBy" /> |
| | | <id column="updated_at" property="updatedAt" /> |
| | | <id column="updated_by" property="updatedBy" /> |
| | | <id column="area_code" property="areaCode" /> |
| | | <id column="service_range" property="serviceRange" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id,`name`,community_id,community_name,logo,contacts,id_card,phone,address,lat,lon,begin_at,end_at,period,introduction, |
| | | business_status,user_id,consultation_volume,is_del,created_at,created_by,updated_at,updated_by |
| | | business_status,user_id,consultation_volume,is_del,created_at,created_by,updated_at,updated_by,area_code,service_range |
| | | </sql> |
| | | <select id="pageMerchant" resultType="com.panzhihua.common.model.vos.community.convenient.ConvenientMerchantVO"> |
| | | SELECT ccm.*, su.account, su.status AS accountStatus, GROUP_CONCAT(ccss.service_name) AS serviceScope |