| | |
| | | |
| | | String GOODS_DELETED = "商品已被删除"; |
| | | |
| | | String CLASS_DOUBLE = "分类名不能重复"; |
| | | |
| | | String GOODS_DOUBLE = "商品名不能重复"; |
| | | |
| | | String SHOP_DOUBLE = "商户名不能重复"; |
| | | |
| | | String TAG_DOUBLE = "标签名不能重复"; |
| | | } |
| | |
| | | package com.ruoyi.system.api.domain.poji.config; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import java.util.Date; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.activerecord.Model; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @TableField("del_flag") |
| | | private Integer delFlag; |
| | | /** |
| | | * 标签类型1.用户 2.合作商 3.建议 |
| | | * 标签类型1用户2合作商3商品4建议 |
| | | */ |
| | | @TableField("tag_type") |
| | | private Integer tagType; |
| | |
| | | package com.ruoyi.system.api.domain.poji.sys; |
| | | |
| | | import java.util.Date; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.core.annotation.Excel; |
| | | import com.ruoyi.common.core.annotation.Excel.ColumnType; |
| | | import com.ruoyi.common.core.web.domain.BaseEntity; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 操作日志记录表 oper_log |
| | |
| | | /** 消耗时间 */ |
| | | @Excel(name = "消耗时间", suffix = "毫秒") |
| | | private Long costTime; |
| | | |
| | | @Excel(name = "操作内容") |
| | | private String operContent; |
| | | |
| | | public Long getOperId() |
| | | { |
| | |
| | | { |
| | | this.costTime = costTime; |
| | | } |
| | | |
| | | public String getOperContent() { |
| | | return operContent; |
| | | } |
| | | |
| | | public void setOperContent(String operContent) { |
| | | this.operContent = operContent; |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.system.api.domain.poji.goods.GoodsFile; |
| | | import com.ruoyi.system.api.domain.poji.goods.ShopGoods; |
| | | import com.ruoyi.system.api.service.RemoteGoodsService; |
| | | import com.ruoyi.system.api.service.RemoteMemberService; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | |
| | | public R<ShopGoods> getShopGoods(AppShopGoodsGetDto appShopGoodsGetDto) { |
| | | return R.fail("获取商户商品失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R deleteGoodsClass(Long classId) { |
| | | return R.fail("删除商品分类失败:" + throwable.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | public R createNewMember(Member member) { |
| | | return R.fail("订单创建用户失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R deleteMemberTag(String tag) { |
| | | return R.fail("删除用户标签失败:" + throwable.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | public R<QwH5LoginVo> qwH5Login(QwUserDetailDto qwUserDetail) { |
| | | return R.fail("获取商户员工失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R deleteMemberTag(String tag) { |
| | | return R.fail("删除商户标签失败:" + throwable.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | |
| | | @PostMapping("/goods/getShopGoods") |
| | | public R<ShopGoods> getShopGoods(@RequestBody AppShopGoodsGetDto appShopGoodsGetDto); |
| | | |
| | | @PostMapping("/goods/deleteGoodsClass") |
| | | public R deleteGoodsClass(@RequestBody Long classId); |
| | | } |
| | |
| | | */ |
| | | @PostMapping("/member/createNewMember") |
| | | public R createNewMember(@RequestBody Member member); |
| | | |
| | | /** |
| | | * @description 删除用户标签 |
| | | * @author jqs |
| | | * @date 2023/6/8 15:17 |
| | | * @param tag |
| | | * @return R |
| | | */ |
| | | @PostMapping("/member/deleteMemberTag") |
| | | public R deleteMemberTag(@RequestBody String tag); |
| | | |
| | | } |
| | |
| | | |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.system.api.domain.poji.activity.ActivityGoods; |
| | | import com.ruoyi.system.api.domain.poji.shop.Shop; |
| | | import com.ruoyi.system.api.domain.vo.ShopRelUserVo; |
| | | import com.ruoyi.system.api.factory.RemoteShopFallbackFactory; |
| | | import com.ruoyi.system.api.factory.RemoteUserFallbackFactory; |
| | | import com.ruoyi.system.api.model.QwH5LoginVo; |
| | | import com.ruoyi.system.api.model.QwUserDetailDto; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | |
| | | */ |
| | | @PostMapping("/shop/qwH5Login") |
| | | public R<QwH5LoginVo> qwH5Login(@RequestBody QwUserDetailDto qwUserDetail); |
| | | |
| | | /** |
| | | * @description 删除商户标签 |
| | | * @author jqs |
| | | * @date 2023/6/8 15:52 |
| | | * @param tag |
| | | * @return R |
| | | */ |
| | | @PostMapping("/shop/deleteShopTag") |
| | | public R deleteMemberTag(@RequestBody String tag); |
| | | } |
| | |
| | | ShopGoods shopGoods = shopGoodsService.getByShopIdAndGoodsId(appShopGoodsGetDto.getShopId(),appShopGoodsGetDto.getGoodsId()); |
| | | return R.ok(shopGoods); |
| | | } |
| | | |
| | | @PostMapping("/deleteGoodsClass") |
| | | public R deleteGoodsClass(@RequestBody Long classId) |
| | | { |
| | | goodsService.deleteGoodsClass(classId); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/deleteGoodsTag") |
| | | public R deleteGoodsTag(@RequestBody String goodsTag) |
| | | { |
| | | //goodsService.deleteGoodsTag(goodsTag); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | goodsService.deleteMgtGoods(mgtBaseGetDto.getId(),userId); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * |
| | | * 获取平台商品统计 |
| | | * @return |
| | | */ |
| | | MgtGoodsTotalVo getMgtGoodsTotal(); |
| | | |
| | | /** |
| | | * @description 删除商品分类 |
| | | * @author jqs |
| | | * @date 2023/6/8 10:31 |
| | | * @param classId |
| | | * @return void |
| | | */ |
| | | void deleteGoodsClass(@Param("classId")Long classId); |
| | | } |
| | |
| | | * @return void |
| | | */ |
| | | void deleteMgtGoods(String goodsId,Long userId); |
| | | |
| | | /** |
| | | * @description 删除商品分类 |
| | | * @author jqs |
| | | * @date 2023/6/8 10:31 |
| | | * @param classId |
| | | * @return void |
| | | */ |
| | | void deleteGoodsClass(Long classId); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | ShopGoods getByShopIdAndGoodsId(Long shopId,String goodsId); |
| | | |
| | | } |
| | |
| | | package com.ruoyi.goods.service.impl.goods; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | |
| | | Goods goods; |
| | | Boolean newGoods = false; |
| | | String goodsId = mgtGoodsEditDto.getGoodsId(); |
| | | Goods goodsSame = this.getOne(new LambdaQueryWrapper<Goods>().eq(Goods::getDelFlag,0).eq(Goods::getGoodsName,mgtGoodsEditDto.getGoodsName())); |
| | | // 判断是否有商品ID 没有则新建 |
| | | if (goodsId != null) { |
| | | if(goodsSame!=null&&!Objects.equals(goodsSame.getGoodsId(), goodsId)){ |
| | | throw new ServiceException(AppErrorConstant.GOODS_DOUBLE); |
| | | } |
| | | goods = this.getById(goodsId); |
| | | if(goods.getGoodsStatus()==-1){ |
| | | throw new ServiceException(AppErrorConstant.GOODS_DELETED); |
| | | } |
| | | } else { |
| | | if(goodsSame!=null){ |
| | | throw new ServiceException(AppErrorConstant.GOODS_DOUBLE); |
| | | } |
| | | goods = new Goods(); |
| | | goodsId = IdUtils.simpleUUID(); |
| | | goods.setGoodsId(goodsId); |
| | |
| | | this.saveOrUpdate(goods); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * @description 删除商品分类 |
| | | * @author jqs |
| | | * @date 2023/6/8 10:31 |
| | | * @param classId |
| | | * @return void |
| | | */ |
| | | @Override |
| | | public void deleteGoodsClass(Long classId){ |
| | | goodsMapper.deleteGoodsClass(classId); |
| | | } |
| | | } |
| | |
| | | IFNULL(tgt.buy_money_total,0) buyMoneyTotal |
| | | FROM t_goods_total tgt |
| | | </select> |
| | | |
| | | <update id="deleteGoodsClass"> |
| | | UPDATE t_goods set goods_class_id = null WHERE goods_class_id = #{classId} |
| | | </update> |
| | | </mapper> |
| | |
| | | memberService.createNewMember(member); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * @description 删除用户标签 |
| | | * @author jqs |
| | | * @date 2023/6/8 15:17 |
| | | * @param tag |
| | | * @return R |
| | | */ |
| | | @PostMapping("/deleteMemberTag") |
| | | public R deleteMemberTag(@RequestBody String tag) |
| | | { |
| | | memberService.deleteMemberTag(tag); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | */ |
| | | List<MgtMemberPageVo> pageMgtMember(Page page, @Param("param") MgtMemberPageDto merMemberPageDto); |
| | | |
| | | |
| | | /** |
| | | * @description 删除标签 |
| | | * @author jqs |
| | | * @date 2023/6/8 15:18 |
| | | * @param memberTag |
| | | * @return void |
| | | */ |
| | | void deleteMemberTag(@Param("memberTag")String memberTag); |
| | | } |
| | | |
| | | |
| | |
| | | package com.ruoyi.member.service.impl.member; |
| | | import java.util.Date; |
| | | |
| | | import cn.binarywang.wx.miniapp.api.WxMaService; |
| | | import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult; |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.utils.DateUtils; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.utils.bean.BeanUtils; |
| | | import com.ruoyi.common.core.utils.uuid.IdUtils; |
| | | import com.ruoyi.common.redis.service.RedisService; |
| | | import com.ruoyi.common.security.utils.CodeFactoryUtil; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.member.domain.dto.*; |
| | | import com.ruoyi.member.domain.pojo.member.IntegralRecord; |
| | |
| | | import com.ruoyi.member.mapper.member.MemberMapper; |
| | | import com.ruoyi.member.service.member.*; |
| | | import com.ruoyi.member.util.HttpUtils; |
| | | import com.ruoyi.system.api.domain.dto.AppMiniRegisterDto; |
| | | import com.ruoyi.system.api.domain.poji.config.Activeness; |
| | | import com.ruoyi.system.api.domain.vo.AppMiniRegisterVo; |
| | | import com.ruoyi.system.api.service.RemoteConfigService; |
| | | import com.ruoyi.system.api.service.RemoteOrderService; |
| | | import com.ruoyi.system.api.service.RemoteShopService; |
| | | import com.ruoyi.system.api.service.RemoteUserService; |
| | | import com.ruoyi.system.api.constant.AppErrorConstant; |
| | | import com.ruoyi.system.api.constant.SecurityConstant; |
| | | import com.ruoyi.system.api.domain.dto.AppEditUserDto; |
| | | import com.ruoyi.system.api.domain.dto.AppMemberBindingDto; |
| | | import com.ruoyi.system.api.domain.dto.AppMemberGoodsTypeDto; |
| | | import com.ruoyi.system.api.domain.dto.AppMiniRegisterDto; |
| | | import com.ruoyi.system.api.domain.poji.config.Activeness; |
| | | import com.ruoyi.system.api.domain.poji.config.SysTag; |
| | | import com.ruoyi.system.api.domain.poji.member.Member; |
| | | import com.ruoyi.system.api.domain.poji.shop.Shop; |
| | | import com.ruoyi.system.api.domain.poji.sys.SysUser; |
| | | import com.ruoyi.system.api.domain.vo.AppMiniRegisterVo; |
| | | import com.ruoyi.system.api.domain.vo.AppOrderTotalVo; |
| | | import com.ruoyi.system.api.model.AppMiniLoginDto; |
| | | import com.ruoyi.system.api.model.AppMiniLoginVo; |
| | | import com.ruoyi.system.api.service.RemoteConfigService; |
| | | import com.ruoyi.system.api.service.RemoteOrderService; |
| | | import com.ruoyi.system.api.service.RemoteShopService; |
| | | import com.ruoyi.system.api.service.RemoteUserService; |
| | | import lombok.extern.log4j.Log4j2; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | | import org.apache.http.HttpResponse; |
| | | import org.apache.http.util.EntityUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import com.ruoyi.common.security.utils.CodeFactoryUtil; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | |
| | | mgtMemberGetVo.setMemberTags(member.getUserTags()); |
| | | return mgtMemberGetVo; |
| | | } |
| | | |
| | | /** |
| | | * @description 删除标签 |
| | | * @author jqs |
| | | * @date 2023/6/8 15:18 |
| | | * @param memberTag |
| | | * @return void |
| | | */ |
| | | @Override |
| | | public void deleteMemberTag(String memberTag){ |
| | | memberMapper.deleteMemberTag(memberTag); |
| | | } |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | MgtMemberGetVo getMgtMemberInfo(Long userId); |
| | | |
| | | /** |
| | | * @description 删除标签 |
| | | * @author jqs |
| | | * @date 2023/6/8 15:18 |
| | | * @param memberTag |
| | | * @return void |
| | | */ |
| | | void deleteMemberTag(String memberTag); |
| | | } |
| | |
| | | AND tm.gender = #{param.memberGender} |
| | | </if> |
| | | <if test="param.memberTag != null and param.memberTag != ''"> |
| | | AND FIND_IN_SET(tm.user_tags, #{param.memberTag}) > 0 |
| | | AND FIND_IN_SET(#{param.memberTag},tm.user_tags) > 0 |
| | | </if> |
| | | <if test="param.startMemberDate!=null and param.startMemberDate!=''"> |
| | | AND tm.create_time >= #{param.startMemberDate} |
| | |
| | | INNER JOIN t_member_total tmt ON tm.member_id = tmt.member_id |
| | | WHERE del_flag = 0 |
| | | <if test="param.keyword != null and param.keyword != ''"> |
| | | AND (tm.member_no LIKE CONCAT('%',#{param.keyword},'%') OR tm.mobile LIKE CONCAT('%',#{param.keyword},'%') OR tm.real_name LIKE CONCAT('%',#{param.keyword},'%') OR tm.nick_name LIKE CONCAT('%',#{param.keyword},'%') OR FIND_IN_SET(tm.member_nurse,#{param.keyword}) > 0) |
| | | AND (tm.member_no LIKE CONCAT('%',#{param.keyword},'%') OR tm.mobile LIKE CONCAT('%',#{param.keyword},'%') OR tm.real_name LIKE CONCAT('%',#{param.keyword},'%') OR tm.nick_name LIKE CONCAT('%',#{param.keyword},'%') OR FIND_IN_SET(#{param.keyword},tm.member_nurse) > 0) |
| | | </if> |
| | | <if test="param.belongDistrict != null and param.belongDistrict != ''"> |
| | | AND tm.belong_district = #{param.belongDistrict} |
| | |
| | | AND tmt.binding_flag = #{param.memberFlag} |
| | | </if> |
| | | <if test="param.goodsType != null and param.goodsType != ''"> |
| | | AND FIND_IN_SET(tm.goods_type,#{param.goodsType}) > 0 |
| | | AND FIND_IN_SET(#{param.goodsType},tm.goods_type) > 0 |
| | | </if> |
| | | <if test="param.relationShopId != null and param.relationShopId != ''"> |
| | | AND tm.relation_shop_id = #{param.relationShopId} |
| | |
| | | AND tmt.total_pay_count <= #{param.endPayCount} |
| | | </if> |
| | | <if test="param.memberTag != null and param.memberTag != ''"> |
| | | AND FIND_IN_SET( tm.user_tags,#{param.memberTag}) > 0 |
| | | AND FIND_IN_SET(#{param.memberTag},tm.user_tags) > 0 |
| | | </if> |
| | | ORDER BY tm.create_time DESC |
| | | </select> |
| | | |
| | | |
| | | <update id="deleteMemberTag"> |
| | | UPDATE t_member SET user_tags = TRIM(BOTH ',' FROM REPLACE(CONCAT(',', user_tags, ','), CONCAT(',',#{memberTag},','), ',')) |
| | | WHERE FIND_IN_SET(#{memberTag}, user_tags) > 0 |
| | | </update> |
| | | </mapper> |
| | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.security.annotation.InnerAuth; |
| | | import com.ruoyi.shop.domain.pojo.shop.ShopRelUser; |
| | | import com.ruoyi.shop.domain.pojo.shop.ShopStaff; |
| | | import com.ruoyi.shop.service.shop.ShopRelUserService; |
| | | import com.ruoyi.shop.service.shop.ShopService; |
| | | import com.ruoyi.shop.service.shop.ShopStaffService; |
| | | import com.ruoyi.system.api.domain.poji.activity.ActivityGoods; |
| | | import com.ruoyi.system.api.domain.poji.shop.Shop; |
| | | import com.ruoyi.system.api.domain.poji.sys.SysUser; |
| | | import com.ruoyi.system.api.domain.vo.ShopRelUserVo; |
| | | import com.ruoyi.system.api.model.QwH5LoginVo; |
| | | import com.ruoyi.system.api.model.QwUserDetailDto; |
| | | import com.ruoyi.system.api.service.RemoteUserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Optional; |
| | |
| | | return R.ok(shopRelUserVo); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * @description 删除商户标签 |
| | | * @author jqs |
| | | * @date 2023/6/8 15:52 |
| | | * @param tag |
| | | * @return R |
| | | */ |
| | | @PostMapping("/deleteShopTag") |
| | | public R deleteShopTag(@RequestBody String tag) |
| | | { |
| | | shopService.deleteShopTag(tag); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.shop.domain.dto.MgtChangeCoopDto; |
| | | import com.ruoyi.shop.domain.dto.MgtEditShopDto; |
| | | import com.ruoyi.shop.domain.dto.MgtEditShopTagDto; |
| | | import com.ruoyi.shop.domain.dto.MgtShopPageDto; |
| | | import com.ruoyi.shop.domain.dto.*; |
| | | import com.ruoyi.shop.domain.vo.MgtShopInfoVo; |
| | | import com.ruoyi.shop.domain.vo.MgtShopPageVo; |
| | | import com.ruoyi.shop.domain.vo.MgtShopProportionPageVo; |
| | | import com.ruoyi.shop.domain.vo.MgtShopTagVo; |
| | | import com.ruoyi.shop.service.shop.ShopProportionService; |
| | | import com.ruoyi.shop.service.shop.ShopRelTagService; |
| | | import com.ruoyi.shop.service.shop.ShopService; |
| | | import com.ruoyi.system.api.domain.dto.MgtBaseGetDto; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | 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 org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | |
| | | |
| | | @Resource |
| | | private ShopRelTagService shopRelTagService; |
| | | |
| | | @Resource |
| | | private ShopProportionService shopProportionService; |
| | | |
| | | @RequestMapping(value = "/pageMgtShop", method = RequestMethod.POST) |
| | | @ApiOperation(value = "分页获取商户列表") |
| | |
| | | |
| | | @RequestMapping(value = "/pageMgtShopProportion", method = RequestMethod.POST) |
| | | @ApiOperation(value = "分页获取商户分成列表") |
| | | public R<Page<MgtShopPageVo>> pageMgtShopProportion(@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)); |
| | | public R<Page<MgtShopProportionPageVo>> pageMgtShopProportion(@RequestBody MgtShopProportionPageDto mgtShopProportionPageDto) { |
| | | Page<MgtShopProportionPageVo> page = new Page<>(); |
| | | page.setSize(mgtShopProportionPageDto.getPageSize()); |
| | | page.setCurrent(mgtShopProportionPageDto.getPageNum()); |
| | | List<MgtShopProportionPageVo> mgtShopProportionPageVoList = shopService.pageMgtShopProportion(page,mgtShopProportionPageDto); |
| | | return R.ok(page.setRecords(mgtShopProportionPageVoList)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/editMgtShopProportion", method = RequestMethod.POST) |
| | | @ApiOperation(value = "修改商户分成") |
| | | public R editMgtShopProportion(@RequestBody MgtShopProportionEditDto mgtShopProportionEditDto) { |
| | | mgtShopProportionEditDto.setUserId(SecurityUtils.getUserId()); |
| | | shopProportionService.editMgtShopProportion(mgtShopProportionEditDto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.shop.domain.dto; |
| | | |
| | | import com.ruoyi.system.api.domain.dto.MgtBaseDto; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @ClassName MgtShopProportionEditDto |
| | | * @Description TODO |
| | | * @Author jqs |
| | | * @Date 2023/6/8 9:50 |
| | | * @Version 1.0 |
| | | */ |
| | | @Data |
| | | public class MgtShopProportionEditDto extends MgtBaseDto { |
| | | |
| | | @ApiModelProperty("分成id") |
| | | private Long proportionId; |
| | | |
| | | @ApiModelProperty(value = "分成比例") |
| | | private BigDecimal proportionPercent; |
| | | } |
| | |
| | | package com.ruoyi.shop.domain.dto; |
| | | |
| | | import com.ruoyi.system.api.domain.dto.MgtPageDto; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | |
| | | @Data |
| | | public class MgtShopProportionPageDto extends MgtPageDto { |
| | | |
| | | |
| | | @ApiModelProperty(value = "商户类型1经销商2代理商") |
| | | private Integer shopType ; |
| | | |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.shop.domain.dto.AppNearbyShopDto; |
| | | import com.ruoyi.shop.domain.dto.MerAgencyPageDto; |
| | | import com.ruoyi.shop.domain.dto.MgtShopProportionPageDto; |
| | | import com.ruoyi.shop.domain.vo.AppNearShopVo; |
| | | import com.ruoyi.shop.domain.vo.MerAgencyPageVo; |
| | | import com.ruoyi.shop.domain.vo.MgtShopProportionPageVo; |
| | | import com.ruoyi.system.api.domain.poji.shop.Shop; |
| | | import com.ruoyi.shop.domain.dto.MgtShopPageDto; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | |
| | | * @return |
| | | */ |
| | | AppNearShopVo getNearbyShop(@Param("param")AppNearbyShopDto appNearbyShopDto); |
| | | |
| | | /** |
| | | * @description 平台获取商户分成列表 |
| | | * @author jqs |
| | | * @date 2023/6/8 9:25 |
| | | * @param page |
| | | * @param mgtShopProportionPageDto |
| | | * @return List<MgtShopProportionPageVo> |
| | | */ |
| | | List<MgtShopProportionPageVo> pageMgtShopProportion(Page page, @Param("param")MgtShopProportionPageDto mgtShopProportionPageDto); |
| | | |
| | | /** |
| | | * @description 删除商户标签 |
| | | * @author jqs |
| | | * @date 2023/6/8 15:53 |
| | | * @param shopTag |
| | | * @return void |
| | | */ |
| | | void deleteShopTag(String shopTag); |
| | | } |
| | |
| | | package com.ruoyi.shop.service.impl.shop; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.shop.domain.dto.MgtShopProportionEditDto; |
| | | import com.ruoyi.shop.domain.pojo.shop.ShopProportion; |
| | | import com.ruoyi.shop.mapper.shop.ShopProportionMapper; |
| | | import com.ruoyi.shop.service.shop.ShopProportionService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class ShopProportionServiceImpl extends ServiceImpl<ShopProportionMapper, ShopProportion> implements ShopProportionService { |
| | | |
| | | |
| | | /** |
| | | * @description 修改商户分成 |
| | | * @author jqs |
| | | * @date 2023/6/8 9:52 |
| | | * @param mgtShopProportionEditDto |
| | | * @return void |
| | | */ |
| | | @Override |
| | | public void editMgtShopProportion(MgtShopProportionEditDto mgtShopProportionEditDto){ |
| | | //删除旧分成 |
| | | ShopProportion shopProportionOld = this.getById(mgtShopProportionEditDto.getProportionId()); |
| | | shopProportionOld.setDelFlag(1); |
| | | shopProportionOld.setUpdateUserId(mgtShopProportionEditDto.getUserId()); |
| | | shopProportionOld.setUpdateTime(new Date()); |
| | | this.saveOrUpdate(shopProportionOld); |
| | | //创建新分成 |
| | | ShopProportion shopProportionNew = new ShopProportion(); |
| | | shopProportionNew.setDelFlag(0); |
| | | shopProportionNew.setShopId(shopProportionOld.getShopId()); |
| | | shopProportionNew.setShopType(shopProportionOld.getShopType()); |
| | | shopProportionNew.setProportionPercent(mgtShopProportionEditDto.getProportionPercent()); |
| | | shopProportionNew.setUpdateTime(new Date()); |
| | | shopProportionNew.setUpdateUserId(mgtShopProportionEditDto.getUserId()); |
| | | this.saveOrUpdate(shopProportionNew); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.utils.uuid.IdUtils; |
| | | import com.ruoyi.common.security.utils.CodeFactoryUtil; |
| | |
| | | import com.ruoyi.shop.mapper.shop.ShopMapper; |
| | | import com.ruoyi.shop.service.shop.*; |
| | | import com.ruoyi.shop.service.task.ShopFileService; |
| | | import com.ruoyi.system.api.constant.AppErrorConstant; |
| | | import com.ruoyi.system.api.domain.dto.AppMemberBindingDto; |
| | | import com.ruoyi.system.api.domain.poji.config.SysTag; |
| | | import com.ruoyi.system.api.domain.poji.member.Member; |
| | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.StringJoiner; |
| | | |
| | | /** |
| | |
| | | |
| | | /** |
| | | * 创建商户 |
| | | * @param MGTEditShopDto |
| | | * @param mgtEditShopDto |
| | | */ |
| | | @Override |
| | | public void createShop(MgtEditShopDto MGTEditShopDto){ |
| | | public void createShop(MgtEditShopDto mgtEditShopDto){ |
| | | Shop shop = new Shop(); |
| | | Boolean newShop = false; |
| | | if(MGTEditShopDto.getShopId()!=null){ |
| | | shop = this.getById(MGTEditShopDto.getShopId()); |
| | | Shop shopSame = this.getOne(new LambdaQueryWrapper<Shop>().eq(Shop::getDelFlag,0).eq(Shop::getShopName,mgtEditShopDto.getShopName())); |
| | | if(mgtEditShopDto.getShopId()!=null){ |
| | | if(shopSame!=null&&!Objects.equals(shopSame.getShopId(),mgtEditShopDto.getShopId())){ |
| | | throw new ServiceException(AppErrorConstant.SHOP_DOUBLE); |
| | | } |
| | | shop = this.getById(mgtEditShopDto.getShopId()); |
| | | shop.setUpdateTime(new Date()); |
| | | shop.setUpdateUserId(MGTEditShopDto.getUserId()); |
| | | shop.setUpdateUserId(mgtEditShopDto.getUserId()); |
| | | shop.setShopTags(null); |
| | | //清空关联记录 |
| | | shopFileService.deleteByShopId(shop.getShopId()); |
| | |
| | | shopRelUserService.deleteByShopId(shop.getShopId()); |
| | | shopStaffService.clearShopStaffRelation(shop.getShopId()); |
| | | }else{ |
| | | if(shopSame!=null){ |
| | | throw new ServiceException(AppErrorConstant.SHOP_DOUBLE); |
| | | } |
| | | shop.setShopStatus(3); |
| | | shop.setCreateTime(new Date()); |
| | | shop.setCreateUserId(MGTEditShopDto.getUserId()); |
| | | shop.setCreateUserId(mgtEditShopDto.getUserId()); |
| | | shop.setFrozenFlag(0); |
| | | shop.setCooperativeFlag(0); |
| | | newShop = true; |
| | | } |
| | | BeanUtils.copyProperties(MGTEditShopDto,shop); |
| | | BeanUtils.copyProperties(mgtEditShopDto,shop); |
| | | this.saveOrUpdate(shop); |
| | | //商户编号 |
| | | if(MGTEditShopDto.getShopId()==null){ |
| | | if(mgtEditShopDto.getShopId()==null){ |
| | | String shopNo = CodeFactoryUtil.getShopNo(shop.getShopId()); |
| | | shop.setShopNumber(shopNo); |
| | | } |
| | | //商户标签 |
| | | String shopTagIds = MGTEditShopDto.getShopTagIds(); |
| | | String shopTagIds = mgtEditShopDto.getShopTagIds(); |
| | | if(StringUtils.isNotBlank(shopTagIds)){ |
| | | String[] shopTagIdArray = shopTagIds.split(","); |
| | | ShopRelTag shopRelTag; |
| | |
| | | SysUser belongSysUser = sysUserService.getSysUser(shop.getBelongUserId()).getData(); |
| | | handleShopStaff(shop.getShopId(),belongSysUser); |
| | | //商户关联人员 |
| | | String relUserIds = MGTEditShopDto.getRelUserIds(); |
| | | String relUserIds = mgtEditShopDto.getRelUserIds(); |
| | | if(StringUtils.isNotBlank(relUserIds)){ |
| | | String[] relUserIdArray = relUserIds.split(","); |
| | | ShopRelUser shopRelUser; |
| | |
| | | ShopFile shopFile = new ShopFile(); |
| | | shopFile.setDelFlag(0); |
| | | shopFile.setFileType(1); |
| | | shopFile.setFileUrl(MGTEditShopDto.getShopPicture()); |
| | | shopFile.setFileUrl(mgtEditShopDto.getShopPicture()); |
| | | shopFile.setShopId(shop.getShopId()); |
| | | shopFileService.save(shopFile); |
| | | //商户banner |
| | | if(StringUtils.isNotBlank(MGTEditShopDto.getShopBanners())){ |
| | | String shopBanners= MGTEditShopDto.getShopBanners(); |
| | | if(StringUtils.isNotBlank(mgtEditShopDto.getShopBanners())){ |
| | | String shopBanners= mgtEditShopDto.getShopBanners(); |
| | | String[] shopBannerArray = shopBanners.split(","); |
| | | for(String str : shopBannerArray){ |
| | | shopFile = new ShopFile(); |
| | |
| | | shopProportion.setShopType(shop.getShopType()); |
| | | shopProportion.setProportionPercent(new BigDecimal("100.00")); |
| | | shopProportion.setUpdateTime(new Date()); |
| | | shopProportion.setUpdateUserId(MGTEditShopDto.getUserId()); |
| | | shopProportion.setUpdateUserId(mgtEditShopDto.getUserId()); |
| | | shopProportionService.save(shopProportion); |
| | | } |
| | | } |
| | |
| | | shopStaffService.saveOrUpdate(shopStaff); |
| | | } |
| | | |
| | | /** |
| | | * @description 平台获取商户分成列表 |
| | | * @author jqs |
| | | * @date 2023/6/8 9:25 |
| | | * @param page |
| | | * @param mgtShopProportionPageDto |
| | | * @return List<MgtShopProportionPageVo> |
| | | */ |
| | | @Override |
| | | public List<MgtShopProportionPageVo> pageMgtShopProportion(Page page, MgtShopProportionPageDto mgtShopProportionPageDto){ |
| | | return shopMapper.pageMgtShopProportion(page,mgtShopProportionPageDto); |
| | | } |
| | | |
| | | /** |
| | | * @description 删除商户标签 |
| | | * @author jqs |
| | | * @date 2023/6/8 15:53 |
| | | * @param shopTag |
| | | * @return void |
| | | */ |
| | | @Override |
| | | public void deleteShopTag(String shopTag){ |
| | | shopMapper.deleteShopTag(shopTag); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.shop.service.shop; |
| | | |
| | | import com.ruoyi.shop.domain.dto.MgtShopProportionEditDto; |
| | | import com.ruoyi.shop.domain.pojo.shop.ShopProportion; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | |
| | | */ |
| | | public interface ShopProportionService extends IService<ShopProportion> { |
| | | |
| | | /** |
| | | * @description 修改商户分成 |
| | | * @author jqs |
| | | * @date 2023/6/8 9:52 |
| | | * @param mgtShopProportionEditDto |
| | | * @return void |
| | | */ |
| | | void editMgtShopProportion(MgtShopProportionEditDto mgtShopProportionEditDto); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 创建商户 |
| | | * @param MGTEditShopDto |
| | | * @param mgtEditShopDto |
| | | */ |
| | | void createShop(MgtEditShopDto MGTEditShopDto); |
| | | void createShop(MgtEditShopDto mgtEditShopDto); |
| | | |
| | | /** |
| | | * 修改合作时间 |
| | |
| | | MerHomeShopTotalVo getMerHomeTotal(Long userId); |
| | | |
| | | /** |
| | | * |
| | | * 商户获取代理商列表 |
| | | * @param page |
| | | * @param merAgencyPageDto |
| | | * @return |
| | | */ |
| | | List<MerAgencyPageVo> pageMerAgencyVo (Page page, MerAgencyPageDto merAgencyPageDto); |
| | | |
| | | /** |
| | | * @description 平台获取商户分成列表 |
| | | * @author jqs |
| | | * @date 2023/6/8 9:25 |
| | | * @param page |
| | | * @param mgtShopProportionPageDto |
| | | * @return List<MgtShopProportionPageVo> |
| | | */ |
| | | List<MgtShopProportionPageVo> pageMgtShopProportion(Page page, MgtShopProportionPageDto mgtShopProportionPageDto); |
| | | |
| | | /** |
| | | * @description 删除商户标签 |
| | | * @author jqs |
| | | * @date 2023/6/8 15:53 |
| | | * @param shopTag |
| | | * @return void |
| | | */ |
| | | void deleteShopTag(String shopTag); |
| | | } |
| | |
| | | FROM t_shop ts |
| | | ORDER BY distance ASC LIMIT 1 |
| | | </select> |
| | | |
| | | <select id="pageMgtShopProportion" resultType="com.ruoyi.shop.domain.vo.MgtShopProportionPageVo"> |
| | | SELECT |
| | | tsp.proportion_id proportionId, |
| | | ts.shop_id shopId, |
| | | ts.shop_name shopName, |
| | | ts.shop_address shopAddress, |
| | | ts.shopowner_name shopownerName, |
| | | tsp.proportion_percent proportionPercent |
| | | FROM t_shop ts |
| | | INNER JOIN t_shop_proportion tsp ON ts.shop_id = tsp.shop_id AND tsp.del_flag = 0 |
| | | WHERE ts.del_flag = 0 AND ts.shop_type = #{param.shopType} |
| | | </select> |
| | | |
| | | <update id="deleteShopTag"> |
| | | UPDATE t_shop SET shop_tags = TRIM(BOTH ',' FROM REPLACE(CONCAT(',', shop_tags, ','), CONCAT(',',#{shopTag},','), ',')) |
| | | WHERE FIND_IN_SET(#{shopTag}, shop_tags) > 0 |
| | | </update> |
| | | </mapper> |
| | |
| | | import com.ruoyi.system.domain.dto.*; |
| | | import com.ruoyi.system.domain.vo.*; |
| | | import com.ruoyi.system.service.config.*; |
| | | import com.ruoyi.system.service.sys.ISysOperLogService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | |
| | | |
| | | @Resource |
| | | private ActivenessService activenessService; |
| | | |
| | | @Resource |
| | | private SysClassificationService sysClassificationService; |
| | | |
| | | @Resource |
| | | private ISysOperLogService operLogService; |
| | | |
| | | @Resource |
| | | private SysTagService sysTagService; |
| | | |
| | | |
| | | |
| | | @RequestMapping(value = "/editCooperation", method = RequestMethod.POST) |
| | | @ApiOperation(value = "修改申请合作") |
| | |
| | | } |
| | | |
| | | @RequestMapping(value = "/editActiveness", method = RequestMethod.POST) |
| | | @ApiOperation(value = "修改广告配置") |
| | | @ApiOperation(value = "修改活跃度") |
| | | public R editActiveness(@RequestBody MgtActivenessEditDto mgtActivenessEditDto) { |
| | | mgtActivenessEditDto.setUserId(SecurityUtils.getUserId()); |
| | | activenessService.editMgtActiveness(mgtActivenessEditDto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/pageClassification", method = RequestMethod.POST) |
| | | @ApiOperation(value = "分页获取分类列表") |
| | | public R<Page<MgtClassificationPageVo>> pageClassification(@RequestBody MgtClassificationPageDto mgtClassificationPageDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | mgtClassificationPageDto.setUserId(userId); |
| | | Page<MgtClassificationPageVo> page = new Page<>(); |
| | | page.setSize(mgtClassificationPageDto.getPageSize()); |
| | | page.setCurrent(mgtClassificationPageDto.getPageNum()); |
| | | List<MgtClassificationPageVo> mgtClassificationPageVoList = sysClassificationService.pageClassification(page, mgtClassificationPageDto); |
| | | return R.ok(page.setRecords(mgtClassificationPageVoList)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/editClassification", method = RequestMethod.POST) |
| | | @ApiOperation(value = "修改分类") |
| | | public R editClassification(@RequestBody MgtClassificationEditDto mgtClassificationEditDto) { |
| | | mgtClassificationEditDto.setUserId(SecurityUtils.getUserId()); |
| | | sysClassificationService.editClassification(mgtClassificationEditDto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/deleteClassification", method = RequestMethod.POST) |
| | | @ApiOperation(value = "删除分类") |
| | | public R deleteClassification(@RequestBody MgtBaseGetDto mgtBaseGetDto) { |
| | | mgtBaseGetDto.setUserId(SecurityUtils.getUserId()); |
| | | sysClassificationService.deleteClassification(Long.valueOf(mgtBaseGetDto.getId())); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/pageOperLog", method = RequestMethod.POST) |
| | | @ApiOperation(value = "分页获取操作日志") |
| | | public R<Page<MgtOperLogPageVo>> pageOperLog(@RequestBody MgtOperLogPageDto mgtOperLogPageDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | mgtOperLogPageDto.setUserId(userId); |
| | | Page<MgtOperLogPageVo> page = new Page<>(); |
| | | page.setSize(mgtOperLogPageDto.getPageSize()); |
| | | page.setCurrent(mgtOperLogPageDto.getPageNum()); |
| | | List<MgtOperLogPageVo> mgtOperLogPageVoList = customConfigService.pageOperLog(page, mgtOperLogPageDto); |
| | | return R.ok(page.setRecords(mgtOperLogPageVoList)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/pageTag", method = RequestMethod.POST) |
| | | @ApiOperation(value = "分页获取标签列表") |
| | | public R<Page<MgtTagPageVo>> pageTag(@RequestBody MgtTagPageDto mgtTagPageDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | mgtTagPageDto.setUserId(userId); |
| | | Page<MgtTagPageVo> page = new Page<>(); |
| | | page.setSize(mgtTagPageDto.getPageSize()); |
| | | page.setCurrent(mgtTagPageDto.getPageNum()); |
| | | List<MgtTagPageVo> mgtTagPageVoList = sysTagService.pageTag(page, mgtTagPageDto); |
| | | return R.ok(page.setRecords(mgtTagPageVoList)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/editTag", method = RequestMethod.POST) |
| | | @ApiOperation(value = "修改分类") |
| | | public R editTag(@RequestBody MgtTagEditDto mgtTagEditDto) { |
| | | mgtTagEditDto.setUserId(SecurityUtils.getUserId()); |
| | | sysTagService.editTag(mgtTagEditDto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/deleteTag", method = RequestMethod.POST) |
| | | @ApiOperation(value = "删除标签") |
| | | public R deleteTag(@RequestBody MgtBaseGetDto mgtBaseGetDto) { |
| | | mgtBaseGetDto.setUserId(SecurityUtils.getUserId()); |
| | | sysTagService.deleteTag(Long.valueOf(mgtBaseGetDto.getId())); |
| | | return R.ok(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.domain.dto; |
| | | |
| | | import com.ruoyi.system.api.domain.dto.MgtBaseDto; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @ClassName MgtClassificationEditDto |
| | | * @Description TODO |
| | | * @Author jqs |
| | | * @Date 2023/6/8 10:19 |
| | | * @Version 1.0 |
| | | */ |
| | | @Data |
| | | public class MgtClassificationEditDto extends MgtBaseDto { |
| | | |
| | | |
| | | @ApiModelProperty(value = "分类id 新增不传") |
| | | private Long classId; |
| | | |
| | | @ApiModelProperty(value = "分类类型") |
| | | private Integer classType; |
| | | |
| | | @ApiModelProperty(value = "分类名字") |
| | | private String className; |
| | | |
| | | @ApiModelProperty(value = "分类排序") |
| | | private Integer classSort; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.domain.dto; |
| | | |
| | | import com.ruoyi.system.api.domain.dto.MgtPageDto; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @ClassName MgtClassPageDto |
| | | * @Description TODO |
| | | * @Author jqs |
| | | * @Date 2023/6/8 10:03 |
| | | * @Version 1.0 |
| | | */ |
| | | @Data |
| | | public class MgtClassificationPageDto extends MgtPageDto { |
| | | |
| | | @ApiModelProperty(value = "分类类型1鸿瑞堂2商品") |
| | | private Integer classType; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.domain.dto; |
| | | |
| | | import com.ruoyi.system.api.domain.dto.MgtPageDto; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @ClassName MgtOperLogPageDto |
| | | * @Description TODO |
| | | * @Author jqs |
| | | * @Date 2023/6/8 10:55 |
| | | * @Version 1.0 |
| | | */ |
| | | @Data |
| | | public class MgtOperLogPageDto extends MgtPageDto { |
| | | |
| | | |
| | | @ApiModelProperty(value = "操作内容") |
| | | private String operContent; |
| | | |
| | | @ApiModelProperty(value = "操作类型") |
| | | private String operTitle; |
| | | |
| | | @ApiModelProperty(value = "操作开始时间") |
| | | private Date operStartTime; |
| | | |
| | | @ApiModelProperty(value = "操作结束时间") |
| | | private Date operEndTime; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.domain.dto; |
| | | |
| | | import com.ruoyi.system.api.domain.dto.MgtBaseDto; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @ClassName MgtTagEditDto |
| | | * @Description TODO |
| | | * @Author jqs |
| | | * @Date 2023/6/8 14:53 |
| | | * @Version 1.0 |
| | | */ |
| | | @Data |
| | | public class MgtTagEditDto extends MgtBaseDto { |
| | | |
| | | @ApiModelProperty(value = "标签id") |
| | | private Long tagId; |
| | | |
| | | @ApiModelProperty(value = "标签类型1用户2合作商3商品4建议") |
| | | private Integer tagType; |
| | | |
| | | @ApiModelProperty(value = "标签名称") |
| | | private String tagName; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.domain.dto; |
| | | |
| | | import com.ruoyi.system.api.domain.dto.MgtPageDto; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @ClassName MgtTagPageDto |
| | | * @Description TODO |
| | | * @Author jqs |
| | | * @Date 2023/6/8 14:03 |
| | | * @Version 1.0 |
| | | */ |
| | | @Data |
| | | public class MgtTagPageDto extends MgtPageDto { |
| | | |
| | | @ApiModelProperty(value = "标签名称") |
| | | private String tagName; |
| | | |
| | | @ApiModelProperty(value = "标签类型1用户2合作商3商品4建议") |
| | | private Integer tagType; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.domain.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @ClassName MgtClassificationPageVo |
| | | * @Description TODO |
| | | * @Author jqs |
| | | * @Date 2023/6/8 10:07 |
| | | * @Version 1.0 |
| | | */ |
| | | @Data |
| | | public class MgtClassificationPageVo { |
| | | |
| | | |
| | | @ApiModelProperty(value = "分类id") |
| | | private Long classId; |
| | | |
| | | @ApiModelProperty(value = "分类类型") |
| | | private Integer classType; |
| | | |
| | | @ApiModelProperty(value = "分类名字") |
| | | private String className; |
| | | |
| | | @ApiModelProperty(value = "分类排序") |
| | | private Integer classSort; |
| | | |
| | | @ApiModelProperty(value = "关联数量") |
| | | private Integer relationNum; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.domain.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @ClassName MgtOperLogPageVo |
| | | * @Description TODO |
| | | * @Author jqs |
| | | * @Date 2023/6/8 11:06 |
| | | * @Version 1.0 |
| | | */ |
| | | @Data |
| | | public class MgtOperLogPageVo { |
| | | |
| | | @ApiModelProperty(value = "操作内容") |
| | | private String operContent; |
| | | |
| | | @ApiModelProperty(value = "操作类型") |
| | | private String operTitle; |
| | | |
| | | @ApiModelProperty(value = "操作IP") |
| | | private String operIp; |
| | | |
| | | @ApiModelProperty(value = "操作人员") |
| | | private String operName; |
| | | |
| | | @ApiModelProperty(value = "操作时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date operTime; |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.domain.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @ClassName MgtTagPageVo |
| | | * @Description TODO |
| | | * @Author jqs |
| | | * @Date 2023/6/8 14:05 |
| | | * @Version 1.0 |
| | | */ |
| | | @Data |
| | | public class MgtTagPageVo { |
| | | |
| | | |
| | | @ApiModelProperty(value = "标签id") |
| | | private Long tagId; |
| | | |
| | | @ApiModelProperty(value = "标签名称") |
| | | private String tagName; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | private Date createTime; |
| | | } |
| | |
| | | |
| | | import com.ruoyi.system.domain.pojo.config.Article; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface ArticleMapper extends BaseMapper<Article> { |
| | | |
| | | /** |
| | | * @description 删除文章分类 |
| | | * @author jqs |
| | | * @date 2023/6/8 10:40 |
| | | * @param classId |
| | | * @return void |
| | | */ |
| | | void deleteArticleClass(@Param("classId") Long classId); |
| | | } |
| | |
| | | package com.ruoyi.system.mapper.config; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.system.domain.dto.MgtOperLogPageDto; |
| | | import com.ruoyi.system.domain.pojo.config.CustomConfig; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.domain.vo.MgtOperLogPageVo; |
| | | import io.lettuce.core.dynamic.annotation.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @return CustomConfig |
| | | */ |
| | | CustomConfig getByKey(@Param("key") String key); |
| | | |
| | | /** |
| | | * @description 分页获取操作日志 |
| | | * @author jqs |
| | | * @date 2023/6/8 11:52 |
| | | * @param page |
| | | * @param mgtOperLogPageDto |
| | | * @return List<MgtOperLogPageVo> |
| | | */ |
| | | List<MgtOperLogPageVo> pageOperLog(Page page, MgtOperLogPageDto mgtOperLogPageDto); |
| | | } |
| | |
| | | package com.ruoyi.system.mapper.config; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.system.api.domain.poji.config.SysClassification; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.domain.dto.MgtClassificationPageDto; |
| | | import com.ruoyi.system.domain.vo.MgtClassificationPageVo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface SysClassificationMapper extends BaseMapper<SysClassification> { |
| | | |
| | | /** |
| | | * @description 分页获取分类 |
| | | * @author jqs |
| | | * @date 2023/6/8 10:11 |
| | | * @param page |
| | | * @param mgtClassificationPageDto |
| | | * @return List<MgtClassificationPageVo> |
| | | */ |
| | | List<MgtClassificationPageVo> pageClassification(Page page, @Param("param") MgtClassificationPageDto mgtClassificationPageDto); |
| | | } |
| | |
| | | package com.ruoyi.system.mapper.config; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.system.api.domain.poji.config.SysTag; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.domain.dto.MgtTagPageDto; |
| | | import com.ruoyi.system.domain.vo.MgtTagPageVo; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface SysTagMapper extends BaseMapper<SysTag> { |
| | | |
| | | /** |
| | | * @description 标签管理 |
| | | * @author jqs |
| | | * @date 2023/6/8 14:09 |
| | | * @param page |
| | | * @param mgtTagPageDto |
| | | * @return List<MgtTagPageVo> |
| | | */ |
| | | List<MgtTagPageVo> pageTag(Page page, MgtTagPageDto mgtTagPageDto); |
| | | } |
| | |
| | | */ |
| | | public interface ArticleService extends IService<Article> { |
| | | |
| | | /** |
| | | * @description 删除文章分类 |
| | | * @author jqs |
| | | * @date 2023/6/8 10:40 |
| | | * @param classId |
| | | * @return void |
| | | */ |
| | | void deleteArticleClass(Long classId); |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.service.config; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.domain.dto.*; |
| | | import com.ruoyi.system.domain.pojo.config.CustomConfig; |
| | | import com.ruoyi.system.domain.vo.MgtCustomConfigVo; |
| | | import com.ruoyi.system.domain.vo.MgtOperLogPageVo; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName CustomConfigService |
| | |
| | | void editMemberConfig(MgtMemberConfigEditDto mgtMemberConfigEditDto); |
| | | |
| | | |
| | | /** |
| | | * @description 分页获取操作日志 |
| | | * @author jqs |
| | | * @date 2023/6/8 11:52 |
| | | * @param page |
| | | * @param mgtOperLogPageDto |
| | | * @return List<MgtOperLogPageVo> |
| | | */ |
| | | List<MgtOperLogPageVo> pageOperLog(Page page, MgtOperLogPageDto mgtOperLogPageDto); |
| | | |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.service.config; |
| | | |
| | | import com.ruoyi.system.api.domain.poji.config.SysClassification; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.api.domain.poji.config.SysClassification; |
| | | import com.ruoyi.system.domain.dto.MgtClassificationEditDto; |
| | | import com.ruoyi.system.domain.dto.MgtClassificationPageDto; |
| | | import com.ruoyi.system.domain.vo.MgtClassificationPageVo; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | * @version 1.0 |
| | | */ |
| | | Map<Long,SysClassification> getSysClassificationList(List<Long> classIds); |
| | | |
| | | |
| | | /** |
| | | * @description 分页获取分类 |
| | | * @author jqs |
| | | * @date 2023/6/8 10:11 |
| | | * @param page |
| | | * @param mgtClassificationPageDto |
| | | * @return List<MgtClassificationPageVo> |
| | | */ |
| | | List<MgtClassificationPageVo> pageClassification(Page page, MgtClassificationPageDto mgtClassificationPageDto); |
| | | |
| | | /** |
| | | * @description 修改分类 |
| | | * @author jqs |
| | | * @date 2023/6/8 10:23 |
| | | * @param mgtClassificationEditDto |
| | | * @return void |
| | | */ |
| | | void editClassification( MgtClassificationEditDto mgtClassificationEditDto); |
| | | |
| | | /** |
| | | * @description 删除分类 |
| | | * @author jqs |
| | | * @date 2023/6/8 10:28 |
| | | * @param classId |
| | | * @return void |
| | | */ |
| | | void deleteClassification(Long classId); |
| | | } |
| | |
| | | package com.ruoyi.system.service.config; |
| | | |
| | | import com.ruoyi.system.api.domain.poji.config.SysTag; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.api.domain.poji.config.SysTag; |
| | | import com.ruoyi.system.domain.dto.MgtTagEditDto; |
| | | import com.ruoyi.system.domain.dto.MgtTagPageDto; |
| | | import com.ruoyi.system.domain.vo.MgtTagPageVo; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | List<SysTag> listByType(Integer tagType); |
| | | |
| | | |
| | | /** |
| | | * @description 标签管理 |
| | | * @author jqs |
| | | * @date 2023/6/8 14:09 |
| | | * @param page |
| | | * @param mgtTagPageDto |
| | | * @return List<MgtTagPageVo> |
| | | */ |
| | | List<MgtTagPageVo> pageTag(Page page, MgtTagPageDto mgtTagPageDto); |
| | | |
| | | /** |
| | | * @description 修改标签 |
| | | * @author jqs |
| | | * @date 2023/6/8 15:01 |
| | | * @param mgtTagEditDto |
| | | * @return void |
| | | */ |
| | | void editTag(MgtTagEditDto mgtTagEditDto); |
| | | |
| | | /** |
| | | * @description 删除标签 |
| | | * @author jqs |
| | | * @date 2023/6/8 15:09 |
| | | * @param tagId |
| | | * @return void |
| | | */ |
| | | void deleteTag(Long tagId); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * <p> |
| | | * 关于鸿瑞堂 服务实现类 |
| | |
| | | @Service |
| | | public class ArticleServiceImpl extends ServiceImpl<ArticleMapper, Article> implements ArticleService { |
| | | |
| | | @Resource |
| | | private ArticleMapper articleMapper; |
| | | |
| | | /** |
| | | * @description 删除文章分类 |
| | | * @author jqs |
| | | * @date 2023/6/8 10:40 |
| | | * @param classId |
| | | * @return void |
| | | */ |
| | | @Override |
| | | public void deleteArticleClass(Long classId){ |
| | | articleMapper.deleteArticleClass(classId); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl.config; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.system.api.constant.ConfigEnum; |
| | | import com.ruoyi.system.api.domain.poji.config.Activeness; |
| | |
| | | import com.ruoyi.system.domain.pojo.config.CustomConfig; |
| | | import com.ruoyi.system.domain.vo.MgtActivenessVo; |
| | | import com.ruoyi.system.domain.vo.MgtCustomConfigVo; |
| | | import com.ruoyi.system.domain.vo.MgtOperLogPageVo; |
| | | import com.ruoyi.system.mapper.config.CustomConfigMapper; |
| | | import com.ruoyi.system.service.config.ActivenessService; |
| | | import com.ruoyi.system.service.config.AdvertService; |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * @description 分页获取操作日志 |
| | | * @author jqs |
| | | * @date 2023/6/8 11:52 |
| | | * @param page |
| | | * @param mgtOperLogPageDto |
| | | * @return List<MgtOperLogPageVo> |
| | | */ |
| | | @Override |
| | | public List<MgtOperLogPageVo> pageOperLog(Page page, MgtOperLogPageDto mgtOperLogPageDto){ |
| | | return customConfigMapper.pageOperLog(page, mgtOperLogPageDto); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl.config; |
| | | |
| | | import com.ruoyi.system.api.domain.poji.config.SysClassification; |
| | | import com.ruoyi.system.mapper.config.SysClassificationMapper; |
| | | import com.ruoyi.system.service.config.SysClassificationService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.system.api.constant.AppErrorConstant; |
| | | import com.ruoyi.system.api.domain.poji.config.SysClassification; |
| | | import com.ruoyi.system.api.service.RemoteGoodsService; |
| | | import com.ruoyi.system.domain.dto.MgtClassificationEditDto; |
| | | import com.ruoyi.system.domain.dto.MgtClassificationPageDto; |
| | | import com.ruoyi.system.domain.vo.MgtClassificationPageVo; |
| | | import com.ruoyi.system.mapper.config.SysClassificationMapper; |
| | | import com.ruoyi.system.service.config.ArticleService; |
| | | import com.ruoyi.system.service.config.SysClassificationService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class SysClassificationServiceImpl extends ServiceImpl<SysClassificationMapper, SysClassification> implements SysClassificationService { |
| | | |
| | | @Resource |
| | | private SysClassificationMapper sysClassificationMapper; |
| | | |
| | | @Resource |
| | | private RemoteGoodsService remoteGoodsService; |
| | | |
| | | @Resource |
| | | private ArticleService articleService; |
| | | |
| | | /** |
| | | * @description: TODO |
| | |
| | | } |
| | | return sysClassificationMap; |
| | | } |
| | | |
| | | /** |
| | | * @description 分页获取分类 |
| | | * @author jqs |
| | | * @date 2023/6/8 10:11 |
| | | * @param page |
| | | * @param mgtClassificationPageDto |
| | | * @return List<MgtClassificationPageVo> |
| | | */ |
| | | @Override |
| | | public List<MgtClassificationPageVo> pageClassification(Page page, MgtClassificationPageDto mgtClassificationPageDto){ |
| | | return sysClassificationMapper.pageClassification(page, mgtClassificationPageDto); |
| | | } |
| | | |
| | | /** |
| | | * @description 修改分类 |
| | | * @author jqs |
| | | * @date 2023/6/8 10:23 |
| | | * @param mgtClassificationEditDto |
| | | * @return void |
| | | */ |
| | | @Override |
| | | public void editClassification(MgtClassificationEditDto mgtClassificationEditDto){ |
| | | // 查询未删除的同类名同分类类型的分类 |
| | | LambdaQueryWrapper<SysClassification> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(SysClassification::getDelFlag,0) |
| | | .eq(SysClassification::getClassType,mgtClassificationEditDto.getClassType()) |
| | | .eq(SysClassification::getClassName,mgtClassificationEditDto.getClassName()); |
| | | SysClassification sysClassificationSame = this.getOne(queryWrapper); |
| | | // 获取分类ID |
| | | Long classId = mgtClassificationEditDto.getClassId(); |
| | | SysClassification sysClassification; |
| | | // 如果分类ID不为空 |
| | | if(classId != null){ |
| | | // 如果存在同类名同分类类型的分类,但是分类ID不同,抛出异常 |
| | | if(sysClassificationSame != null && !Objects.equals(sysClassificationSame.getClassId(), classId)){ |
| | | throw new ServiceException(AppErrorConstant.CLASS_DOUBLE); |
| | | } |
| | | // 获取要修改的分类 |
| | | sysClassification = this.getById(classId); |
| | | }else{ // 如果分类ID为空 |
| | | // 如果存在同类名同分类类型的分类,抛出异常 |
| | | if(sysClassificationSame!=null){ |
| | | throw new ServiceException(AppErrorConstant.CLASS_DOUBLE); |
| | | } |
| | | // 新建分类 |
| | | sysClassification = new SysClassification(); |
| | | sysClassification.setDelFlag(0); |
| | | sysClassification.setRelationNum(0); |
| | | } |
| | | // 设置分类信息 |
| | | sysClassification.setClassType(mgtClassificationEditDto.getClassType()); |
| | | sysClassification.setClassName(mgtClassificationEditDto.getClassName()); |
| | | sysClassification.setClassSort(mgtClassificationEditDto.getClassSort()); |
| | | sysClassification.setCreateTime(new Date()); |
| | | // 保存或更新分类 |
| | | this.saveOrUpdate(sysClassification); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * @description 删除分类 |
| | | * @author jqs |
| | | * @date 2023/6/8 10:28 |
| | | * @param classId |
| | | * @return void |
| | | */ |
| | | @Override |
| | | public void deleteClassification(Long classId){ |
| | | SysClassification sysClassification = this.getById(classId); |
| | | sysClassification.setDelFlag(1); |
| | | this.saveOrUpdate(sysClassification); |
| | | if(sysClassification.getClassType()==1){ |
| | | articleService.deleteArticleClass(classId); |
| | | }else if(sysClassification.getClassType()==2){ |
| | | remoteGoodsService.deleteGoodsClass(classId); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.system.api.constant.AppErrorConstant; |
| | | import com.ruoyi.system.api.domain.poji.config.SysTag; |
| | | import com.ruoyi.system.domain.dto.MgtTagEditDto; |
| | | import com.ruoyi.system.domain.dto.MgtTagPageDto; |
| | | import com.ruoyi.system.domain.vo.MgtTagPageVo; |
| | | import com.ruoyi.system.mapper.config.SysTagMapper; |
| | | import com.ruoyi.system.service.config.SysTagService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class SysTagServiceImpl extends ServiceImpl<SysTagMapper, SysTag> implements SysTagService { |
| | | |
| | | @Resource |
| | | private SysTagMapper sysTagMapper; |
| | | |
| | | /** |
| | | * 通过id获取系统标签 |
| | |
| | | List<SysTag> sysTagsList = this.list(queryWrapper); |
| | | return sysTagsList; |
| | | } |
| | | |
| | | /** |
| | | * @description 标签管理 |
| | | * @author jqs |
| | | * @date 2023/6/8 14:09 |
| | | * @param page |
| | | * @param mgtTagPageDto |
| | | * @return List<MgtTagPageVo> |
| | | */ |
| | | @Override |
| | | public List<MgtTagPageVo> pageTag(Page page, MgtTagPageDto mgtTagPageDto){ |
| | | return sysTagMapper.pageTag(page, mgtTagPageDto); |
| | | } |
| | | |
| | | /** |
| | | * @description 修改标签 |
| | | * @author jqs |
| | | * @date 2023/6/8 15:01 |
| | | * @param mgtTagEditDto |
| | | * @return void |
| | | */ |
| | | @Override |
| | | public void editTag(MgtTagEditDto mgtTagEditDto){ |
| | | // 创建LambdaQueryWrapper对象,用于构建查询条件 |
| | | LambdaQueryWrapper<SysTag> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(SysTag::getDelFlag, 0) // 查询条件:delFlag=0 |
| | | .eq(SysTag::getTagType, mgtTagEditDto.getTagType()) // 查询条件:tagType=mgtTagEditDto的tagType属性 |
| | | .eq(SysTag::getTagName, mgtTagEditDto.getTagName()); // 查询条件:tagName=mgtTagEditDto的tagName属性 |
| | | // 执行查询,获取与查询条件匹配的SysTag对象 |
| | | SysTag sysTagSame = this.getOne(queryWrapper); |
| | | // 获取mgtTagEditDto的tagId属性 |
| | | Long tagId = mgtTagEditDto.getTagId(); |
| | | // 定义SysTag对象 |
| | | SysTag sysTag; |
| | | if (tagId != null) { // 如果tagId不为空 |
| | | // 如果存在同类名同分类类型的分类,但是分类ID不同,抛出异常 |
| | | if (sysTagSame != null && !Objects.equals(sysTagSame.getTagId(), tagId)) { |
| | | throw new ServiceException(AppErrorConstant.TAG_DOUBLE); |
| | | } |
| | | // 根据tagId获取要修改的分类 |
| | | sysTag = this.getById(tagId); |
| | | } else { // 如果tagId为空 |
| | | // 如果存在同类名同分类类型的分类,抛出异常 |
| | | if (sysTagSame != null) { |
| | | throw new ServiceException(AppErrorConstant.TAG_DOUBLE); |
| | | } |
| | | // 新建分类 |
| | | sysTag = new SysTag(); |
| | | sysTag.setDelFlag(0); |
| | | } |
| | | // 设置sysTag的属性 |
| | | sysTag.setTagType(mgtTagEditDto.getTagType()); |
| | | sysTag.setTagName(mgtTagEditDto.getTagName()); |
| | | sysTag.setCreateTime(new Date()); |
| | | sysTag.setSynFlag(0); |
| | | // 执行保存或更新操作 |
| | | this.saveOrUpdate(sysTag); |
| | | } |
| | | |
| | | /** |
| | | * @description 删除标签 |
| | | * @author jqs |
| | | * @date 2023/6/8 15:09 |
| | | * @param tagId |
| | | * @return void |
| | | */ |
| | | @Override |
| | | public void deleteTag(Long tagId){ |
| | | SysTag sysTag = this.getById(tagId); |
| | | sysTag.setDelFlag(1); |
| | | this.saveOrUpdate(sysTag); |
| | | handleDeleteTag(sysTag.getTagType(),sysTag.getTagName()); |
| | | } |
| | | |
| | | @Async |
| | | protected void handleDeleteTag(Integer tagType, String tagName){ |
| | | //标签类型1用户2合作商3商品4建议 |
| | | switch (tagType){ |
| | | case 1: |
| | | |
| | | break; |
| | | case 2: |
| | | |
| | | break; |
| | | case 3: |
| | | |
| | | break; |
| | | case 4: |
| | | |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl.sys; |
| | | |
| | | import java.util.List; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.ruoyi.system.api.domain.poji.sys.SysOperLog; |
| | | import com.ruoyi.system.mapper.sys.SysOperLogMapper; |
| | | import com.ruoyi.system.service.sys.ISysOperLogService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 操作日志 服务层处理 |
| | |
| | | { |
| | | operLogMapper.cleanOperLog(); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.system.mapper.config.ArticleMapper"> |
| | | |
| | | |
| | | <update id="deleteArticleClass"> |
| | | UPDATE t_article SET class_id = null WHERE class_id = #{classId} |
| | | </update> |
| | | |
| | | </mapper> |
| | |
| | | <include refid="selectCustomConfigVo"/> |
| | | WHERE del_flag = 0 AND key = #{key} |
| | | </select> |
| | | |
| | | <select id="pageOperLog" resultType="com.ruoyi.system.domain.vo.MgtOperLogPageVo"> |
| | | SELECT |
| | | oper_time operTime, |
| | | oper_name operName, |
| | | oper_title operTitle, |
| | | oper_ip operIp, |
| | | oper_content operContent |
| | | FROM sys_oper_log |
| | | WHERE operator_type = 1 |
| | | ORDER BY oper_time DESC |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <result property="createTime" column="create_time" /> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="pageClassification" resultType="com.ruoyi.system.domain.vo.MgtClassificationPageVo"> |
| | | SELECT |
| | | class_id classId, |
| | | class_type classType, |
| | | class_name className, |
| | | class_sort classSort, |
| | | relation_num relationNum |
| | | FROM t_sys_classification |
| | | WHERE del_flag = 0 AND class_type = #{param.calssType} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <?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.ruoyi.system.mapper.SysTagMapper"> |
| | | <mapper namespace="com.ruoyi.system.mapper.config.SysTagMapper"> |
| | | |
| | | <resultMap type="SysTag" id="SysTagResult"> |
| | | <result property="tagId" column="tag_id" /> |
| | |
| | | <result property="tagName" column="tag_name" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="synFlag" column="syn_flag" /> |
| | | |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="pageTag" resultType="com.ruoyi.system.domain.vo.MgtTagPageVo"> |
| | | SELECT |
| | | tag_id tagId, |
| | | tag_name tagName, |
| | | create_time createTime |
| | | FROM t_sys_tag |
| | | WHERE del_flag = 0 AND tag_type = #{param.tagType} |
| | | <if test="param.tagName!=null and param.tagName !=''"> |
| | | AND tag_name LIKE CONCAT('%',#{param.tagName},'%') |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <result property="errorMsg" column="error_msg" /> |
| | | <result property="operTime" column="oper_time" /> |
| | | <result property="costTime" column="cost_time" /> |
| | | <result property="operContent" column="oper_content" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectOperLogVo"> |
| | | select oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_param, json_result, status, error_msg, oper_time, cost_time |
| | | select oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_param, json_result, status, error_msg, oper_time, cost_time, oper_content |
| | | from sys_oper_log |
| | | </sql> |
| | | |
| | | <insert id="insertOperlog" parameterType="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) |
| | | 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, oper_content) |
| | | values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, #{costTime}, sysdate()) |
| | | </insert> |
| | | |