| | |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.context.annotation.Import; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import springfox.documentation.builders.ApiInfoBuilder; |
| | | import springfox.documentation.builders.PathSelectors; |
| | | import springfox.documentation.builders.RequestHandlerSelectors; |
| | |
| | | |
| | | ApiSelectorBuilder builder = new Docket(DocumentationType.SWAGGER_2).host(swaggerProperties.getHost()) |
| | | .apiInfo(apiInfo(swaggerProperties)).select() |
| | | //.apis(RequestHandlerSelectors.basePackage(swaggerProperties.getBasePackage())) |
| | | .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)); |
| | | //.apis(RequestHandlerSelectors.basePackage(swaggerProperties.getBasePackage())); |
| | | .apis(RequestHandlerSelectors.withClassAnnotation(RestController.class)); |
| | | //.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)); |
| | | |
| | | swaggerProperties.getBasePath().forEach(p -> builder.paths(PathSelectors.ant(p))); |
| | | swaggerProperties.getExcludePath().forEach(p -> builder.paths(PathSelectors.ant(p).negate())); |
| | |
| | | <version>${swagger.fox.version}</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>io.springfox</groupId> |
| | | <artifactId>springfox-boot-starter</artifactId> |
| | | <version>3.0.0</version> |
| | | </dependency> |
| | | |
| | | |
| | | <!-- Mysql Connector --> |
| | | <dependency> |
| | | <groupId>mysql</groupId> |
| | |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | |
| | | |
| | | <dependency> |
| | | <groupId>com.baomidou</groupId> |
| | | <artifactId>mybatis-plus-annotation</artifactId> |
| | | <version>3.4.1</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.baomidou</groupId> |
| | | <artifactId>mybatis-plus-generator</artifactId> |
| | | <version>3.4.1</version> |
| | | </dependency> |
| | | <!--lombok的依赖,为了优化实体类,可以不去实现实体类的set()、get()--> |
| | | <dependency> |
| | | <groupId>org.projectlombok</groupId> |
| | | <artifactId>lombok</artifactId> |
| | | <optional>true</optional> |
| | | </dependency> |
| | | |
| | | <!-- 小程序统一服务 --> |
| | | <dependency> |
| | | <groupId>com.github.binarywang</groupId> |
| | | <artifactId>weixin-java-miniapp</artifactId> |
| | | <version>4.1.0</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.baomidou</groupId> |
| | | <artifactId>mybatis-plus-annotation</artifactId> |
| | | <version>3.4.3.4</version> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | import com.hrt.common.security.annotation.EnableCustomConfig; |
| | | import com.hrt.common.security.annotation.EnableRyFeignClients; |
| | | import com.hrt.common.swagger.annotation.EnableCustomSwagger2; |
| | | import springfox.documentation.oas.annotations.EnableOpenApi; |
| | | |
| | | /** |
| | | * 系统模块 |
| | |
| | | @EnableCustomSwagger2 |
| | | @EnableRyFeignClients |
| | | @SpringBootApplication |
| | | @EnableOpenApi |
| | | public class HrtSystemApplication |
| | | { |
| | | public static void main(String[] args) |
New file |
| | |
| | | package com.hrt.system.controller.management; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.hrt.common.core.domain.R; |
| | | import com.hrt.common.security.utils.SecurityUtils; |
| | | import com.hrt.system.domain.dto.*; |
| | | import com.hrt.system.domain.poji.member.Member; |
| | | import com.hrt.system.domain.vo.AppSimpleGoodsVo; |
| | | import com.hrt.system.domain.vo.MgtShopInfoVo; |
| | | import com.hrt.system.domain.vo.MgtShopPageVo; |
| | | import com.hrt.system.domain.vo.MgtShopTagVo; |
| | | import com.hrt.system.service.shop.ShopRelTagService; |
| | | import com.hrt.system.service.shop.ShopService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author jqs34 |
| | | * @ClassName ShopController |
| | | * @description: TODO |
| | | * @date 2023年04月21日 |
| | | * @version: 1.0 |
| | | */ |
| | | @Api(value = "管理台商户相关接口", tags = "管理台商户相关接口", description = "管理台商户相关接口") |
| | | @RestController |
| | | @RequestMapping("/mgt/shop") |
| | | public class MgtShopController { |
| | | |
| | | @Autowired |
| | | private ShopService shopService; |
| | | |
| | | @Autowired |
| | | private ShopRelTagService shopRelTagService; |
| | | |
| | | @RequestMapping(value = "/pageShop", method = RequestMethod.POST) |
| | | @ApiOperation(value = "分页获取商户列表") |
| | | public R<Page<MgtShopPageVo>> pageShop(@RequestBody MgtShopPageDto mgtShopPageDto) { |
| | | Page<MgtShopPageVo> page = new Page<>(); |
| | | page.setSize(mgtShopPageDto.getPageSize()); |
| | | page.setCurrent(mgtShopPageDto.getPageNum()); |
| | | List<MgtShopPageVo> mgtShopPageVoList = shopService.pageShop(page,mgtShopPageDto); |
| | | return R.ok(page.setRecords(mgtShopPageVoList)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/createShop", method = RequestMethod.POST) |
| | | @ApiOperation(value = "创建商户") |
| | | public R createShop(@RequestBody MgtEditShopDto mgtEditShopDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | mgtEditShopDto.setUserId(userId); |
| | | shopService.createShop(mgtEditShopDto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/getShopInfo", method = RequestMethod.POST) |
| | | @ApiOperation(value = "获取商户详情") |
| | | public R<MgtShopInfoVo> getShopInfo(@RequestBody MgtBaseGetDto mgtBaseGetDto) { |
| | | MgtShopInfoVo mgtShopInfoVo = shopService.getMgtShopInfo(Long.valueOf(mgtBaseGetDto.getId())); |
| | | return R.ok(mgtShopInfoVo); |
| | | } |
| | | |
| | | @RequestMapping(value = "/getShopTag", method = RequestMethod.POST) |
| | | @ApiOperation(value = "获取商户标签") |
| | | public R<List<MgtShopTagVo>> getShopTag(@RequestBody MgtBaseGetDto mgtBaseGetDto) { |
| | | List<MgtShopTagVo> mgtShopInfoVoList = shopRelTagService.listShopTagVo(Long.valueOf(mgtBaseGetDto.getId())); |
| | | return R.ok(mgtShopInfoVoList); |
| | | } |
| | | |
| | | @RequestMapping(value = "/editShopTag", method = RequestMethod.POST) |
| | | @ApiOperation(value = "修改商户标签") |
| | | public R editShopTag(@RequestBody MgtEditShopTagDto mgtEditShopTagDto) { |
| | | shopService.editShopTag(mgtEditShopTagDto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/changeCooperationTime", method = RequestMethod.POST) |
| | | @ApiOperation(value = "修改合作时间") |
| | | public R changeCooperationTime(@RequestBody MgtChangeCoopDto mgtChangeCoopDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | mgtChangeCoopDto.setUserId(userId); |
| | | shopService.changeCooperationTime(mgtChangeCoopDto); |
| | | return R.ok(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.hrt.system.controller.merchant; |
| | | |
| | | import com.hrt.common.core.domain.R; |
| | | import com.hrt.common.security.utils.SecurityUtils; |
| | | import com.hrt.system.domain.vo.MerHomeShopTotalVo; |
| | | import com.hrt.system.domain.vo.MerShopInfoVo; |
| | | import com.hrt.system.service.shop.ShopService; |
| | | import com.hrt.system.service.user.ISysUserService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * @author jqs34 |
| | | * @ClassName MShopController |
| | | * @description: TODO |
| | | * @date 2023年04月21日 |
| | | * @version: 1.0 |
| | | */ |
| | | @Api(value = "商户端商户相关接口", tags = "商户端商户相关接口", description = "商户端商户相关接口") |
| | | @RestController |
| | | @RequestMapping("/mer/shop") |
| | | public class MerShopController { |
| | | |
| | | /*@Autowired |
| | | private ShopService shopService;*/ |
| | | |
| | | /*@RequestMapping(value = "/getHomeShopTotal", method = RequestMethod.POST) |
| | | @ApiOperation(value = "获取首页商户统计") |
| | | public R<MerHomeShopTotalVo> getHomeShopTotal() { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | MerHomeShopTotalVo merHomeShopTotalVo = shopService.getMerShopInfoVo(Long userId); |
| | | return R.ok(merHomeShopTotalVo); |
| | | }*/ |
| | | |
| | | /*@RequestMapping(value = "/getShopInfo", method = RequestMethod.POST) |
| | | @ApiOperation(value = "获取商户信息") |
| | | public R<MerShopInfoVo> getShopInfo() { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | MerHomeShopTotalVo merHomeShopTotalVo = shopService.getMerShopInfoVo(Long userId); |
| | | return R.ok(merHomeShopTotalVo); |
| | | }*/ |
| | | } |
| | |
| | | package com.hrt.system.controller.miniapp; |
| | | |
| | | import com.hrt.common.core.domain.R; |
| | | import com.hrt.common.security.utils.SecurityUtils; |
| | | import com.hrt.system.domain.dto.AppBaseGetDto; |
| | | import com.hrt.system.domain.dto.AppGoodsInfoGetDto; |
| | | import com.hrt.system.domain.poji.member.Member; |
| | | import com.hrt.system.domain.vo.AppGoodsInfoVo; |
| | | import com.hrt.system.domain.vo.AppShopInfoVo; |
| | | import com.hrt.system.service.goods.GoodsService; |
| | | import com.hrt.system.service.member.MemberService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @Autowired |
| | | private GoodsService goodsService; |
| | | |
| | | @Autowired |
| | | private MemberService memberService; |
| | | |
| | | @RequestMapping(value = "/getGoodsInfo", method = RequestMethod.POST) |
| | | @ApiOperation(value = "获取商品详情") |
| | | public R<AppGoodsInfoVo> getGoodsInfo(@RequestBody AppGoodsInfoGetDto appGoodsInfoGetDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | if(userId!=null){ |
| | | Member member = memberService.getById(userId); |
| | | if(member!=null&&member.getRealtionShopId()!=null){ |
| | | appGoodsInfoGetDto.setShopId(member.getRealtionShopId()); |
| | | } |
| | | } |
| | | AppGoodsInfoVo appGoodsInfoVo = goodsService.getGoodsInfo(appGoodsInfoGetDto); |
| | | return R.ok(appGoodsInfoVo); |
| | | } |
| | |
| | | import com.hrt.common.security.utils.SecurityUtils; |
| | | import com.hrt.system.domain.dto.*; |
| | | import com.hrt.system.domain.poji.member.Member; |
| | | import com.hrt.system.domain.poji.sys.QuickEntry; |
| | | import com.hrt.system.domain.vo.*; |
| | | import com.hrt.system.service.goods.GoodsService; |
| | | import com.hrt.system.service.member.MemberService; |
| | |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.Calendar; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @RequestMapping(value = "/getShopInfo", method = RequestMethod.POST) |
| | | @ApiOperation(value = "获取商户详情") |
| | | public R<AppShopInfoVo> getShopInfo(@RequestBody AppBaseGetDto appBaseGetDto) { |
| | | AppShopInfoVo appShopInfoVo = shopService.getShopInfo(Long.valueOf(appBaseGetDto.getId())); |
| | | AppShopInfoVo appShopInfoVo = shopService.getAppShopInfo(Long.valueOf(appBaseGetDto.getId())); |
| | | return R.ok(appShopInfoVo); |
| | | } |
| | | |
| | |
| | | @ApiModelProperty(value = "是否活动跳转0否1是") |
| | | private Integer activityFlag; |
| | | |
| | | @ApiModelProperty(value = "商户id",hidden = true) |
| | | private Long shopId; |
| | | } |
New file |
| | |
| | | package com.hrt.system.domain.dto; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author jqs34 |
| | | * @ClassName MGTBaseDto |
| | | * @description: TODO |
| | | * @date 2023年04月21日 |
| | | * @version: 1.0 |
| | | */ |
| | | @Data |
| | | public class MgtBaseDto { |
| | | |
| | | @ApiModelProperty(value = "userId",hidden = true) |
| | | private Long userId; |
| | | |
| | | } |
New file |
| | |
| | | package com.hrt.system.domain.dto; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author jqs34 |
| | | * @ClassName MgtBaseGetDto |
| | | * @description: TODO |
| | | * @date 2023年04月21日 |
| | | * @version: 1.0 |
| | | */ |
| | | @Data |
| | | public class MgtBaseGetDto extends MgtBaseDto{ |
| | | |
| | | @ApiModelProperty(value = "请求对象id") |
| | | private String id; |
| | | |
| | | } |
New file |
| | |
| | | package com.hrt.system.domain.dto; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author jqs34 |
| | | * @ClassName MGTChangeCooperDto |
| | | * @description: TODO |
| | | * @date 2023年04月21日 |
| | | * @version: 1.0 |
| | | */ |
| | | @Data |
| | | public class MgtChangeCoopDto extends MgtBaseDto{ |
| | | |
| | | @ApiModelProperty(value = "商户id") |
| | | private Long shopId; |
| | | |
| | | @ApiModelProperty("合作开始时间") |
| | | private String coopStartTime; |
| | | |
| | | @ApiModelProperty("合作结束时间") |
| | | private String coopEndTime; |
| | | |
| | | } |
New file |
| | |
| | | package com.hrt.system.domain.dto; |
| | | |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author jqs34 |
| | | * @ClassName ManageCreateShopDto |
| | | * @description: TODO |
| | | * @date 2023年04月21日 |
| | | * @version: 1.0 |
| | | */ |
| | | @Data |
| | | public class MgtEditShopDto extends MgtBaseDto{ |
| | | |
| | | |
| | | @ApiModelProperty(value = "商户id,新增不传") |
| | | private Long shopId; |
| | | |
| | | @ApiModelProperty("商户名称") |
| | | private String shopName; |
| | | |
| | | @ApiModelProperty("商户类型1.经销商2.代理商") |
| | | private Integer shopType; |
| | | |
| | | @ApiModelProperty("营业开始时间") |
| | | private String businessStartTime; |
| | | |
| | | @ApiModelProperty("营业结束时间") |
| | | private String businessEndTime; |
| | | |
| | | @ApiModelProperty("店主姓名") |
| | | private String shopownerName; |
| | | |
| | | @ApiModelProperty("店主联系方式") |
| | | private String shopownerPhone; |
| | | |
| | | @ApiModelProperty("签约区域") |
| | | private String signAreaCode; |
| | | |
| | | @ApiModelProperty("商户服务电话") |
| | | private String shopServicePhone; |
| | | |
| | | @ApiModelProperty("管辖员工") |
| | | private Long belongUserId; |
| | | |
| | | @ApiModelProperty("所属经销商") |
| | | private Long belongShopId; |
| | | |
| | | @ApiModelProperty("扶持能力1.有2.没有") |
| | | private Integer supportingCapacityFlag; |
| | | |
| | | @ApiModelProperty("店面操作人数1.1人2.1人以上") |
| | | private Integer operationPersonFlag; |
| | | |
| | | @ApiModelProperty("执行力1.强2.弱") |
| | | private Integer executiveForceFlag; |
| | | |
| | | @ApiModelProperty("格局1.大2.小") |
| | | private Integer patternFlag; |
| | | |
| | | @ApiModelProperty("人脉1.宽2.窄") |
| | | private Integer connectionFlag; |
| | | |
| | | @ApiModelProperty("经济能力1.强2.差") |
| | | private Integer economicAbilityFlag; |
| | | |
| | | @ApiModelProperty("与合作商关系1.好2.差") |
| | | private Integer relationPartner; |
| | | |
| | | @ApiModelProperty("曾从事事业") |
| | | private String businessHistory; |
| | | |
| | | @ApiModelProperty("店铺地址省code") |
| | | private String shopProvinceCode; |
| | | |
| | | @ApiModelProperty("店铺地址市code") |
| | | private String shopCityCode; |
| | | |
| | | @ApiModelProperty("店铺地址区code") |
| | | private String shopAreaCode; |
| | | |
| | | @ApiModelProperty("店铺区域全称") |
| | | private String shopAreaName; |
| | | |
| | | @ApiModelProperty("店铺详细地址") |
| | | private String shopAddress; |
| | | |
| | | @ApiModelProperty("店铺经度") |
| | | private String shopLongitude; |
| | | |
| | | @ApiModelProperty("店铺维度") |
| | | private String shopLatitude; |
| | | |
| | | @ApiModelProperty("店铺详情") |
| | | private String shopDetail; |
| | | |
| | | @ApiModelProperty("营销功能1开2关") |
| | | private Integer marketingFunctionFlag; |
| | | |
| | | @ApiModelProperty("领券1开2关") |
| | | private Integer platformCouponFlag; |
| | | |
| | | @ApiModelProperty("生日卡1开2关") |
| | | private Integer platformBirthdayFlag; |
| | | |
| | | @ApiModelProperty("推荐人") |
| | | private String recommendPerson; |
| | | |
| | | @ApiModelProperty("商户标签id 多个用,隔开") |
| | | private String shopTagIds; |
| | | |
| | | @ApiModelProperty("关联用户id 多个用,隔开") |
| | | private String relUserIds; |
| | | |
| | | @ApiModelProperty("商户封面") |
| | | private String shopPicture; |
| | | |
| | | @ApiModelProperty("商户banner 多个用,隔开") |
| | | private String shopBanners; |
| | | } |
New file |
| | |
| | | package com.hrt.system.domain.dto; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author jqs34 |
| | | * @ClassName MgtEditShopTagDto |
| | | * @description: TODO |
| | | * @date 2023年04月21日 |
| | | * @version: 1.0 |
| | | */ |
| | | @Data |
| | | public class MgtEditShopTagDto extends MgtBaseGetDto{ |
| | | |
| | | @ApiModelProperty("商户标签id 多个用,隔开") |
| | | private String shopTagIds; |
| | | |
| | | } |
New file |
| | |
| | | package com.hrt.system.domain.dto; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author jqs34 |
| | | * @ClassName AppPageDto |
| | | * @description: TODO |
| | | * @date 2023年04月20日 |
| | | * @version: 1.0 |
| | | */ |
| | | @Data |
| | | public class MgtPageDto extends MgtBaseDto{ |
| | | |
| | | @ApiModelProperty(name = "pagenum", value = "页码") |
| | | private Integer pageNum = 1; |
| | | |
| | | |
| | | @ApiModelProperty(name = "pagesize", value = "每页显示条数") |
| | | private Integer pageSize = 20; |
| | | |
| | | } |
New file |
| | |
| | | package com.hrt.system.domain.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author jqs34 |
| | | * @ClassName MgtShopPageDto |
| | | * @description: TODO |
| | | * @date 2023年04月21日 |
| | | * @version: 1.0 |
| | | */ |
| | | @Data |
| | | public class MgtShopPageDto extends MgtPageDto{ |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.hrt.system.domain.poji.activity; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-04-21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_activity_goods") |
| | | public class ActivityGoods extends Model<ActivityGoods> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 活动商品id |
| | | */ |
| | | @TableId("ag_id") |
| | | private Long agId; |
| | | /** |
| | | * 商品id |
| | | */ |
| | | @TableField("del_flag") |
| | | private Integer delFlag; |
| | | /** |
| | | * 商品id |
| | | */ |
| | | @TableField("goods_id") |
| | | private String goodsId; |
| | | /** |
| | | * 活动id |
| | | */ |
| | | @TableField("activity_id") |
| | | private String activityId; |
| | | /** |
| | | * 活动价格 |
| | | */ |
| | | @TableField("activity_price") |
| | | private BigDecimal activityPrice; |
| | | /** |
| | | * 活动销售数量 |
| | | */ |
| | | @TableField("activity_number") |
| | | private Integer activityNumber; |
| | | /** |
| | | * 活动已售数量 |
| | | */ |
| | | @TableField("sales_number") |
| | | private Integer salesNumber; |
| | | |
| | | /** |
| | | * 活动截止时间 |
| | | */ |
| | | @TableField(value = "activity_deadline") |
| | | private Date activityDeadline; |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.goodsId; |
| | | } |
| | | |
| | | } |
| | |
| | | @TableField("sign_time") |
| | | private Date signTime; |
| | | /** |
| | | * 签约区域 |
| | | * 签约省code |
| | | */ |
| | | @TableField("sign_province_code") |
| | | private String signProvinceCode; |
| | | /** |
| | | * 签约市code |
| | | */ |
| | | @TableField("sign_city_code") |
| | | private String signCityCode; |
| | | /** |
| | | * 签约区域code |
| | | */ |
| | | @TableField("sign_area_code") |
| | | private String signAreaCode; |
| | | /** |
| | | * 签约区域全称 |
| | | */ |
| | | @TableField("sign_area_name") |
| | | private String signAreaName; |
| | | |
| | | /** |
| | | * 商户服务电话 |
| | | */ |
| | |
| | | */ |
| | | @TableField("recommend_person") |
| | | private String recommendPerson; |
| | | |
| | | |
| | | /** |
| | | * 合作截止时间 |
| | | */ |
| | |
| | | */ |
| | | @TableField("cooperation_start_time") |
| | | private Date cooperationStartTime; |
| | | |
| | | /** |
| | | * 商户标签 |
| | | */ |
| | | @TableField("shop_tags") |
| | | private String shopTags; |
| | | |
| | | /** |
| | | * 签约人 |
| | | */ |
| | | @TableField("sign_user_id") |
| | | private Long signUserId; |
| | | |
| | | /** |
| | | * 来源渠道 |
| | | */ |
| | | @TableField("shop_source") |
| | | private String shopSource; |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | |
| | | /** |
| | | * 商户服务次数 |
| | | */ |
| | | @TableField("service_time") |
| | | private Integer serviceTime; |
| | | @TableField("service_num") |
| | | private Integer serviceNum; |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | |
| | | */ |
| | | @TableField("user_dept_id") |
| | | private Long userDeptId; |
| | | |
| | | /** |
| | | * 用户姓名 |
| | | */ |
| | | @TableField("user_name") |
| | | private String userName; |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | |
| | | package com.hrt.system.domain.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author jqs34 |
| | |
| | | @ApiModelProperty(value = "商品调理问题") |
| | | private BigDecimal goodsNurses; |
| | | |
| | | @ApiModelProperty("服务次数") |
| | | private Integer serviceNum; |
| | | |
| | | @ApiModelProperty(value = "商品售价") |
| | | private BigDecimal salesPrice; |
| | | |
| | | @ApiModelProperty(value = "商品活动价") |
| | | private BigDecimal activityPrice; |
| | | |
| | | @ApiModelProperty(value = "商品详情") |
| | | private String goodsDetail; |
| | | |
| | | @ApiModelProperty(value = "销售数量") |
| | | private Integer salesNum; |
| | | |
| | | @ApiModelProperty(value = "是否活动跳转0否1是") |
| | | private Integer activityFlag; |
| | | |
| | | @ApiModelProperty(value = "商品活动价") |
| | | private BigDecimal activityPrice; |
| | | |
| | | @ApiModelProperty(value = "售罄标记0否1是") |
| | | private Integer sellOutFlag; |
| | | |
| | | @ApiModelProperty(value = "活动截止时间") |
| | | private Date activityDeadline; |
| | | } |
New file |
| | |
| | | package com.hrt.system.domain.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author jqs34 |
| | | * @ClassName MerHomeShopTotalVo |
| | | * @description: TODO |
| | | * @date 2023年04月21日 |
| | | * @version: 1.0 |
| | | */ |
| | | @Data |
| | | public class MerHomeShopTotalVo { |
| | | |
| | | @ApiModelProperty(value = "商户id") |
| | | private Long shopId; |
| | | |
| | | @ApiModelProperty(value = "今日到店") |
| | | private Integer todayShop; |
| | | |
| | | @ApiModelProperty(value = "待处理订单") |
| | | private Integer unHandleOrder; |
| | | |
| | | @ApiModelProperty(value = "跟进任务") |
| | | private Integer task; |
| | | |
| | | @ApiModelProperty(value = "店铺营业额") |
| | | private BigDecimal shopTurnover; |
| | | |
| | | @ApiModelProperty(value = "剩余周期人数") |
| | | private Integer cycleSurp; |
| | | |
| | | @ApiModelProperty(value = "剩余体验人数") |
| | | private Integer explorationSurp; |
| | | |
| | | } |
New file |
| | |
| | | package com.hrt.system.domain.vo; |
| | | |
| | | import com.hrt.system.domain.poji.shop.ShopCertificate; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author jqs34 |
| | | * @ClassName MerShopInfoVo |
| | | * @description: TODO |
| | | * @date 2023年04月21日 |
| | | * @version: 1.0 |
| | | */ |
| | | @Data |
| | | public class MerShopInfoVo { |
| | | |
| | | @ApiModelProperty(value = "商户id") |
| | | private Long shopId; |
| | | |
| | | @ApiModelProperty("商户名称") |
| | | private String shopName; |
| | | |
| | | @ApiModelProperty("商户类型1.经销商2.代理商") |
| | | private Integer shopType; |
| | | |
| | | @ApiModelProperty("营业开始时间") |
| | | private String businessStartTime; |
| | | |
| | | @ApiModelProperty("营业结束时间") |
| | | private String businessEndTime; |
| | | |
| | | @ApiModelProperty("店主姓名") |
| | | private String shopownerName; |
| | | |
| | | @ApiModelProperty("店主联系方式") |
| | | private String shopownerPhone; |
| | | |
| | | @ApiModelProperty("签约区域") |
| | | private String signAreaCode; |
| | | |
| | | @ApiModelProperty("商户服务电话") |
| | | private String shopServicePhone; |
| | | |
| | | @ApiModelProperty("管辖员工") |
| | | private Long belongUserId; |
| | | |
| | | @ApiModelProperty("所属经销商") |
| | | private Long belongShopId; |
| | | |
| | | @ApiModelProperty("扶持能力1.有2.没有") |
| | | private Integer supportingCapacityFlag; |
| | | |
| | | @ApiModelProperty("店面操作人数1.1人2.1人以上") |
| | | private Integer operationPersonFlag; |
| | | |
| | | @ApiModelProperty("执行力1.强2.弱") |
| | | private Integer executiveForceFlag; |
| | | |
| | | @ApiModelProperty("格局1.大2.小") |
| | | private Integer patternFlag; |
| | | |
| | | @ApiModelProperty("人脉1.宽2.窄") |
| | | private Integer connectionFlag; |
| | | |
| | | @ApiModelProperty("经济能力1.强2.差") |
| | | private Integer economicAbilityFlag; |
| | | |
| | | @ApiModelProperty("与合作商关系1.好2.差") |
| | | private Integer relationPartner; |
| | | |
| | | @ApiModelProperty("曾从事事业") |
| | | private String businessHistory; |
| | | |
| | | @ApiModelProperty("店铺地址省code") |
| | | private String shopProvinceCode; |
| | | |
| | | @ApiModelProperty("店铺地址市code") |
| | | private String shopCityCode; |
| | | |
| | | @ApiModelProperty("店铺地址区code") |
| | | private String shopAreaCode; |
| | | |
| | | @ApiModelProperty("店铺区域全称") |
| | | private String shopAreaName; |
| | | |
| | | @ApiModelProperty("店铺详细地址") |
| | | private String shopAddress; |
| | | |
| | | @ApiModelProperty("店铺经度") |
| | | private String shopLongitude; |
| | | |
| | | @ApiModelProperty("店铺维度") |
| | | private String shopLatitude; |
| | | |
| | | @ApiModelProperty("店铺详情") |
| | | private String shopDetail; |
| | | |
| | | @ApiModelProperty("营销功能1开2关") |
| | | private Integer marketingFunctionFlag; |
| | | |
| | | @ApiModelProperty("领券1开2关") |
| | | private Integer platformCouponFlag; |
| | | |
| | | @ApiModelProperty("生日卡1开2关") |
| | | private Integer platformBirthdayFlag; |
| | | |
| | | @ApiModelProperty("推荐人") |
| | | private String recommendPerson; |
| | | |
| | | @ApiModelProperty("商户标签id 多个用,隔开") |
| | | private String shopTagIds; |
| | | |
| | | @ApiModelProperty("商户标签") |
| | | private String shopTags; |
| | | |
| | | @ApiModelProperty("关联用户id 多个用,隔开") |
| | | private String relUserIds; |
| | | |
| | | @ApiModelProperty("关联用户") |
| | | private String relUsers; |
| | | |
| | | @ApiModelProperty("商户封面") |
| | | private String shopPicture; |
| | | |
| | | @ApiModelProperty("商户banner 多个用,隔开") |
| | | private String shopBanners; |
| | | |
| | | @ApiModelProperty("证书list") |
| | | private List<ShopCertificate> shopCertificateList; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.hrt.system.domain.vo; |
| | | |
| | | import com.hrt.system.domain.poji.shop.ShopCertificate; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author jqs34 |
| | | * @ClassName MgtShopInfoVo |
| | | * @description: TODO |
| | | * @date 2023年04月21日 |
| | | * @version: 1.0 |
| | | */ |
| | | @Data |
| | | public class MgtShopInfoVo { |
| | | |
| | | @ApiModelProperty(value = "商户id") |
| | | private Long shopId; |
| | | |
| | | @ApiModelProperty("商户名称") |
| | | private String shopName; |
| | | |
| | | @ApiModelProperty("商户类型1.经销商2.代理商") |
| | | private Integer shopType; |
| | | |
| | | @ApiModelProperty("营业开始时间") |
| | | private String businessStartTime; |
| | | |
| | | @ApiModelProperty("营业结束时间") |
| | | private String businessEndTime; |
| | | |
| | | @ApiModelProperty("店主姓名") |
| | | private String shopownerName; |
| | | |
| | | @ApiModelProperty("店主联系方式") |
| | | private String shopownerPhone; |
| | | |
| | | @ApiModelProperty("签约区域") |
| | | private String signAreaCode; |
| | | |
| | | @ApiModelProperty("商户服务电话") |
| | | private String shopServicePhone; |
| | | |
| | | @ApiModelProperty("管辖员工") |
| | | private Long belongUserId; |
| | | |
| | | @ApiModelProperty("所属经销商") |
| | | private Long belongShopId; |
| | | |
| | | @ApiModelProperty("扶持能力1.有2.没有") |
| | | private Integer supportingCapacityFlag; |
| | | |
| | | @ApiModelProperty("店面操作人数1.1人2.1人以上") |
| | | private Integer operationPersonFlag; |
| | | |
| | | @ApiModelProperty("执行力1.强2.弱") |
| | | private Integer executiveForceFlag; |
| | | |
| | | @ApiModelProperty("格局1.大2.小") |
| | | private Integer patternFlag; |
| | | |
| | | @ApiModelProperty("人脉1.宽2.窄") |
| | | private Integer connectionFlag; |
| | | |
| | | @ApiModelProperty("经济能力1.强2.差") |
| | | private Integer economicAbilityFlag; |
| | | |
| | | @ApiModelProperty("与合作商关系1.好2.差") |
| | | private Integer relationPartner; |
| | | |
| | | @ApiModelProperty("曾从事事业") |
| | | private String businessHistory; |
| | | |
| | | @ApiModelProperty("店铺地址省code") |
| | | private String shopProvinceCode; |
| | | |
| | | @ApiModelProperty("店铺地址市code") |
| | | private String shopCityCode; |
| | | |
| | | @ApiModelProperty("店铺地址区code") |
| | | private String shopAreaCode; |
| | | |
| | | @ApiModelProperty("店铺区域全称") |
| | | private String shopAreaName; |
| | | |
| | | @ApiModelProperty("店铺详细地址") |
| | | private String shopAddress; |
| | | |
| | | @ApiModelProperty("店铺经度") |
| | | private String shopLongitude; |
| | | |
| | | @ApiModelProperty("店铺维度") |
| | | private String shopLatitude; |
| | | |
| | | @ApiModelProperty("店铺详情") |
| | | private String shopDetail; |
| | | |
| | | @ApiModelProperty("营销功能1开2关") |
| | | private Integer marketingFunctionFlag; |
| | | |
| | | @ApiModelProperty("领券1开2关") |
| | | private Integer platformCouponFlag; |
| | | |
| | | @ApiModelProperty("生日卡1开2关") |
| | | private Integer platformBirthdayFlag; |
| | | |
| | | @ApiModelProperty("推荐人") |
| | | private String recommendPerson; |
| | | |
| | | @ApiModelProperty("商户标签id 多个用,隔开") |
| | | private String shopTagIds; |
| | | |
| | | @ApiModelProperty("商户标签") |
| | | private String shopTags; |
| | | |
| | | @ApiModelProperty("关联用户id 多个用,隔开") |
| | | private String relUserIds; |
| | | |
| | | @ApiModelProperty("关联用户") |
| | | private String relUsers; |
| | | |
| | | @ApiModelProperty("商户封面") |
| | | private String shopPicture; |
| | | |
| | | @ApiModelProperty("商户banner 多个用,隔开") |
| | | private String shopBanners; |
| | | |
| | | @ApiModelProperty("证书list") |
| | | private List<ShopCertificate> shopCertificateList; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.hrt.system.domain.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author jqs34 |
| | | * @ClassName MgtShopPageVo |
| | | * @description: TODO |
| | | * @date 2023年04月21日 |
| | | * @version: 1.0 |
| | | */ |
| | | @Data |
| | | public class MgtShopPageVo { |
| | | |
| | | @ApiModelProperty(value = "商户id") |
| | | private Long shopId; |
| | | |
| | | @ApiModelProperty("签约时间") |
| | | private String signTime; |
| | | |
| | | @ApiModelProperty("商户名称") |
| | | private String shopName; |
| | | |
| | | @ApiModelProperty("商户编号") |
| | | private String shopNumber; |
| | | |
| | | @ApiModelProperty("商户标签") |
| | | private String shopTags; |
| | | |
| | | @ApiModelProperty("签约人") |
| | | private String signUser; |
| | | |
| | | @ApiModelProperty("首提金额") |
| | | private BigDecimal firstWithdraw; |
| | | |
| | | @ApiModelProperty("关联员工") |
| | | private BigDecimal belongUser; |
| | | |
| | | @ApiModelProperty("关联部门") |
| | | private BigDecimal belongDept; |
| | | |
| | | @ApiModelProperty("来源渠道") |
| | | private String shopSource; |
| | | |
| | | @ApiModelProperty("签约区域") |
| | | private String signAreaName; |
| | | |
| | | @ApiModelProperty("合作期限") |
| | | private String cooperationTime; |
| | | |
| | | @ApiModelProperty("店铺地址") |
| | | private String shopAddress; |
| | | |
| | | @ApiModelProperty("店主姓名") |
| | | private String shopownerName; |
| | | |
| | | @ApiModelProperty("店主联系方式") |
| | | private String shopownerPhone; |
| | | |
| | | @ApiModelProperty("商户状态-1删除0冻结1正常2终止合作") |
| | | private Integer shopStatus; |
| | | |
| | | @ApiModelProperty("商户活动次数") |
| | | private Integer shopActivityCount; |
| | | |
| | | @ApiModelProperty("店铺设置状态") |
| | | private String shopCustomStatus; |
| | | } |
New file |
| | |
| | | package com.hrt.system.domain.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author jqs34 |
| | | * @ClassName MgtShopTagVo |
| | | * @description: TODO |
| | | * @date 2023年04月21日 |
| | | * @version: 1.0 |
| | | */ |
| | | @Data |
| | | public class MgtShopTagVo { |
| | | |
| | | @ApiModelProperty(value = "标签id") |
| | | private Long tagId; |
| | | |
| | | @ApiModelProperty(value = "标签名称") |
| | | private String tagName; |
| | | |
| | | @ApiModelProperty(value = "是否选择0否1是") |
| | | private Integer selectFlag; |
| | | |
| | | } |
New file |
| | |
| | | package com.hrt.system.mapper.activity; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.hrt.system.domain.poji.activity.ActivityGoods; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-04-21 |
| | | */ |
| | | public interface ActivityGoodsMapper extends BaseMapper<ActivityGoods> { |
| | | |
| | | } |
| | |
| | | */ |
| | | public interface ShopFileMapper extends BaseMapper<ShopFile> { |
| | | |
| | | /** |
| | | * 通过商户id删除关联 |
| | | * @param shopId |
| | | */ |
| | | void deleteByShopId(Long shopId); |
| | | } |
| | |
| | | package com.hrt.system.mapper.shop; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.hrt.system.domain.dto.MgtShopPageDto; |
| | | import com.hrt.system.domain.poji.shop.Shop; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.hrt.system.domain.vo.MgtShopPageVo; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @since 2023-04-17 |
| | | */ |
| | | public interface ShopMapper extends BaseMapper<Shop> { |
| | | |
| | | /** |
| | | * 分页获取商户 |
| | | * @param page |
| | | * @param mgtShopPageDto |
| | | * @return |
| | | */ |
| | | List<MgtShopPageVo> pageShop(Page page, MgtShopPageDto mgtShopPageDto); |
| | | } |
| | |
| | | |
| | | import com.hrt.system.domain.poji.shop.ShopRelTag; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.hrt.system.domain.vo.MgtShopTagVo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface ShopRelTagMapper extends BaseMapper<ShopRelTag> { |
| | | |
| | | |
| | | /** |
| | | * 通过商户id删除关联 |
| | | * @param shopId |
| | | */ |
| | | void deleteByShopId(@Param("param") Long shopId); |
| | | |
| | | /** |
| | | * 获取商户标签 |
| | | * @param shopId |
| | | * @return |
| | | */ |
| | | List<MgtShopTagVo> listShopTagVo(@Param("param")Long shopId); |
| | | } |
| | |
| | | */ |
| | | public interface ShopRelUserMapper extends BaseMapper<ShopRelUser> { |
| | | |
| | | /** |
| | | * 通过商户id删除关联 |
| | | * @param shopId |
| | | */ |
| | | void deleteByShopId(Long shopId); |
| | | } |
New file |
| | |
| | | package com.hrt.system.service.activity; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.hrt.system.domain.poji.activity.ActivityGoods; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-04-21 |
| | | */ |
| | | public interface ActivityGoodsService extends IService<ActivityGoods> { |
| | | |
| | | /** |
| | | * 通过id获取活动商品 |
| | | * @param goodsId |
| | | * @return |
| | | */ |
| | | ActivityGoods getByGoodsId(String goodsId); |
| | | } |
New file |
| | |
| | | package com.hrt.system.service.impl; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.hrt.system.domain.poji.activity.ActivityGoods; |
| | | import com.hrt.system.domain.poji.shop.ShopRelTag; |
| | | import com.hrt.system.mapper.activity.ActivityGoodsMapper; |
| | | import com.hrt.system.service.activity.ActivityGoodsService; |
| | | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-04-21 |
| | | */ |
| | | @Service |
| | | public class ActivityGoodsServiceImpl extends ServiceImpl<ActivityGoodsMapper, ActivityGoods> implements ActivityGoodsService { |
| | | |
| | | |
| | | /** |
| | | * 通过id获取活动商品 |
| | | * @param goodsId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ActivityGoods getByGoodsId(String goodsId){ |
| | | LambdaQueryWrapper<ActivityGoods> queryWrapper = Wrappers.lambdaQuery(); |
| | | queryWrapper.eq(ActivityGoods::getDelFlag, 0).eq(ActivityGoods::getGoodsId, goodsId); |
| | | ActivityGoods activityGoods = this.getOne(queryWrapper); |
| | | return activityGoods; |
| | | } |
| | | } |
| | |
| | | import com.hrt.system.domain.dto.AppGoodsInfoGetDto; |
| | | import com.hrt.system.domain.dto.AppSearchGoodsPageDto; |
| | | import com.hrt.system.domain.dto.AppShopGoodsPageDto; |
| | | import com.hrt.system.domain.poji.activity.ActivityGoods; |
| | | import com.hrt.system.domain.poji.goods.Goods; |
| | | import com.hrt.system.domain.poji.shop.ShopGoods; |
| | | import com.hrt.system.domain.vo.AppGoodsInfoVo; |
| | | import com.hrt.system.domain.vo.AppSimpleActivityGoodsVo; |
| | | import com.hrt.system.domain.vo.AppSimpleGoodsVo; |
| | | import com.hrt.system.mapper.goods.GoodsMapper; |
| | | import com.hrt.system.service.activity.ActivityGoodsService; |
| | | import com.hrt.system.service.goods.GoodsService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.hrt.system.service.shop.ShopGoodsService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | |
| | | @Resource |
| | | private GoodsMapper goodsMapper; |
| | | |
| | | @Resource |
| | | private ActivityGoodsService activityGoodsService; |
| | | |
| | | @Resource |
| | | private ShopGoodsService shopGoodsService; |
| | | |
| | | /** |
| | | * 获取推荐商品列表 |
| | |
| | | AppGoodsInfoVo appGoodsInfoVo = new AppGoodsInfoVo(); |
| | | Goods goods = this.getById(appGoodsInfoGetDto.getId()); |
| | | BeanUtils.copyProperties(goods, appGoodsInfoVo); |
| | | //商户定制价格 |
| | | ShopGoods shopGoods = shopGoodsService.getByShopIdAndGoodsId(appGoodsInfoGetDto.getShopId(),goods.getGoodsId()); |
| | | if(shopGoods!=null){ |
| | | appGoodsInfoVo.setSalesPrice(shopGoods.getSalesPrice()); |
| | | appGoodsInfoVo.setSalesNum(shopGoods.getServiceNum()); |
| | | } |
| | | //活动商品判断 |
| | | if(appGoodsInfoGetDto.getActivityFlag()==1){ |
| | | |
| | | ActivityGoods activityGoods = activityGoodsService.getByGoodsId(goods.getGoodsId()); |
| | | //原价取较大值 |
| | | if(shopGoods!=null&&goods.getSalesPrice().compareTo(shopGoods.getSalesPrice())>0){ |
| | | appGoodsInfoVo.setSalesPrice(goods.getSalesPrice()); |
| | | } |
| | | appGoodsInfoVo.setActivityFlag(1); |
| | | appGoodsInfoVo.setActivityPrice(activityGoods.getActivityPrice()); |
| | | appGoodsInfoVo.setSalesNum(activityGoods.getSalesNumber()); |
| | | appGoodsInfoVo.setActivityDeadline(activityGoods.getActivityDeadline()); |
| | | //售罄判断 |
| | | if(activityGoods.getActivityNumber()==activityGoods.getSalesNumber()){ |
| | | appGoodsInfoVo.setSellOutFlag(1); |
| | | }else{ |
| | | appGoodsInfoVo.setSellOutFlag(0); |
| | | } |
| | | }else{ |
| | | appGoodsInfoVo.setActivityFlag(0); |
| | | } |
| | | return appGoodsInfoVo; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @Service |
| | | public class ShopFileServiceImpl extends ServiceImpl<ShopFileMapper, ShopFile> implements ShopFileService { |
| | | |
| | | @Resource |
| | | private ShopFileMapper shopFileMapper; |
| | | |
| | | /** |
| | | * 通过商户id获取商户文件 |
| | |
| | | return this.list(queryWrapper); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 通过商户id删除关联 |
| | | * @param shopId |
| | | */ |
| | | @Override |
| | | public void deleteByShopId(Long shopId){ |
| | | shopFileMapper.deleteByShopId(shopId); |
| | | } |
| | | } |
| | |
| | | package com.hrt.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.hrt.system.domain.poji.activity.ActivityGoods; |
| | | import com.hrt.system.domain.poji.shop.ShopGoods; |
| | | import com.hrt.system.mapper.shop.ShopGoodsMapper; |
| | | import com.hrt.system.service.shop.ShopGoodsService; |
| | |
| | | @Service |
| | | public class ShopGoodsServiceImpl extends ServiceImpl<ShopGoodsMapper, ShopGoods> implements ShopGoodsService { |
| | | |
| | | /** |
| | | * 通过商户id和商品id获取 |
| | | * @param shopId |
| | | * @param goodsId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ShopGoods getByShopIdAndGoodsId(Long shopId,String goodsId){ |
| | | LambdaQueryWrapper<ShopGoods> queryWrapper = Wrappers.lambdaQuery(); |
| | | queryWrapper.eq(ShopGoods::getDelFlag, 0).eq(ShopGoods::getShopId, shopId).eq(ShopGoods::getGoodsId, goodsId); |
| | | ShopGoods shopGoods = this.getOne(queryWrapper); |
| | | return shopGoods; |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.hrt.system.domain.poji.shop.ShopFile; |
| | | import com.hrt.system.domain.poji.shop.ShopRelTag; |
| | | import com.hrt.system.domain.vo.MgtShopTagVo; |
| | | import com.hrt.system.mapper.shop.ShopRelTagMapper; |
| | | import com.hrt.system.service.shop.ShopRelTagService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @Service |
| | | public class ShopRelTagServiceImpl extends ServiceImpl<ShopRelTagMapper, ShopRelTag> implements ShopRelTagService { |
| | | |
| | | @Resource |
| | | private ShopRelTagMapper shopRelTagMapper; |
| | | |
| | | /** |
| | | * 通过商户id获取标签 |
| | | * @param shopId |
| | |
| | | queryWrapper.eq(ShopRelTag::getDelFlag, 0).eq(ShopRelTag::getShopId, shopId); |
| | | return this.list(queryWrapper); |
| | | } |
| | | |
| | | /** |
| | | * 通过商户id删除关联 |
| | | * @param shopId |
| | | */ |
| | | @Override |
| | | public void deleteByShopId(Long shopId){ |
| | | shopRelTagMapper.deleteByShopId(shopId); |
| | | } |
| | | |
| | | /** |
| | | * 获取商户标签 |
| | | * @param shopId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<MgtShopTagVo> listShopTagVo(Long shopId){ |
| | | return shopRelTagMapper.listShopTagVo(shopId); |
| | | } |
| | | } |
| | |
| | | package com.hrt.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.hrt.system.domain.poji.shop.ShopRelTag; |
| | | import com.hrt.system.domain.poji.shop.ShopRelUser; |
| | | import com.hrt.system.mapper.shop.ShopRelUserMapper; |
| | | import com.hrt.system.service.shop.ShopRelUserService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class ShopRelUserServiceImpl extends ServiceImpl<ShopRelUserMapper, ShopRelUser> implements ShopRelUserService { |
| | | |
| | | @Resource |
| | | private ShopRelUserMapper shopRelUserMapper; |
| | | |
| | | /** |
| | | * 通过商户id删除关联 |
| | | * @param shopId |
| | | */ |
| | | @Override |
| | | public void deleteByShopId(Long shopId){ |
| | | shopRelUserMapper.deleteByShopId(shopId); |
| | | } |
| | | |
| | | /** |
| | | * 通过商户id获取关联用户 |
| | | * @param shopId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<ShopRelUser> listByShopId(Long shopId){ |
| | | LambdaQueryWrapper<ShopRelUser> queryWrapper = Wrappers.lambdaQuery(); |
| | | queryWrapper.eq(ShopRelUser::getDelFlag, 0).eq(ShopRelUser::getShopId, shopId); |
| | | return this.list(queryWrapper); |
| | | } |
| | | } |
| | |
| | | package com.hrt.system.service.impl; |
| | | |
| | | import com.hrt.system.domain.poji.shop.Shop; |
| | | import com.hrt.system.domain.poji.shop.ShopCertificate; |
| | | import com.hrt.system.domain.poji.shop.ShopFile; |
| | | import com.hrt.system.domain.poji.shop.ShopRelTag; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.hrt.common.core.utils.StringUtils; |
| | | import com.hrt.system.api.domain.SysUser; |
| | | import com.hrt.system.domain.dto.MgtChangeCoopDto; |
| | | import com.hrt.system.domain.dto.MgtEditShopDto; |
| | | import com.hrt.system.domain.dto.MgtEditShopTagDto; |
| | | import com.hrt.system.domain.dto.MgtShopPageDto; |
| | | import com.hrt.system.domain.poji.shop.*; |
| | | import com.hrt.system.domain.poji.sys.SysTag; |
| | | import com.hrt.system.domain.vo.AppShopInfoVo; |
| | | import com.hrt.system.domain.vo.MgtShopInfoVo; |
| | | import com.hrt.system.domain.vo.MgtShopPageVo; |
| | | import com.hrt.system.mapper.shop.ShopMapper; |
| | | import com.hrt.system.service.shop.ShopCertificateService; |
| | | import com.hrt.system.service.shop.ShopFileService; |
| | | import com.hrt.system.service.shop.ShopRelTagService; |
| | | import com.hrt.system.service.shop.ShopService; |
| | | import com.hrt.system.service.shop.*; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.hrt.system.service.sys.SysTagService; |
| | | import com.hrt.system.service.user.ISysUserService; |
| | | import com.hrt.system.util.CodeFactoryUtil; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.StringJoiner; |
| | | |
| | |
| | | @Resource |
| | | private ShopCertificateService shopCertificateService; |
| | | |
| | | @Resource |
| | | private SysTagService sysTagService; |
| | | |
| | | @Resource |
| | | private ShopRelTagService shopRelTagService; |
| | | |
| | | @Resource |
| | | private ShopRelUserService shopRelUserService; |
| | | |
| | | @Resource |
| | | private ISysUserService sysUserService; |
| | | |
| | | /** |
| | | * 获取商户详情 |
| | | * @param shopId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public AppShopInfoVo getShopInfo(Long shopId){ |
| | | public AppShopInfoVo getAppShopInfo(Long shopId){ |
| | | AppShopInfoVo appShopInfoVo = new AppShopInfoVo(); |
| | | Shop shop = this.getById(shopId); |
| | | BeanUtils.copyProperties(shop,appShopInfoVo); |
| | |
| | | } |
| | | return appShopInfoVo; |
| | | } |
| | | |
| | | /** |
| | | * 创建商户 |
| | | * @param MGTEditShopDto |
| | | */ |
| | | @Override |
| | | public void createShop(MgtEditShopDto MGTEditShopDto){ |
| | | Shop shop = new Shop(); |
| | | if(MGTEditShopDto.getShopId()!=null){ |
| | | shop = this.getById(MGTEditShopDto.getShopId()); |
| | | shop.setUpdateTime(new Date()); |
| | | shop.setUpdateUserId(MGTEditShopDto.getUserId()); |
| | | shop.setShopTags(null); |
| | | //清空关联记录 |
| | | shopFileService.deleteByShopId(shop.getShopId()); |
| | | shopRelTagService.deleteByShopId(shop.getShopId()); |
| | | shopRelUserService.deleteByShopId(shop.getShopId()); |
| | | }else{ |
| | | shop.setShopStatus(2); |
| | | shop.setCreateTime(new Date()); |
| | | shop.setCreateUserId(MGTEditShopDto.getUserId()); |
| | | } |
| | | BeanUtils.copyProperties(MGTEditShopDto,shop); |
| | | this.saveOrUpdate(shop); |
| | | //商户编号 |
| | | if(MGTEditShopDto.getShopId()==null){ |
| | | String shopNo = CodeFactoryUtil.getShopNo(shop.getShopId()); |
| | | shop.setShopNumber(shopNo); |
| | | } |
| | | //商户标签 |
| | | String shopTagIds = MGTEditShopDto.getShopTagIds(); |
| | | if(StringUtils.isNotBlank(shopTagIds)){ |
| | | String[] shopTagIdArray = shopTagIds.split(","); |
| | | ShopRelTag shopRelTag; |
| | | Long tagid; |
| | | StringJoiner shopTagSj = new StringJoiner(","); |
| | | SysTag sysTag; |
| | | for(String str : shopTagIdArray){ |
| | | shopRelTag = new ShopRelTag(); |
| | | tagid = Long.valueOf(str); |
| | | sysTag = sysTagService.getById(tagid); |
| | | shopRelTag.setDelFlag(0); |
| | | shopRelTag.setShopId(shop.getShopId()); |
| | | shopRelTag.setTagId(tagid); |
| | | shopRelTagService.save(shopRelTag); |
| | | shopTagSj.add(sysTag.getTagName()); |
| | | } |
| | | shop.setShopTags(shopTagSj.toString()); |
| | | this.saveOrUpdate(shop); |
| | | } |
| | | //商户关联人员 |
| | | String relUserIds = MGTEditShopDto.getRelUserIds(); |
| | | if(StringUtils.isNotBlank(relUserIds)){ |
| | | String[] relUserIdArray = relUserIds.split(","); |
| | | ShopRelUser shopRelUser; |
| | | Long userId; |
| | | SysUser sysUser; |
| | | for(String str : relUserIdArray){ |
| | | shopRelUser = new ShopRelUser(); |
| | | userId = Long.valueOf(str); |
| | | sysUser = sysUserService.selectUserById(userId); |
| | | shopRelUser.setDelFlag(0); |
| | | shopRelUser.setShopId(shop.getShopId()); |
| | | shopRelUser.setUserId(userId); |
| | | shopRelUser.setUserName(sysUser.getNickName()); |
| | | shopRelUser.setUserMobile(sysUser.getPhonenumber()); |
| | | shopRelUser.setUserDeptId(sysUser.getDeptId()); |
| | | shopRelUserService.save(shopRelUser); |
| | | } |
| | | } |
| | | //商户封面 |
| | | ShopFile shopFile = new ShopFile(); |
| | | shopFile.setDelFlag(0); |
| | | shopFile.setFileType(1); |
| | | shopFile.setFileUrl(MGTEditShopDto.getShopPicture()); |
| | | shopFile.setShopId(shop.getShopId()); |
| | | shopFileService.save(shopFile); |
| | | //商户banner |
| | | if(StringUtils.isNotBlank(MGTEditShopDto.getShopBanners())){ |
| | | String shopBanners= MGTEditShopDto.getShopBanners(); |
| | | String[] shopBannerArray = shopBanners.split(","); |
| | | for(String str : shopBannerArray){ |
| | | shopFile = new ShopFile(); |
| | | shopFile.setDelFlag(0); |
| | | shopFile.setFileType(2); |
| | | shopFile.setFileUrl(str); |
| | | shopFile.setShopId(shop.getShopId()); |
| | | shopFileService.save(shopFile); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 修改合作时间 |
| | | * @param mgtChangeCoopDto |
| | | */ |
| | | @Override |
| | | public void changeCooperationTime(MgtChangeCoopDto mgtChangeCoopDto){ |
| | | Shop shop = this.getById(mgtChangeCoopDto.getShopId()); |
| | | String coopStartTime = mgtChangeCoopDto.getCoopStartTime(); |
| | | String coopEndTime = mgtChangeCoopDto.getCoopEndTime(); |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | try { |
| | | Date coopStartDate = simpleDateFormat.parse(coopStartTime); |
| | | Date coopEndDate = simpleDateFormat.parse(coopEndTime); |
| | | Date nowTime = new Date(); |
| | | shop.setCooperationStartTime(coopStartDate); |
| | | shop.setCooperationEndTime(coopEndDate); |
| | | Boolean inTime = false; |
| | | if(coopStartDate.compareTo(nowTime)<0&&coopEndDate.compareTo(nowTime)>0){ |
| | | inTime = true; |
| | | } |
| | | if(shop.getShopStatus()==2&&inTime){ |
| | | shop.setShopStatus(1); |
| | | } |
| | | shop.setUpdateTime(nowTime); |
| | | shop.setUpdateUserId(mgtChangeCoopDto.getUserId()); |
| | | this.saveOrUpdate(shop); |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 分页获取商户 |
| | | * @param page |
| | | * @param mgtShopPageDto |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<MgtShopPageVo> pageShop(Page page, MgtShopPageDto mgtShopPageDto){ |
| | | List<MgtShopPageVo> mgtShopPageVoList = shopMapper.pageShop(page, mgtShopPageDto); |
| | | return mgtShopPageVoList; |
| | | } |
| | | |
| | | /** |
| | | * 获取商户详情 |
| | | * @param shopId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public MgtShopInfoVo getMgtShopInfo(Long shopId){ |
| | | MgtShopInfoVo mgtShopInfoVo = new MgtShopInfoVo(); |
| | | Shop shop = this.getById(shopId); |
| | | //基本信息拷贝 |
| | | BeanUtils.copyProperties(shop,mgtShopInfoVo); |
| | | //商户标签 |
| | | List<ShopRelTag> shopRelTagList = shopRelTagService.listShopRelTagByShopId(shopId); |
| | | if(shopRelTagList!=null&&!shopRelTagList.isEmpty()){ |
| | | StringJoiner shopTagJs = new StringJoiner(","); |
| | | for(ShopRelTag shopRelTag : shopRelTagList){ |
| | | shopTagJs.add(shopRelTag.getTagId().toString()); |
| | | } |
| | | mgtShopInfoVo.setShopTagIds(shopTagJs.toString()); |
| | | } |
| | | //商户关联用户 |
| | | List<ShopRelUser> shopRelUserList = shopRelUserService.listByShopId(shopId); |
| | | if(shopRelUserList!=null&&!shopRelUserList.isEmpty()){ |
| | | StringJoiner shopUserJs = new StringJoiner(","); |
| | | StringJoiner shopUserNameJs = new StringJoiner(","); |
| | | for(ShopRelUser shopRelUser : shopRelUserList){ |
| | | shopUserJs.add(shopRelUser.getUserId().toString()); |
| | | shopUserNameJs.add(shopRelUser.getUserName()); |
| | | } |
| | | mgtShopInfoVo.setRelUserIds(shopUserJs.toString()); |
| | | mgtShopInfoVo.setRelUsers(shopUserNameJs.toString()); |
| | | } |
| | | //商户图片 |
| | | List<ShopFile> shopFileList = shopFileService.listShopFileByShopId(shopId); |
| | | if(shopFileList!=null&&!shopFileList.isEmpty()){ |
| | | StringJoiner shopBannerJs = new StringJoiner(","); |
| | | for(ShopFile shopFile : shopFileList){ |
| | | if(shopFile.getFileType()==1){ |
| | | mgtShopInfoVo.setShopPicture(shopFile.getFileUrl()); |
| | | }else{ |
| | | shopBannerJs.add(shopFile.getFileUrl()); |
| | | } |
| | | } |
| | | mgtShopInfoVo.setShopBanners(shopBannerJs.toString()); |
| | | } |
| | | //商户证书 |
| | | List<ShopCertificate> shopCertificateList = shopCertificateService.listShopCertificateByShopId(shopId); |
| | | mgtShopInfoVo.setShopCertificateList(shopCertificateList); |
| | | return mgtShopInfoVo; |
| | | } |
| | | |
| | | /** |
| | | * 修改商户标签 |
| | | * @param mgtEditShopTagDto |
| | | */ |
| | | @Override |
| | | public void editShopTag(MgtEditShopTagDto mgtEditShopTagDto){ |
| | | Long shopId = Long.valueOf(mgtEditShopTagDto.getId()); |
| | | String shopTagIds = mgtEditShopTagDto.getShopTagIds(); |
| | | String shopTags = null; |
| | | //删除以前的标签 |
| | | shopRelTagService.deleteByShopId(shopId); |
| | | if(StringUtils.isNotBlank(shopTagIds)){ |
| | | ShopRelTag shopRelTag; |
| | | SysTag sysTag; |
| | | Long tagId; |
| | | String[] shopTagIdArray = shopTagIds.split(","); |
| | | StringJoiner shopTagSj = new StringJoiner(","); |
| | | for(String str : shopTagIdArray){ |
| | | tagId = Long.valueOf(str); |
| | | sysTag = sysTagService.getById(tagId); |
| | | shopRelTag = new ShopRelTag(); |
| | | shopRelTag.setDelFlag(0); |
| | | shopRelTag.setShopId(shopId); |
| | | shopRelTag.setTagId(tagId); |
| | | shopRelTagService.save(shopRelTag); |
| | | shopTagSj.add(sysTag.getTagName()); |
| | | } |
| | | shopTags = shopTagSj.toString(); |
| | | } |
| | | Shop shop = this.getById(shopId); |
| | | shop.setShopTags(shopTags); |
| | | this.saveOrUpdate(shop); |
| | | } |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | List<ShopFile> listShopFileByShopId(Long shopId); |
| | | |
| | | /** |
| | | * 通过商户id删除关联 |
| | | * @param shopId |
| | | */ |
| | | void deleteByShopId(Long shopId); |
| | | } |
| | |
| | | */ |
| | | public interface ShopGoodsService extends IService<ShopGoods> { |
| | | |
| | | /** |
| | | * 通过商户id和商品id获取 |
| | | * @param shopId |
| | | * @param goodsId |
| | | * @return |
| | | */ |
| | | ShopGoods getByShopIdAndGoodsId(Long shopId,String goodsId); |
| | | |
| | | } |
| | |
| | | |
| | | import com.hrt.system.domain.poji.shop.ShopRelTag; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.hrt.system.domain.vo.MgtShopTagVo; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | List<ShopRelTag> listShopRelTagByShopId(Long shopId); |
| | | |
| | | /** |
| | | * 通过商户id删除关联 |
| | | * @param shopId |
| | | */ |
| | | void deleteByShopId(Long shopId); |
| | | |
| | | /** |
| | | * 获取商户标签 |
| | | * @param shopId |
| | | * @return |
| | | */ |
| | | List<MgtShopTagVo> listShopTagVo(Long shopId); |
| | | } |
| | |
| | | import com.hrt.system.domain.poji.shop.ShopRelUser; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 商户关联员工 服务类 |
| | |
| | | */ |
| | | public interface ShopRelUserService extends IService<ShopRelUser> { |
| | | |
| | | /** |
| | | * 通过商户id删除关联 |
| | | * @param shopId |
| | | */ |
| | | void deleteByShopId(Long shopId); |
| | | |
| | | /** |
| | | * 通过商户id获取关联用户 |
| | | * @param shopId |
| | | * @return |
| | | */ |
| | | List<ShopRelUser> listByShopId(Long shopId); |
| | | } |
| | |
| | | package com.hrt.system.service.shop; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.hrt.system.domain.dto.MgtChangeCoopDto; |
| | | import com.hrt.system.domain.dto.MgtEditShopDto; |
| | | import com.hrt.system.domain.dto.MgtEditShopTagDto; |
| | | import com.hrt.system.domain.dto.MgtShopPageDto; |
| | | import com.hrt.system.domain.poji.shop.Shop; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.hrt.system.domain.vo.AppShopInfoVo; |
| | | import com.hrt.system.domain.vo.MgtShopInfoVo; |
| | | import com.hrt.system.domain.vo.MgtShopPageVo; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @param shopId |
| | | * @return |
| | | */ |
| | | AppShopInfoVo getShopInfo(Long shopId); |
| | | AppShopInfoVo getAppShopInfo(Long shopId); |
| | | |
| | | /** |
| | | * 创建商户 |
| | | * @param MGTEditShopDto |
| | | */ |
| | | void createShop(MgtEditShopDto MGTEditShopDto); |
| | | |
| | | /** |
| | | * 修改合作时间 |
| | | * @param mgtChangeCoopDto |
| | | */ |
| | | void changeCooperationTime(MgtChangeCoopDto mgtChangeCoopDto); |
| | | |
| | | /** |
| | | * 分页获取商户 |
| | | * @param page |
| | | * @param mgtShopPageDto |
| | | * @return |
| | | */ |
| | | List<MgtShopPageVo> pageShop(Page page, MgtShopPageDto mgtShopPageDto); |
| | | |
| | | /** |
| | | * 获取商户详情 |
| | | * @param shopId |
| | | * @return |
| | | */ |
| | | MgtShopInfoVo getMgtShopInfo(Long shopId); |
| | | |
| | | /** |
| | | * 修改商户标签 |
| | | * @param mgtEditShopTagDto |
| | | */ |
| | | void editShopTag(MgtEditShopTagDto mgtEditShopTagDto); |
| | | |
| | | /** |
| | | * 获取商户详情 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | //MgtShopInfoVo getMerShopInfo(Long userId); |
| | | } |
New file |
| | |
| | | package com.hrt.system.util; |
| | | |
| | | |
| | | |
| | | import com.hrt.common.core.utils.DateUtils; |
| | | import org.apache.poi.ss.usermodel.DateUtil; |
| | | |
| | | import java.security.SecureRandom; |
| | | import java.util.Date; |
| | | import java.util.Random; |
| | | |
| | | /** |
| | | * @author jqs34 |
| | | * @ClassName CodeFactoryUtil |
| | | * @description: TODO |
| | | * @date 2023年02月13日 |
| | | * @version: 1.0 |
| | | */ |
| | | public class CodeFactoryUtil { |
| | | |
| | | /** |
| | | * APP用户编码 |
| | | */ |
| | | private static final String APP_USER_PREFIX = "HRT_M"; |
| | | |
| | | /** |
| | | * 商户编号 |
| | | */ |
| | | private static final String SHOP_PREFIX = "HRT_S"; |
| | | |
| | | /** |
| | | * 订单前缀 |
| | | */ |
| | | private static final String ORDER_PREFIX = "BO"; |
| | | |
| | | /** |
| | | * 退款订单前缀 |
| | | */ |
| | | private static final String ORDER_REFUND_PREFIX = "RO"; |
| | | |
| | | /** |
| | | * 用户id和随机数总长度 |
| | | */ |
| | | |
| | | private static final int maxLength = 4; |
| | | |
| | | /** |
| | | * 更具id进行加密+加随机数组成固定长度编码 |
| | | */ |
| | | |
| | | public static void main(String[] args) { |
| | | Long orderId = 1L; |
| | | String userNo = getShopNo(orderId); |
| | | System.out.println(userNo); |
| | | } |
| | | |
| | | /** |
| | | * 获取商户编号 |
| | | * |
| | | * @param shopId |
| | | * @return |
| | | */ |
| | | public static String getShopNo(Long shopId) { |
| | | String prefix = SHOP_PREFIX; |
| | | return toFillZeroCode(prefix, maxLength, shopId); |
| | | } |
| | | |
| | | /** |
| | | * 获取会员编号 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | public static String getMemberNo(Long userId) { |
| | | String prefix = APP_USER_PREFIX; |
| | | return toFillZeroCode(prefix, maxLength, userId); |
| | | } |
| | | |
| | | /** |
| | | * 获取订单编号 |
| | | * |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | public static String getOrderNo(Long userId) { |
| | | |
| | | String prefix = DateUtils.parseDateToStr( "yyyyMMddHHmmss",new Date()); |
| | | prefix = ORDER_PREFIX + prefix; |
| | | return toFillZeroCode(prefix, maxLength, userId); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取用户编号 |
| | | * |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | public static String getAppUserNo(Long userId) { |
| | | return toFillZeroCode(APP_USER_PREFIX, 9, userId); |
| | | } |
| | | |
| | | /** |
| | | * 0补位 |
| | | * |
| | | * @param prefix |
| | | * @param totalLength |
| | | * @param id |
| | | * @return |
| | | */ |
| | | private static String toFillZeroCode(String prefix, int totalLength, Long id) { |
| | | String idStr = id.toString(); |
| | | int length = idStr.length(); |
| | | |
| | | int fillLength = totalLength - length; |
| | | StringBuilder idsbs = new StringBuilder(prefix); |
| | | for (int i = 0; i < fillLength; i++) { |
| | | idsbs.append("0"); |
| | | } |
| | | return idsbs.append(idStr).toString(); |
| | | } |
| | | |
| | | /** |
| | | * 随机6位数生成 |
| | | */ |
| | | public static String getRandStr(int num) { |
| | | // 默认6位 |
| | | num = num != 0 ? num : 6; |
| | | Random r = new SecureRandom(); |
| | | StringBuffer str = new StringBuffer(); |
| | | int i = 0; |
| | | while (i < num) { |
| | | str.append(r.nextInt(10)); |
| | | i++; |
| | | } |
| | | return str.toString(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.hrt.system.util; |
| | | |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.net.URLDecoder; |
| | | import java.net.URLEncoder; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | |
| | | public class EmojiUtil { |
| | | /** |
| | | * 编码 |
| | | * |
| | | * @param str 待转换字符串 |
| | | * @return 转换后字符串 |
| | | * @throws UnsupportedEncodingException exception |
| | | * @Description 将字符串中的emoji表情转换成可以在utf-8字符集数据库中保存的格式(表情占4个字节,需要utf8mb4字符集) |
| | | */ |
| | | public static String emojiEncode(String str) |
| | | throws UnsupportedEncodingException { |
| | | String patternString = "([\\x{10000}-\\x{10ffff}\ud800-\udfff])"; |
| | | |
| | | Pattern pattern = Pattern.compile(patternString); |
| | | Matcher matcher = pattern.matcher(str); |
| | | StringBuffer sb = new StringBuffer(); |
| | | while (matcher.find()) { |
| | | try { |
| | | matcher.appendReplacement( |
| | | sb, |
| | | "[[" |
| | | + URLEncoder.encode(matcher.group(1), |
| | | "UTF-8") + "]]"); |
| | | } catch (UnsupportedEncodingException e) { |
| | | // LOG.error("emojiConvert error", e); |
| | | throw e; |
| | | } |
| | | } |
| | | matcher.appendTail(sb); |
| | | // LOG.debug("emojiConvert " + str + " to " + sb.toString() |
| | | // + ", len:" + sb.length()); |
| | | return sb.toString(); |
| | | } |
| | | |
| | | /** |
| | | * 解码 |
| | | * |
| | | * @param str 转换后的字符串 |
| | | * @return 转换前的字符串 |
| | | * @throws UnsupportedEncodingException exception |
| | | * @Description 还原utf8数据库中保存的含转换后emoji表情的字符串 |
| | | */ |
| | | public static String emojiDecode(String str) |
| | | throws UnsupportedEncodingException { |
| | | String patternString = "\\[\\[(.*?)\\]\\]"; |
| | | |
| | | Pattern pattern = Pattern.compile(patternString); |
| | | if (str == null) { |
| | | return str; |
| | | } |
| | | Matcher matcher = pattern.matcher(str); |
| | | |
| | | StringBuffer sb = new StringBuffer(); |
| | | while (matcher.find()) { |
| | | try { |
| | | matcher.appendReplacement(sb, |
| | | URLDecoder.decode(matcher.group(1), "UTF-8")); |
| | | } catch (UnsupportedEncodingException e) { |
| | | // LOG.error("emojiRecovery error", e); |
| | | throw e; |
| | | } |
| | | } |
| | | matcher.appendTail(sb); |
| | | // LOG.debug("emojiRecovery " + str + " to " + sb.toString()); |
| | | // System.out.println("emojiRecovery " + str + " to " + sb.toString()); |
| | | return sb.toString(); |
| | | } |
| | | |
| | | /** |
| | | * @param str 待过滤字符串 |
| | | * @return 过滤后字符串 |
| | | * exception |
| | | * @Description 将字符串中的emoji表情过滤掉 |
| | | */ |
| | | public static String emojiSub(String str) { |
| | | String patternString = "([\\x{10000}-\\x{10ffff}\ud800-\udfff])"; |
| | | Pattern pattern = Pattern.compile(patternString); |
| | | Matcher matcher = pattern.matcher(str); |
| | | StringBuffer sb = new StringBuffer(); |
| | | while (matcher.find()) { |
| | | matcher.appendReplacement(sb, ""); |
| | | } |
| | | matcher.appendTail(sb); |
| | | return sb.toString(); |
| | | } |
| | | |
| | | } |
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.hrt.system.mapper.activity.ActivityGoodsMapper"> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.hrt.system.mapper.member.MemberMapper"> |
| | | |
| | | <select id="getOneByMiniOpenid" resultType="com.hrt.system.pojo.Member"> |
| | | <select id="getOneByMiniOpenid" resultType="com.hrt.system.domain.poji.member.Member"> |
| | | SELECT * FROM t_member WHERE mini_openid = #{miniOpenid} |
| | | </select> |
| | | |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.hrt.system.mapper.shop.ShopFileMapper"> |
| | | |
| | | |
| | | <update id="deleteByShopId"> |
| | | UPDATE shop_file SET del_flag = 1 WHERE shop_id = #{shopId} |
| | | </update> |
| | | |
| | | </mapper> |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.hrt.system.mapper.shop.ShopMapper"> |
| | | |
| | | <select id="pageShop" resultType="com.hrt.system.domain.vo.MgtShopPageVo"> |
| | | SELECT |
| | | ts.shop_id shopId, |
| | | ts.sign_time signTime, |
| | | ts.shop_name shopName, |
| | | ts.shop_number shopNumber, |
| | | ts.shop_tags shopTags, |
| | | sus.nick_name signUser, |
| | | null firstWithdraw, |
| | | sub.nick_name belongUser, |
| | | sd.dept_name belongDept, |
| | | ts.shop_source shopSource, |
| | | ts.sign_area_name signAreaName, |
| | | CONCAT(ts.cooperation_start_time,'-',ts.cooperation_end_time) cooperationTime, |
| | | CONCAT(ts.shop_area_name,ts.shop_address) shopAddress, |
| | | ts.shopowner_name shopownerName, |
| | | ts.shopowner_phone shopownerPhone, |
| | | ts.shop_status shopStatus, |
| | | tsm.shop_marketing_total shopActivityCount, |
| | | ts.shop_custom_status shopCustomStatus |
| | | FROM t_shop ts |
| | | LEFT JOIN sys_user sus ON sus.user_id = ts.sign_user_id |
| | | LEFT JOIN sys_user sub ON sub.user_id = ts.belong_user_id |
| | | LEFT JOIN sys_dept sd ON sub.dept_id = sd.dept_id |
| | | LEFT JOIN t_shop_marketing tsm ON tsm.shop_id = ts.shop_id |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.hrt.system.mapper.shop.ShopRelTagMapper"> |
| | | |
| | | <update id="deleteByShopId"> |
| | | UPDATE shop_rel_tag SET del_flag = 1 WHERE shop_id = #{shopId} |
| | | </update> |
| | | |
| | | |
| | | <select id="listShopTagVo" resultType="com.hrt.system.domain.vo.MgtShopTagVo"> |
| | | SELECT |
| | | srt.tag_id tagId, |
| | | st.tag_name tagName, |
| | | CASE WHEN srt.id IS NULL THEN 0 ELSE 1 END selectFlag |
| | | FROM sys_tag st |
| | | LEFT JOIN shop_rel_tag srt ON srt.tag_id = st.tag_id |
| | | WHERE srt.del_flag = 0 AND shop_id = #{shopId} |
| | | </select> |
| | | </mapper> |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.hrt.system.mapper.shop.ShopRelUserMapper"> |
| | | |
| | | |
| | | <update id="deleteByShopId"> |
| | | UPDATE shop_rel_user SET del_flag = 1 WHERE shop_id = #{shopId} |
| | | </update> |
| | | |
| | | </mapper> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.hrt.system.mapper.sys.SysConfigMapper"> |
| | | |
| | | <resultMap type="SysConfig" id="SysConfigResult"> |
| | | <resultMap type="com.hrt.system.domain.poji.sys.SysConfig" id="SysConfigResult"> |
| | | <id property="configId" column="config_id" /> |
| | | <result property="configName" column="config_name" /> |
| | | <result property="configKey" column="config_key" /> |
| | |
| | | </where> |
| | | </sql> |
| | | |
| | | <select id="selectConfig" parameterType="SysConfig" resultMap="SysConfigResult"> |
| | | <select id="selectConfig" parameterType="com.hrt.system.domain.poji.sys.SysConfig" resultMap="SysConfigResult"> |
| | | <include refid="selectConfigVo"/> |
| | | <include refid="sqlwhereSearch"/> |
| | | </select> |
| | | |
| | | <select id="selectConfigList" parameterType="SysConfig" resultMap="SysConfigResult"> |
| | | <select id="selectConfigList" parameterType="com.hrt.system.domain.poji.sys.SysConfig" resultMap="SysConfigResult"> |
| | | <include refid="selectConfigVo"/> |
| | | <where> |
| | | <if test="configName != null and configName != ''"> |
| | |
| | | where config_key = #{configKey} limit 1 |
| | | </select> |
| | | |
| | | <insert id="insertConfig" parameterType="SysConfig"> |
| | | <insert id="insertConfig" parameterType="com.hrt.system.domain.poji.sys.SysConfig"> |
| | | insert into sys_config ( |
| | | <if test="configName != null and configName != '' ">config_name,</if> |
| | | <if test="configKey != null and configKey != '' ">config_key,</if> |
| | |
| | | ) |
| | | </insert> |
| | | |
| | | <update id="updateConfig" parameterType="SysConfig"> |
| | | <update id="updateConfig" parameterType="com.hrt.system.domain.poji.sys.SysConfig"> |
| | | update sys_config |
| | | <set> |
| | | <if test="configName != null and configName != ''">config_name = #{configName},</if> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.hrt.system.mapper.sys.SysDictDataMapper"> |
| | | |
| | | <resultMap type="SysDictData" id="SysDictDataResult"> |
| | | <resultMap type="com.hrt.system.api.domain.SysDictData" id="SysDictDataResult"> |
| | | <id property="dictCode" column="dict_code" /> |
| | | <result property="dictSort" column="dict_sort" /> |
| | | <result property="dictLabel" column="dict_label" /> |
| | |
| | | from sys_dict_data |
| | | </sql> |
| | | |
| | | <select id="selectDictDataList" parameterType="SysDictData" resultMap="SysDictDataResult"> |
| | | <select id="selectDictDataList" parameterType="com.hrt.system.api.domain.SysDictData" resultMap="SysDictDataResult"> |
| | | <include refid="selectDictDataVo"/> |
| | | <where> |
| | | <if test="dictType != null and dictType != ''"> |
| | |
| | | order by dict_sort asc |
| | | </select> |
| | | |
| | | <select id="selectDictDataByType" parameterType="SysDictData" resultMap="SysDictDataResult"> |
| | | <select id="selectDictDataByType" parameterType="com.hrt.system.api.domain.SysDictData" resultMap="SysDictDataResult"> |
| | | <include refid="selectDictDataVo"/> |
| | | where status = '0' and dict_type = #{dictType} order by dict_sort asc |
| | | </select> |
| | |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <update id="updateDictData" parameterType="SysDictData"> |
| | | <update id="updateDictData" parameterType="com.hrt.system.api.domain.SysDictData"> |
| | | update sys_dict_data |
| | | <set> |
| | | <if test="dictSort != null">dict_sort = #{dictSort},</if> |
| | |
| | | update sys_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType} |
| | | </update> |
| | | |
| | | <insert id="insertDictData" parameterType="SysDictData"> |
| | | <insert id="insertDictData" parameterType="com.hrt.system.api.domain.SysDictData"> |
| | | insert into sys_dict_data( |
| | | <if test="dictSort != null">dict_sort,</if> |
| | | <if test="dictLabel != null and dictLabel != ''">dict_label,</if> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.hrt.system.mapper.sys.SysDictTypeMapper"> |
| | | |
| | | <resultMap type="SysDictType" id="SysDictTypeResult"> |
| | | <resultMap type="com.hrt.system.api.domain.SysDictType" id="SysDictTypeResult"> |
| | | <id property="dictId" column="dict_id" /> |
| | | <result property="dictName" column="dict_name" /> |
| | | <result property="dictType" column="dict_type" /> |
| | |
| | | from sys_dict_type |
| | | </sql> |
| | | |
| | | <select id="selectDictTypeList" parameterType="SysDictType" resultMap="SysDictTypeResult"> |
| | | <select id="selectDictTypeList" parameterType="com.hrt.system.api.domain.SysDictType" resultMap="SysDictTypeResult"> |
| | | <include refid="selectDictTypeVo"/> |
| | | <where> |
| | | <if test="dictName != null and dictName != ''"> |
| | |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <update id="updateDictType" parameterType="SysDictType"> |
| | | <update id="updateDictType" parameterType="com.hrt.system.api.domain.SysDictType"> |
| | | update sys_dict_type |
| | | <set> |
| | | <if test="dictName != null and dictName != ''">dict_name = #{dictName},</if> |
| | |
| | | where dict_id = #{dictId} |
| | | </update> |
| | | |
| | | <insert id="insertDictType" parameterType="SysDictType"> |
| | | <insert id="insertDictType" parameterType="com.hrt.system.api.domain.SysDictType"> |
| | | insert into sys_dict_type( |
| | | <if test="dictName != null and dictName != ''">dict_name,</if> |
| | | <if test="dictType != null and dictType != ''">dict_type,</if> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.hrt.system.mapper.sys.SysNoticeMapper"> |
| | | |
| | | <resultMap type="SysNotice" id="SysNoticeResult"> |
| | | <resultMap type="com.hrt.system.domain.poji.sys.SysNotice" id="SysNoticeResult"> |
| | | <result property="noticeId" column="notice_id" /> |
| | | <result property="noticeTitle" column="notice_title" /> |
| | | <result property="noticeType" column="notice_type" /> |
| | |
| | | where notice_id = #{noticeId} |
| | | </select> |
| | | |
| | | <select id="selectNoticeList" parameterType="SysNotice" resultMap="SysNoticeResult"> |
| | | <select id="selectNoticeList" parameterType="com.hrt.system.domain.poji.sys.SysNotice" resultMap="SysNoticeResult"> |
| | | <include refid="selectNoticeVo"/> |
| | | <where> |
| | | <if test="noticeTitle != null and noticeTitle != ''"> |
| | |
| | | </where> |
| | | </select> |
| | | |
| | | <insert id="insertNotice" parameterType="SysNotice"> |
| | | <insert id="insertNotice" parameterType="com.hrt.system.domain.poji.sys.SysNotice"> |
| | | insert into sys_notice ( |
| | | <if test="noticeTitle != null and noticeTitle != '' ">notice_title, </if> |
| | | <if test="noticeType != null and noticeType != '' ">notice_type, </if> |
| | |
| | | ) |
| | | </insert> |
| | | |
| | | <update id="updateNotice" parameterType="SysNotice"> |
| | | <update id="updateNotice" parameterType="com.hrt.system.domain.poji.sys.SysNotice"> |
| | | update sys_notice |
| | | <set> |
| | | <if test="noticeTitle != null and noticeTitle != ''">notice_title = #{noticeTitle}, </if> |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.hrt.system.mapper.sys.SysTagMapper"> |
| | | |
| | | <!-- 开启二级缓存 --> |
| | | <cache type="org.mybatis.caches.ehcache.LoggingEhcache"/> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.hrt.system.mapper.user.SysDeptMapper"> |
| | | |
| | | <resultMap type="SysDept" id="SysDeptResult"> |
| | | <resultMap type="com.hrt.system.api.domain.SysDept" id="SysDeptResult"> |
| | | <id property="deptId" column="dept_id" /> |
| | | <result property="parentId" column="parent_id" /> |
| | | <result property="ancestors" column="ancestors" /> |
| | |
| | | from sys_dept d |
| | | </sql> |
| | | |
| | | <select id="selectDeptList" parameterType="SysDept" resultMap="SysDeptResult"> |
| | | <select id="selectDeptList" parameterType="com.hrt.system.api.domain.SysDept" resultMap="SysDeptResult"> |
| | | <include refid="selectDeptVo"/> |
| | | where d.del_flag = '0' |
| | | <if test="deptId != null and deptId != 0"> |
| | |
| | | where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1 |
| | | </select> |
| | | |
| | | <insert id="insertDept" parameterType="SysDept"> |
| | | <insert id="insertDept" parameterType="com.hrt.system.api.domain.SysDept"> |
| | | insert into sys_dept( |
| | | <if test="deptId != null and deptId != 0">dept_id,</if> |
| | | <if test="parentId != null and parentId != 0">parent_id,</if> |
| | |
| | | ) |
| | | </insert> |
| | | |
| | | <update id="updateDept" parameterType="SysDept"> |
| | | <update id="updateDept" parameterType="com.hrt.system.api.domain.SysDept"> |
| | | update sys_dept |
| | | <set> |
| | | <if test="parentId != null and parentId != 0">parent_id = #{parentId},</if> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.hrt.system.mapper.user.SysLogininforMapper"> |
| | | |
| | | <resultMap type="SysLogininfor" id="SysLogininforResult"> |
| | | <resultMap type="com.hrt.system.api.domain.SysLogininfor" id="SysLogininforResult"> |
| | | <id property="infoId" column="info_id" /> |
| | | <result property="userName" column="user_name" /> |
| | | <result property="status" column="status" /> |
| | |
| | | <result property="accessTime" column="access_time" /> |
| | | </resultMap> |
| | | |
| | | <insert id="insertLogininfor" parameterType="SysLogininfor"> |
| | | <insert id="insertLogininfor" parameterType="com.hrt.system.api.domain.SysLogininfor"> |
| | | insert into sys_logininfor (user_name, status, ipaddr, msg, access_time) |
| | | values (#{userName}, #{status}, #{ipaddr}, #{msg}, sysdate()) |
| | | </insert> |
| | | |
| | | <select id="selectLogininforList" parameterType="SysLogininfor" resultMap="SysLogininforResult"> |
| | | <select id="selectLogininforList" parameterType="com.hrt.system.api.domain.SysLogininfor" resultMap="SysLogininforResult"> |
| | | select info_id, user_name, ipaddr, status, msg, access_time from sys_logininfor |
| | | <where> |
| | | <if test="ipaddr != null and ipaddr != ''"> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.hrt.system.mapper.user.SysMenuMapper"> |
| | | |
| | | <resultMap type="SysMenu" id="SysMenuResult"> |
| | | <resultMap type="com.hrt.system.domain.poji.user.SysMenu" id="SysMenuResult"> |
| | | <id property="menuId" column="menu_id" /> |
| | | <result property="menuName" column="menu_name" /> |
| | | <result property="parentName" column="parent_name" /> |
| | |
| | | from sys_menu |
| | | </sql> |
| | | |
| | | <select id="selectMenuList" parameterType="SysMenu" resultMap="SysMenuResult"> |
| | | <select id="selectMenuList" parameterType="com.hrt.system.domain.poji.user.SysMenu" resultMap="SysMenuResult"> |
| | | <include refid="selectMenuVo"/> |
| | | <where> |
| | | <if test="menuName != null and menuName != ''"> |
| | |
| | | order by m.parent_id, m.order_num |
| | | </select> |
| | | |
| | | <select id="selectMenuListByUserId" parameterType="SysMenu" resultMap="SysMenuResult"> |
| | | <select id="selectMenuListByUserId" parameterType="com.hrt.system.domain.poji.user.SysMenu" resultMap="SysMenuResult"> |
| | | select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time |
| | | from sys_menu m |
| | | left join sys_role_menu rm on m.menu_id = rm.menu_id |
| | |
| | | select count(1) from sys_menu where parent_id = #{menuId} |
| | | </select> |
| | | |
| | | <select id="checkMenuNameUnique" parameterType="SysMenu" resultMap="SysMenuResult"> |
| | | <select id="checkMenuNameUnique" parameterType="com.hrt.system.domain.poji.user.SysMenu" resultMap="SysMenuResult"> |
| | | <include refid="selectMenuVo"/> |
| | | where menu_name=#{menuName} and parent_id = #{parentId} limit 1 |
| | | </select> |
| | | |
| | | <update id="updateMenu" parameterType="SysMenu"> |
| | | <update id="updateMenu" parameterType="com.hrt.system.domain.poji.user.SysMenu"> |
| | | update sys_menu |
| | | <set> |
| | | <if test="menuName != null and menuName != ''">menu_name = #{menuName},</if> |
| | |
| | | where menu_id = #{menuId} |
| | | </update> |
| | | |
| | | <insert id="insertMenu" parameterType="SysMenu"> |
| | | <insert id="insertMenu" parameterType="com.hrt.system.domain.poji.user.SysMenu"> |
| | | insert into sys_menu( |
| | | <if test="menuId != null and menuId != 0">menu_id,</if> |
| | | <if test="parentId != null and parentId != 0">parent_id,</if> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.hrt.system.mapper.user.SysOperLogMapper"> |
| | | |
| | | <resultMap type="SysOperLog" id="SysOperLogResult"> |
| | | <resultMap type="com.hrt.system.api.domain.SysOperLog" id="SysOperLogResult"> |
| | | <id property="operId" column="oper_id" /> |
| | | <result property="title" column="title" /> |
| | | <result property="businessType" column="business_type" /> |
| | |
| | | from sys_oper_log |
| | | </sql> |
| | | |
| | | <insert id="insertOperlog" parameterType="SysOperLog"> |
| | | <insert id="insertOperlog" parameterType="com.hrt.system.api.domain.SysOperLog"> |
| | | insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_param, json_result, status, error_msg, cost_time, oper_time) |
| | | values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, #{costTime}, sysdate()) |
| | | </insert> |
| | | |
| | | <select id="selectOperLogList" parameterType="SysOperLog" resultMap="SysOperLogResult"> |
| | | <select id="selectOperLogList" parameterType="com.hrt.system.api.domain.SysOperLog" resultMap="SysOperLogResult"> |
| | | <include refid="selectOperLogVo"/> |
| | | <where> |
| | | <if test="title != null and title != ''"> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.hrt.system.mapper.user.SysPostMapper"> |
| | | |
| | | <resultMap type="SysPost" id="SysPostResult"> |
| | | <resultMap type="com.hrt.system.domain.poji.user.SysPost" id="SysPostResult"> |
| | | <id property="postId" column="post_id" /> |
| | | <result property="postCode" column="post_code" /> |
| | | <result property="postName" column="post_name" /> |
| | |
| | | from sys_post |
| | | </sql> |
| | | |
| | | <select id="selectPostList" parameterType="SysPost" resultMap="SysPostResult"> |
| | | <select id="selectPostList" parameterType="com.hrt.system.domain.poji.user.SysPost" resultMap="SysPostResult"> |
| | | <include refid="selectPostVo"/> |
| | | <where> |
| | | <if test="postCode != null and postCode != ''"> |
| | |
| | | where post_code=#{postCode} limit 1 |
| | | </select> |
| | | |
| | | <update id="updatePost" parameterType="SysPost"> |
| | | <update id="updatePost" parameterType="com.hrt.system.domain.poji.user.SysPost"> |
| | | update sys_post |
| | | <set> |
| | | <if test="postCode != null and postCode != ''">post_code = #{postCode},</if> |
| | |
| | | where post_id = #{postId} |
| | | </update> |
| | | |
| | | <insert id="insertPost" parameterType="SysPost" useGeneratedKeys="true" keyProperty="postId"> |
| | | <insert id="insertPost" parameterType="com.hrt.system.domain.poji.user.SysPost" useGeneratedKeys="true" keyProperty="postId"> |
| | | insert into sys_post( |
| | | <if test="postId != null and postId != 0">post_id,</if> |
| | | <if test="postCode != null and postCode != ''">post_code,</if> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.hrt.system.mapper.user.SysRoleDeptMapper"> |
| | | |
| | | <resultMap type="SysRoleDept" id="SysRoleDeptResult"> |
| | | <resultMap type="com.hrt.system.domain.poji.user.SysRoleDept" id="SysRoleDeptResult"> |
| | | <result property="roleId" column="role_id" /> |
| | | <result property="deptId" column="dept_id" /> |
| | | </resultMap> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.hrt.system.mapper.user.SysRoleMapper"> |
| | | |
| | | <resultMap type="SysRole" id="SysRoleResult"> |
| | | <resultMap type="com.hrt.system.api.domain.SysRole" id="SysRoleResult"> |
| | | <id property="roleId" column="role_id" /> |
| | | <result property="roleName" column="role_name" /> |
| | | <result property="roleKey" column="role_key" /> |
| | |
| | | left join sys_dept d on u.dept_id = d.dept_id |
| | | </sql> |
| | | |
| | | <select id="selectRoleList" parameterType="SysRole" resultMap="SysRoleResult"> |
| | | <select id="selectRoleList" parameterType="com.hrt.system.api.domain.SysRole" resultMap="SysRoleResult"> |
| | | <include refid="selectRoleVo"/> |
| | | where r.del_flag = '0' |
| | | <if test="roleId != null and roleId != 0"> |
| | |
| | | where r.role_key=#{roleKey} and r.del_flag = '0' limit 1 |
| | | </select> |
| | | |
| | | <insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId"> |
| | | <insert id="insertRole" parameterType="com.hrt.system.api.domain.SysRole" useGeneratedKeys="true" keyProperty="roleId"> |
| | | insert into sys_role( |
| | | <if test="roleId != null and roleId != 0">role_id,</if> |
| | | <if test="roleName != null and roleName != ''">role_name,</if> |
| | |
| | | ) |
| | | </insert> |
| | | |
| | | <update id="updateRole" parameterType="SysRole"> |
| | | <update id="updateRole" parameterType="com.hrt.system.api.domain.SysRole"> |
| | | update sys_role |
| | | <set> |
| | | <if test="roleName != null and roleName != ''">role_name = #{roleName},</if> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.hrt.system.mapper.user.SysRoleMenuMapper"> |
| | | |
| | | <resultMap type="SysRoleMenu" id="SysRoleMenuResult"> |
| | | <resultMap type="com.hrt.system.domain.poji.user.SysRoleMenu" id="SysRoleMenuResult"> |
| | | <result property="roleId" column="role_id" /> |
| | | <result property="menuId" column="menu_id" /> |
| | | </resultMap> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.hrt.system.mapper.user.SysUserMapper"> |
| | | |
| | | <resultMap type="SysUser" id="SysUserResult"> |
| | | <resultMap type="com.hrt.system.api.domain.SysUser" id="SysUserResult"> |
| | | <id property="userId" column="user_id" /> |
| | | <result property="deptId" column="dept_id" /> |
| | | <result property="userName" column="user_name" /> |
| | |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="remark" column="remark" /> |
| | | <association property="dept" column="dept_id" javaType="SysDept" resultMap="deptResult" /> |
| | | <association property="dept" column="dept_id" javaType="com.hrt.system.api.domain.SysDept" resultMap="deptResult" /> |
| | | <collection property="roles" javaType="java.util.List" resultMap="RoleResult" /> |
| | | </resultMap> |
| | | |
| | | <resultMap id="deptResult" type="SysDept"> |
| | | <resultMap id="deptResult" type="com.hrt.system.api.domain.SysDept"> |
| | | <id property="deptId" column="dept_id" /> |
| | | <result property="parentId" column="parent_id" /> |
| | | <result property="deptName" column="dept_name" /> |
| | |
| | | <result property="status" column="dept_status" /> |
| | | </resultMap> |
| | | |
| | | <resultMap id="RoleResult" type="SysRole"> |
| | | <resultMap id="RoleResult" type="com.hrt.system.api.domain.SysRole"> |
| | | <id property="roleId" column="role_id" /> |
| | | <result property="roleName" column="role_name" /> |
| | | <result property="roleKey" column="role_key" /> |
| | |
| | | left join sys_role r on r.role_id = ur.role_id |
| | | </sql> |
| | | |
| | | <select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult"> |
| | | <select id="selectUserList" parameterType="com.hrt.system.api.domain.SysUser" resultMap="SysUserResult"> |
| | | select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u |
| | | left join sys_dept d on u.dept_id = d.dept_id |
| | | where u.del_flag = '0' |
| | |
| | | ${params.dataScope} |
| | | </select> |
| | | |
| | | <select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult"> |
| | | <select id="selectAllocatedList" parameterType="com.hrt.system.api.domain.SysUser" resultMap="SysUserResult"> |
| | | select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time |
| | | from sys_user u |
| | | left join sys_dept d on u.dept_id = d.dept_id |
| | |
| | | ${params.dataScope} |
| | | </select> |
| | | |
| | | <select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult"> |
| | | <select id="selectUnallocatedList" parameterType="com.hrt.system.api.domain.SysUser" resultMap="SysUserResult"> |
| | | select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time |
| | | from sys_user u |
| | | left join sys_dept d on u.dept_id = d.dept_id |
| | |
| | | select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1 |
| | | </select> |
| | | |
| | | <insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId"> |
| | | <insert id="insertUser" parameterType="com.hrt.system.api.domain.SysUser" useGeneratedKeys="true" keyProperty="userId"> |
| | | insert into sys_user( |
| | | <if test="userId != null and userId != 0">user_id,</if> |
| | | <if test="deptId != null and deptId != 0">dept_id,</if> |
| | |
| | | ) |
| | | </insert> |
| | | |
| | | <update id="updateUser" parameterType="SysUser"> |
| | | <update id="updateUser" parameterType="com.hrt.system.api.domain.SysUser"> |
| | | update sys_user |
| | | <set> |
| | | <if test="deptId != null and deptId != 0">dept_id = #{deptId},</if> |
| | |
| | | where user_id = #{userId} |
| | | </update> |
| | | |
| | | <update id="updateUserStatus" parameterType="SysUser"> |
| | | <update id="updateUserStatus" parameterType="com.hrt.system.api.domain.SysUser"> |
| | | update sys_user set status = #{status} where user_id = #{userId} |
| | | </update> |
| | | |
| | | <update id="updateUserAvatar" parameterType="SysUser"> |
| | | <update id="updateUserAvatar" parameterType="com.hrt.system.api.domain.SysUser"> |
| | | update sys_user set avatar = #{avatar} where user_name = #{userName} |
| | | </update> |
| | | |
| | | <update id="resetUserPwd" parameterType="SysUser"> |
| | | <update id="resetUserPwd" parameterType="com.hrt.system.api.domain.SysUser"> |
| | | update sys_user set password = #{password} where user_name = #{userName} |
| | | </update> |
| | | |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.hrt.system.mapper.user.SysUserPostMapper"> |
| | | |
| | | <resultMap type="SysUserPost" id="SysUserPostResult"> |
| | | <resultMap type="com.hrt.system.domain.poji.user.SysUserPost" id="SysUserPostResult"> |
| | | <result property="userId" column="user_id" /> |
| | | <result property="postId" column="post_id" /> |
| | | </resultMap> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.hrt.system.mapper.user.SysUserRoleMapper"> |
| | | |
| | | <resultMap type="SysUserRole" id="SysUserRoleResult"> |
| | | <resultMap type="com.hrt.system.domain.poji.user.SysUserRole" id="SysUserRoleResult"> |
| | | <result property="userId" column="user_id" /> |
| | | <result property="roleId" column="role_id" /> |
| | | </resultMap> |
| | |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <delete id="deleteUserRoleInfo" parameterType="SysUserRole"> |
| | | <delete id="deleteUserRoleInfo" parameterType="com.hrt.system.domain.poji.user.SysUserRole"> |
| | | delete from sys_user_role where user_id=#{userId} and role_id=#{roleId} |
| | | </delete> |
| | | |