经纪人
This commit is contained in:
parent
8d494b5744
commit
845fa141c2
|
@ -20,6 +20,8 @@ import com.sqx.modules.artificer.entity.Artificer;
|
|||
import com.sqx.modules.artificer.entity.Certification;
|
||||
import com.sqx.modules.artificer.service.ArtificerService;
|
||||
import com.sqx.modules.artificer.service.RealNameService;
|
||||
import com.sqx.modules.bl.commission.jjr.entity.JjrData;
|
||||
import com.sqx.modules.bl.commission.jjr.service.JjrDataService;
|
||||
import com.sqx.modules.common.service.CommonInfoService;
|
||||
import com.sqx.modules.message.entity.MessageInfo;
|
||||
import com.sqx.modules.message.service.MessageService;
|
||||
|
@ -75,6 +77,8 @@ public class UserController {
|
|||
private MessageService messageService;
|
||||
@Autowired
|
||||
private CommonInfoService commonInfoService;
|
||||
@Autowired
|
||||
private JjrDataService jjrDataService;
|
||||
|
||||
@GetMapping("/queryByInvitationCode")
|
||||
@ApiOperation("通过邀请码查询用户")
|
||||
|
@ -96,6 +100,10 @@ public class UserController {
|
|||
public Result selectUserById(@ApiParam("用户id") @PathVariable Long userId) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
UserEntity userEntity = userService.queryByUserId(userId);
|
||||
JjrData jjrData = jjrDataService.getByCode(userEntity.getBlJjrCode());
|
||||
if(jjrData != null){
|
||||
userEntity.setJjrName(jjrData.getName());
|
||||
}
|
||||
UserMoney userMoney = userMoneyService.selectUserMoneyByUserId(userId);
|
||||
//查询用户钱包
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
@ -119,7 +127,6 @@ public class UserController {
|
|||
userEntity.setMember(userVip.getIsVip().intValue());
|
||||
userEntity.setVipEndTime(userVip.getEndTime());
|
||||
}
|
||||
|
||||
map.put("artificer", artificer);
|
||||
map.put("userEntity", userEntity);
|
||||
map.put("money", userMoney);
|
||||
|
|
|
@ -245,4 +245,10 @@ public class UserEntity implements Serializable {
|
|||
@TableField(exist = false)
|
||||
private String loglataddress;
|
||||
|
||||
private String blJjrCode;
|
||||
private BigDecimal blJjrRate;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String jjrName;
|
||||
|
||||
}
|
||||
|
|
|
@ -120,9 +120,9 @@ public class ArtificerController {
|
|||
@ApiOperation("查询技师列表")
|
||||
public Result selectArtificerList(Integer page, Integer limit, Long massageTypeId, String artificerName,
|
||||
String longitude,String latitude,Integer sort,Integer authentication,
|
||||
Integer by,Integer status,String city,Long classifyId,String phone,Integer isStart,Integer technicianType){
|
||||
Integer by,Integer status,String city,Long classifyId,String phone,Integer isStart,Integer technicianType,String isBack){
|
||||
return artificerService.selectArtificerList(page, limit, massageTypeId, artificerName,longitude,latitude,
|
||||
sort,authentication,by,status,city,classifyId,phone,null,isStart,technicianType);
|
||||
sort,authentication,by,status,city,classifyId,phone,null,isStart,technicianType,isBack);
|
||||
}
|
||||
|
||||
@GetMapping("/selectArtificer")
|
||||
|
|
|
@ -137,9 +137,9 @@ public class AppArtificerController {
|
|||
@ApiOperation("查询技师列表")
|
||||
public Result selectArtificerList(Integer page, Integer limit, Long massageTypeId, String artificerName,
|
||||
String longitude,String latitude,Integer sort,Integer authentication,
|
||||
Integer by,String city,Long classifyId,String phone, Integer isStart,Integer technicianType){
|
||||
Integer by,String city,Long classifyId,String phone, Integer isStart,Integer technicianType,String isBack){
|
||||
return artificerService.selectArtificerList(page, limit, massageTypeId, artificerName,longitude,latitude,
|
||||
sort,authentication,by,-1,city,classifyId,phone,1,isStart,technicianType);
|
||||
sort,authentication,by,-1,city,classifyId,phone,1,isStart,technicianType,isBack);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ public interface ArtificerDao extends BaseMapper<Artificer> {
|
|||
@Param("authentication") Integer authentication,@Param("by") Integer by,
|
||||
@Param("status") Integer status,@Param("city") String city,
|
||||
@Param("classifyId") Long classifyId,@Param("phone") String phone,
|
||||
Integer user,@Param("isStart") Integer isStart,@Param("technicianType")Integer technicianType);
|
||||
Integer user,@Param("isStart") Integer isStart,@Param("technicianType")Integer technicianType,@Param("isBack")String isBack);
|
||||
|
||||
Artificer selectArtificerById(@Param("userId") Long userId,@Param("artificerId") Long artificerId,@Param("longitude") String longitude,@Param("latitude") String latitude);
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ public interface ArtificerService extends IService<Artificer> {
|
|||
|
||||
Result selectArtificerList(Integer page, Integer limit, Long massageTypeId, String artificerName,
|
||||
String longitude,String latitude,Integer sort,Integer authentication,
|
||||
Integer by,Integer status,String city,Long classifyId,String phone,Integer user, Integer isStart,Integer technicianType);
|
||||
Integer by,Integer status,String city,Long classifyId,String phone,Integer user, Integer isStart,Integer technicianType,String isBack);
|
||||
|
||||
Artificer selectArtificerById(Long userId,Long artificerId,String longitude,String latitude);
|
||||
|
||||
|
|
|
@ -75,10 +75,10 @@ public class ArtificerServiceImpl extends ServiceImpl<ArtificerDao, Artificer> i
|
|||
@Override
|
||||
public Result selectArtificerList(Integer page, Integer limit, Long massageTypeId,String artificerName,
|
||||
String longitude,String latitude,Integer sort,Integer authentication,
|
||||
Integer by,Integer status,String city,Long classifyId,String phone,Integer user, Integer isStart,Integer technicianType){
|
||||
Integer by,Integer status,String city,Long classifyId,String phone,Integer user, Integer isStart,Integer technicianType,String isBack){
|
||||
Page<Artificer> pages=new Page<>(page,limit);
|
||||
IPage<Artificer> artificerIPage = baseMapper.selectArtificerList(pages, massageTypeId, artificerName,
|
||||
longitude, latitude, sort, authentication, by, status, city, classifyId,phone,user,isStart,technicianType);
|
||||
longitude, latitude, sort, authentication, by, status, city, classifyId,phone,user,isStart,technicianType,isBack);
|
||||
List<Artificer> records = artificerIPage.getRecords();
|
||||
String value = commonInfoService.findOne(392).getValue();
|
||||
if("30".equals(value)){
|
||||
|
@ -663,7 +663,7 @@ public class ArtificerServiceImpl extends ServiceImpl<ArtificerDao, Artificer> i
|
|||
public Result getHomeArtificerList(Integer page, Integer limit, Integer isStart,Integer status, String city, String longitude, String latitude){
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
Page<Artificer> pages=new Page<>(page,limit);
|
||||
IPage<Artificer> artificerIPage = baseMapper.selectArtificerList(pages, null, "",longitude, latitude, 1, 2, 1, status, city, null,"",1,0,null);
|
||||
IPage<Artificer> artificerIPage = baseMapper.selectArtificerList(pages, null, "",longitude, latitude, 1, 2, 1, status, city, null,"",1,0,null,"");
|
||||
map.put("nearData",new PageUtils(artificerIPage));
|
||||
map.put("startData",new PageUtils(baseMapper.getHomeStartArtificerList(pages,isStart,status,city)));
|
||||
return Result.success(map);
|
||||
|
|
|
@ -0,0 +1,63 @@
|
|||
package com.sqx.modules.bl.commission.fxy.controller;
|
||||
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.bl.commission.fxy.entity.FxyApply;
|
||||
import com.sqx.modules.bl.commission.fxy.service.FxyApplyService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/commission/fxyApply")
|
||||
@Api(value = "分佣管理", tags = {"分销员申请"})
|
||||
public class FxyApplyController {
|
||||
|
||||
@Autowired
|
||||
private FxyApplyService service;
|
||||
|
||||
@GetMapping("/findPage")
|
||||
@ApiOperation("查询(分页)")
|
||||
public Result findPage(FxyApply fxyApply){
|
||||
return service.findPage(fxyApply);
|
||||
}
|
||||
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("添加")
|
||||
public Result add(FxyApply fxyApply){
|
||||
service.add(fxyApply);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
@ApiOperation("修改")
|
||||
public Result update(FxyApply fxyApply){
|
||||
service.update(fxyApply);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@PostMapping("/delete")
|
||||
@ApiOperation("删除")
|
||||
public Result delete(FxyApply fxyApply){
|
||||
service.removeById(fxyApply.getId());
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@PostMapping("/approve")
|
||||
@ApiOperation("审批")
|
||||
public Result approve(FxyApply fxyApply){
|
||||
service.approve(fxyApply);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@GetMapping("/findUserPage")
|
||||
@ApiOperation("查询(分页)")
|
||||
public Result findUserPage(FxyApply fxyApply){
|
||||
return service.findUserPage(fxyApply);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
package com.sqx.modules.bl.commission.fxy.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.bl.commission.fxy.entity.FxyConfig;
|
||||
import com.sqx.modules.bl.commission.fxy.service.FxyConfigService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/commission/fxyConfig")
|
||||
@Api(value = "分佣管理", tags = {"分销员配置"})
|
||||
public class FxyConfigController {
|
||||
|
||||
@Autowired
|
||||
private FxyConfigService service;
|
||||
|
||||
@GetMapping("/info")
|
||||
@ApiOperation("查询分销员配置")
|
||||
public Result info(FxyConfig fxyConfig){
|
||||
FxyConfig entity = service.getById(fxyConfig);
|
||||
if(entity == null){
|
||||
entity = service.getOne(new QueryWrapper<FxyConfig>());
|
||||
}
|
||||
return Result.success().put("data",entity);
|
||||
}
|
||||
|
||||
@PostMapping("/save")
|
||||
@ApiOperation("添加分销员")
|
||||
public Result save(FxyConfig fxyConfig){
|
||||
FxyConfig entity = service.getById(fxyConfig);
|
||||
if(entity!=null){
|
||||
service.updateById(fxyConfig);
|
||||
}else{
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
fxyConfig.setCreateTime(sdf.format(new Date()));
|
||||
service.save(fxyConfig);
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package com.sqx.modules.bl.commission.fxy.controller.app;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.bl.commission.fxy.entity.FxyApply;
|
||||
import com.sqx.modules.bl.commission.fxy.entity.FxyConfig;
|
||||
import com.sqx.modules.bl.commission.fxy.service.FxyApplyService;
|
||||
import com.sqx.modules.bl.commission.fxy.service.FxyConfigService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/app/commission/fxy")
|
||||
@Api(value = "分佣管理", tags = {"分销员管理app"})
|
||||
public class AppFxyController {
|
||||
|
||||
@Autowired
|
||||
private FxyApplyService service;
|
||||
|
||||
@PostMapping("/apply")
|
||||
@ApiOperation("申请分销员")
|
||||
public Result apply(FxyApply fxyApply){
|
||||
service.add(fxyApply);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.sqx.modules.bl.commission.fxy.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.sqx.modules.bl.commission.fxy.entity.FxyApply;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@Mapper
|
||||
public interface FxyApplyDao extends BaseMapper<FxyApply> {
|
||||
IPage<FxyApply> findPage(Page<FxyApply> page, @Param("params") FxyApply fxyApply);
|
||||
int add(FxyApply fxyApply);
|
||||
int update(FxyApply fxyApply);
|
||||
int approve(FxyApply fxyApply);
|
||||
IPage<FxyApply> findUserPage(Page<FxyApply> page, @Param("params") FxyApply fxyApply);
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package com.sqx.modules.bl.commission.fxy.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.sqx.modules.bl.commission.fxy.entity.FxyConfig;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface FxyConfigDao extends BaseMapper<FxyConfig> {
|
||||
|
||||
}
|
|
@ -0,0 +1,104 @@
|
|||
package com.sqx.modules.bl.commission.fxy.entity;
|
||||
|
||||
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 lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @description bl_fxy_apply
|
||||
* 分销员申请表
|
||||
* @author caolei
|
||||
* @date 2024-08-03
|
||||
*/
|
||||
@Data
|
||||
@TableName("bl_fxy_apply")
|
||||
public class FxyApply implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
*用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
/**
|
||||
*姓名
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
*电话
|
||||
*/
|
||||
private String phone;
|
||||
/**
|
||||
*头像
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String avatar;
|
||||
/**
|
||||
*昵称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String userName;
|
||||
/**
|
||||
*邀请码
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String invitationCode;
|
||||
/**
|
||||
*备注
|
||||
*/
|
||||
private String remarks;
|
||||
/**
|
||||
*状态
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
*审批意见
|
||||
*/
|
||||
private String opinion;
|
||||
/**
|
||||
*创建时间
|
||||
*/
|
||||
private String createTime;
|
||||
/**
|
||||
*审批时间
|
||||
*/
|
||||
private String approveTime;
|
||||
/**
|
||||
*审批人
|
||||
*/
|
||||
private Long approveUser;
|
||||
/**
|
||||
*开始时间
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String startTime;
|
||||
/**
|
||||
*结束时间
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String endTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer page;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer limit;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer userPage;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer userLimit;
|
||||
|
||||
public FxyApply() {}
|
||||
}
|
|
@ -0,0 +1,98 @@
|
|||
package com.sqx.modules.bl.commission.fxy.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @description bl_fxy_config
|
||||
* 分销员配置表
|
||||
* @author caolei
|
||||
* @date 2024-08-03
|
||||
*/
|
||||
@Data
|
||||
@TableName("bl_fxy_config")
|
||||
public class FxyConfig implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
*是否启用 1启用 0关闭
|
||||
*/
|
||||
private Integer isOpen;
|
||||
/**
|
||||
*分销员审核 1启用 0关闭
|
||||
*/
|
||||
private Integer isApprove;
|
||||
/**
|
||||
*提成方式 1人员 2项目 暂无用预留
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
*一级分销返佣
|
||||
*/
|
||||
private BigDecimal oneRate;
|
||||
/**
|
||||
*二级分销返佣
|
||||
*/
|
||||
private BigDecimal twoRate;
|
||||
/**
|
||||
*技师承担
|
||||
*/
|
||||
private BigDecimal artificerRate;
|
||||
/**
|
||||
*代理商承担
|
||||
*/
|
||||
private BigDecimal agentRate;
|
||||
/**
|
||||
*邀请用户/下级返佣最高比例
|
||||
*/
|
||||
private BigDecimal mostRate;
|
||||
/**
|
||||
*邀请用户推广海报背景图
|
||||
*/
|
||||
private String userImage;
|
||||
/**
|
||||
*邀请分销员推广海报背景图
|
||||
*/
|
||||
private String fxyImage;
|
||||
/**
|
||||
*一级分销员门槛费
|
||||
*/
|
||||
private BigDecimal oneFee;
|
||||
/**
|
||||
*一级推荐提成
|
||||
*/
|
||||
private BigDecimal oneRecommendRate;
|
||||
/**
|
||||
*二级分销员门槛费
|
||||
*/
|
||||
private BigDecimal twoFee;
|
||||
/**
|
||||
*二级推荐提成
|
||||
*/
|
||||
private BigDecimal twoRecommendRate;
|
||||
/**
|
||||
*分销码时效性 1永久 2限制时效天数
|
||||
*/
|
||||
private Integer fxmLimit;
|
||||
/**
|
||||
*时效天数
|
||||
*/
|
||||
private Integer fxmLimitDays;
|
||||
/**
|
||||
*创建时间
|
||||
*/
|
||||
private String createTime;
|
||||
|
||||
public FxyConfig() {}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package com.sqx.modules.bl.commission.fxy.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.bl.commission.fxy.entity.FxyApply;
|
||||
|
||||
public interface FxyApplyService extends IService<FxyApply> {
|
||||
Result findPage(FxyApply fxyApply);
|
||||
int add(FxyApply fxyApply);
|
||||
int update(FxyApply fxyApply);
|
||||
int approve(FxyApply fxyApply);
|
||||
Result findUserPage(FxyApply fxyApply);
|
||||
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package com.sqx.modules.bl.commission.fxy.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.sqx.modules.bl.commission.fxy.entity.FxyConfig;
|
||||
|
||||
public interface FxyConfigService extends IService<FxyConfig> {
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
package com.sqx.modules.bl.commission.fxy.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.bl.commission.fxy.dao.FxyApplyDao;
|
||||
import com.sqx.modules.bl.commission.fxy.entity.FxyApply;
|
||||
import com.sqx.modules.bl.commission.fxy.service.FxyApplyService;
|
||||
import com.sqx.modules.sys.entity.SysUserEntity;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
@Service
|
||||
public class FxyApplyServiceImpl extends ServiceImpl<FxyApplyDao, FxyApply> implements FxyApplyService {
|
||||
|
||||
@Override
|
||||
public Result findPage(FxyApply fxyApply){
|
||||
Page<FxyApply> pages=new Page<>(fxyApply.getPage(),fxyApply.getLimit());
|
||||
return Result.success().put("data",new PageUtils(baseMapper.findPage(pages,fxyApply)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int add(FxyApply fxyApply){
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
fxyApply.setCreateTime(sdf.format(new Date()));
|
||||
return baseMapper.add(fxyApply);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(FxyApply fxyApply){
|
||||
return baseMapper.update(fxyApply);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int approve(FxyApply fxyApply){
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
fxyApply.setApproveTime(sdf.format(new Date()));
|
||||
fxyApply.setApproveUser(((SysUserEntity) SecurityUtils.getSubject().getPrincipal()).getUserId());
|
||||
return baseMapper.approve(fxyApply);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result findUserPage(FxyApply fxyApply){
|
||||
Page<FxyApply> pages=new Page<>(fxyApply.getUserPage(),fxyApply.getUserLimit());
|
||||
return Result.success().put("data",new PageUtils(baseMapper.findUserPage(pages,fxyApply)));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package com.sqx.modules.bl.commission.fxy.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.sqx.modules.bl.commission.fxy.dao.FxyConfigDao;
|
||||
import com.sqx.modules.bl.commission.fxy.entity.FxyConfig;
|
||||
import com.sqx.modules.bl.commission.fxy.service.FxyConfigService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class FxyConfigServiceImpl extends ServiceImpl<FxyConfigDao, FxyConfig> implements FxyConfigService {
|
||||
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
package com.sqx.modules.bl.commission.jjr.controller;
|
||||
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.bl.commission.fxy.entity.FxyApply;
|
||||
import com.sqx.modules.bl.commission.jjr.entity.JjrApply;
|
||||
import com.sqx.modules.bl.commission.jjr.service.JjrApplyService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/commission/jjrApply")
|
||||
@Api(value = "分佣管理", tags = {"经纪人申请"})
|
||||
public class JjrApplyController {
|
||||
|
||||
@Autowired
|
||||
private JjrApplyService service;
|
||||
|
||||
@GetMapping("/findPage")
|
||||
@ApiOperation("查询(分页)")
|
||||
public Result findPage(JjrApply jjrApply){
|
||||
return service.findPage(jjrApply);
|
||||
}
|
||||
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("添加")
|
||||
public Result add(JjrApply jjrApply){
|
||||
service.add(jjrApply);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
@ApiOperation("修改")
|
||||
public Result update(JjrApply jjrApply){
|
||||
service.update(jjrApply);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@PostMapping("/delete")
|
||||
@ApiOperation("删除")
|
||||
public Result delete(JjrApply jjrApply){
|
||||
service.removeById(jjrApply.getId());
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@PostMapping("/approve")
|
||||
@ApiOperation("审批")
|
||||
public Result approve(JjrApply jjrApply){
|
||||
service.approve(jjrApply);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@GetMapping("/findUserPage")
|
||||
@ApiOperation("查询(分页)")
|
||||
public Result findUserPage(JjrApply jjrApply){
|
||||
return service.findUserPage(jjrApply);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
package com.sqx.modules.bl.commission.jjr.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.bl.commission.jjr.entity.JjrConfig;
|
||||
import com.sqx.modules.bl.commission.jjr.service.JjrApplyService;
|
||||
import com.sqx.modules.bl.commission.jjr.service.JjrConfigService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/commission/jjrConfig")
|
||||
@Api(value = "分佣管理", tags = {"经纪人配置"})
|
||||
public class JjrConfigController {
|
||||
|
||||
@Autowired
|
||||
private JjrConfigService service;
|
||||
@Autowired
|
||||
private JjrApplyService applyService;
|
||||
|
||||
@GetMapping("/info")
|
||||
@ApiOperation("查询经纪人配置")
|
||||
public Result info(JjrConfig jjrConfig){
|
||||
JjrConfig entity = service.getById(jjrConfig);
|
||||
if(entity == null){
|
||||
entity = service.getOne(new QueryWrapper<JjrConfig>());
|
||||
}
|
||||
return Result.success().put("data",entity);
|
||||
}
|
||||
|
||||
@PostMapping("/save")
|
||||
@ApiOperation("添加经纪人")
|
||||
public Result save(JjrConfig jjrConfig){
|
||||
JjrConfig entity = service.getById(jjrConfig);
|
||||
if(entity!=null){
|
||||
service.updateById(jjrConfig);
|
||||
}else{
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
jjrConfig.setCreateTime(sdf.format(new Date()));
|
||||
service.save(jjrConfig);
|
||||
}
|
||||
applyService.setJjrRate(null);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
package com.sqx.modules.bl.commission.jjr.controller;
|
||||
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.bl.commission.jjr.entity.JjrData;
|
||||
import com.sqx.modules.bl.commission.jjr.service.JjrDataService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/commission/jjrData")
|
||||
@Api(value = "分佣管理", tags = {"经纪人数据"})
|
||||
public class JjrDataController {
|
||||
|
||||
@Autowired
|
||||
private JjrDataService service;
|
||||
|
||||
@GetMapping("/jjrList")
|
||||
@ApiOperation("经纪人列表")
|
||||
public Result jjrList(Integer page,Integer limit,String name,String phone){
|
||||
JjrData jjrData = new JjrData();
|
||||
jjrData.setPage(page);
|
||||
jjrData.setLimit(limit);
|
||||
jjrData.setName(name);
|
||||
jjrData.setPhone(phone);
|
||||
return service.findJjrPage(jjrData);
|
||||
}
|
||||
|
||||
@GetMapping("/modifyJjr")
|
||||
@ApiOperation("技师修改经纪人")
|
||||
public Result modifyJjr(Long artificerUserId, String invitationCode){
|
||||
JjrData jjrData = new JjrData();
|
||||
jjrData.setArtificerUserId(artificerUserId);
|
||||
jjrData.setInvitationCode(invitationCode);
|
||||
service.modifyJjr(jjrData);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package com.sqx.modules.bl.commission.jjr.controller.app;
|
||||
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.bl.commission.jjr.entity.JjrApply;
|
||||
import com.sqx.modules.bl.commission.jjr.entity.JjrData;
|
||||
import com.sqx.modules.bl.commission.jjr.service.JjrApplyService;
|
||||
import com.sqx.modules.bl.commission.jjr.service.JjrDataService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/app/commission/jjr")
|
||||
@Api(value = "分佣管理", tags = {"经纪人管理app"})
|
||||
public class AppJjrController {
|
||||
|
||||
@Autowired
|
||||
private JjrApplyService applyService;
|
||||
|
||||
@GetMapping("/apply")
|
||||
@ApiOperation("申请经纪人")
|
||||
public Result apply(JjrApply jjrApply){
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
jjrApply.setCreateTime(sdf.format(new Date()));
|
||||
applyService.add(jjrApply);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package com.sqx.modules.bl.commission.jjr.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.sqx.modules.bl.commission.jjr.entity.JjrApply;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface JjrApplyDao extends BaseMapper<JjrApply> {
|
||||
IPage<JjrApply> findPage(Page<JjrApply> page, @Param("params") JjrApply jjrApply);
|
||||
List<JjrApply> findList(JjrApply jjrApply);
|
||||
int add(JjrApply jjrApply);
|
||||
int update(JjrApply jjrApply);
|
||||
int approve(JjrApply jjrApply);
|
||||
IPage<JjrApply> findUserPage(Page<JjrApply> page, @Param("params") JjrApply jjrApply);
|
||||
int setRate(JjrApply jjrApply);
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package com.sqx.modules.bl.commission.jjr.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.sqx.modules.bl.commission.jjr.entity.JjrConfig;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface JjrConfigDao extends BaseMapper<JjrConfig> {
|
||||
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.sqx.modules.bl.commission.jjr.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.sqx.modules.bl.commission.jjr.entity.JjrApply;
|
||||
import com.sqx.modules.bl.commission.jjr.entity.JjrData;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface JjrDataDao extends BaseMapper<JjrData> {
|
||||
IPage<JjrData> findJjrPage(Page<JjrData> page, @Param("params") JjrData jjrData);
|
||||
JjrData getByCode(String invitationCode);
|
||||
void modifyJjr(JjrData jjrData);
|
||||
}
|
|
@ -0,0 +1,110 @@
|
|||
package com.sqx.modules.bl.commission.jjr.entity;
|
||||
|
||||
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 lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @description bl_jjr_apply
|
||||
* 经纪人申请表
|
||||
* @author caolei
|
||||
* @date 2024-08-03
|
||||
*/
|
||||
@Data
|
||||
@TableName("bl_jjr_apply")
|
||||
public class JjrApply implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
*用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
/**
|
||||
*姓名
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
*电话
|
||||
*/
|
||||
private String phone;
|
||||
/**
|
||||
*头像
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String avatar;
|
||||
/**
|
||||
*昵称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String userName;
|
||||
/**
|
||||
*邀请码
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String invitationCode;
|
||||
/**
|
||||
*备注
|
||||
*/
|
||||
private String remarks;
|
||||
/**
|
||||
*状态
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
*审批意见
|
||||
*/
|
||||
private String opinion;
|
||||
/**
|
||||
*创建时间
|
||||
*/
|
||||
private String createTime;
|
||||
/**
|
||||
*审批时间
|
||||
*/
|
||||
private String approveTime;
|
||||
/**
|
||||
*审批人
|
||||
*/
|
||||
private Long approveUser;
|
||||
/**
|
||||
*开始时间
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String startTime;
|
||||
/**
|
||||
*结束时间
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String endTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer page;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer limit;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer userPage;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer userLimit;
|
||||
|
||||
/**
|
||||
*比例
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private BigDecimal rate;
|
||||
|
||||
public JjrApply() {}
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
package com.sqx.modules.bl.commission.jjr.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @description bl_jjr_config
|
||||
* 经纪人配置表
|
||||
* @author caolei
|
||||
* @date 2024-08-03
|
||||
*/
|
||||
@Data
|
||||
@TableName("bl_jjr_config")
|
||||
public class JjrConfig implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
*是否启用 1启用 0关闭
|
||||
*/
|
||||
private Integer isOpen;
|
||||
/**
|
||||
*经纪人申请入口 1启用 0关闭
|
||||
*/
|
||||
private Integer isApply;
|
||||
/**
|
||||
*经纪人返佣 1固定返佣 2浮动比例提成
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
*经纪人返佣比例
|
||||
*/
|
||||
private BigDecimal rate;
|
||||
/**
|
||||
*技师承担
|
||||
*/
|
||||
private BigDecimal artificerRate;
|
||||
/**
|
||||
*代理商承担
|
||||
*/
|
||||
private BigDecimal agentRate;
|
||||
/**
|
||||
*邀请技师推广海报背景图
|
||||
*/
|
||||
private String artificerImage;
|
||||
/**
|
||||
*创建时间
|
||||
*/
|
||||
private String createTime;
|
||||
|
||||
public JjrConfig() {}
|
||||
}
|
|
@ -0,0 +1,92 @@
|
|||
package com.sqx.modules.bl.commission.jjr.entity;
|
||||
|
||||
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 lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @description bl_jjr_data
|
||||
* 经纪人数据
|
||||
* @author caolei
|
||||
* @date 2024-08-03
|
||||
*/
|
||||
@Data
|
||||
@TableName("bl_jjr_data")
|
||||
public class JjrData implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
*技师用户ID
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private Long artificerUserId;
|
||||
/**
|
||||
*经纪人用户ID
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private Long userId;
|
||||
/**
|
||||
*姓名
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String name;
|
||||
/**
|
||||
*电话
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String phone;
|
||||
/**
|
||||
*头像
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String avatar;
|
||||
/**
|
||||
*昵称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String userName;
|
||||
/**
|
||||
*邀请码
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String invitationCode;
|
||||
/**
|
||||
*备注
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String remarks;
|
||||
/**
|
||||
*状态
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private Integer status;
|
||||
/**
|
||||
*开始时间
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String startTime;
|
||||
/**
|
||||
*结束时间
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String endTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer page;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer limit;
|
||||
|
||||
public JjrData() {}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package com.sqx.modules.bl.commission.jjr.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.bl.commission.jjr.entity.JjrApply;
|
||||
|
||||
public interface JjrApplyService extends IService<JjrApply> {
|
||||
Result findPage(JjrApply jjrApply);
|
||||
int add(JjrApply jjrApply);
|
||||
int update(JjrApply jjrApply);
|
||||
void approve(JjrApply jjrApply);
|
||||
Result findUserPage(JjrApply jjrApply);
|
||||
void setJjrRate(JjrApply jjrApply);
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package com.sqx.modules.bl.commission.jjr.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.sqx.modules.bl.commission.jjr.entity.JjrConfig;
|
||||
|
||||
public interface JjrConfigService extends IService<JjrConfig> {
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package com.sqx.modules.bl.commission.jjr.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.bl.commission.jjr.entity.JjrData;
|
||||
|
||||
public interface JjrDataService extends IService<JjrData> {
|
||||
Result findJjrPage(JjrData jjrData);
|
||||
JjrData getByCode(String invitationCode);
|
||||
void modifyJjr(JjrData jjrData);
|
||||
}
|
|
@ -0,0 +1,84 @@
|
|||
package com.sqx.modules.bl.commission.jjr.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.bl.commission.jjr.dao.JjrApplyDao;
|
||||
import com.sqx.modules.bl.commission.jjr.entity.JjrApply;
|
||||
import com.sqx.modules.bl.commission.jjr.entity.JjrConfig;
|
||||
import com.sqx.modules.bl.commission.jjr.service.JjrApplyService;
|
||||
import com.sqx.modules.bl.commission.jjr.service.JjrConfigService;
|
||||
import com.sqx.modules.sys.entity.SysUserEntity;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class JjrApplyServiceImpl extends ServiceImpl<JjrApplyDao, JjrApply> implements JjrApplyService {
|
||||
|
||||
@Autowired
|
||||
private JjrConfigService configService;
|
||||
|
||||
@Override
|
||||
public Result findPage(JjrApply jjrApply){
|
||||
Page<JjrApply> pages=new Page<>(jjrApply.getPage(),jjrApply.getLimit());
|
||||
return Result.success().put("data",new PageUtils(baseMapper.findPage(pages,jjrApply)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int add(JjrApply jjrApply){
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
jjrApply.setCreateTime(sdf.format(new Date()));
|
||||
jjrApply.setStatus(0);
|
||||
return baseMapper.add(jjrApply);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(JjrApply jjrApply){
|
||||
return baseMapper.update(jjrApply);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void approve(JjrApply jjrApply){
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
jjrApply.setApproveTime(sdf.format(new Date()));
|
||||
jjrApply.setApproveUser(((SysUserEntity) SecurityUtils.getSubject().getPrincipal()).getUserId());
|
||||
baseMapper.approve(jjrApply);
|
||||
setJjrRate(jjrApply);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result findUserPage(JjrApply jjrApply){
|
||||
Page<JjrApply> pages=new Page<>(jjrApply.getUserPage(),jjrApply.getUserLimit());
|
||||
return Result.success().put("data",new PageUtils(baseMapper.findUserPage(pages,jjrApply)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setJjrRate(JjrApply jjrApply){
|
||||
JjrConfig jjrConfig = configService.getOne(new QueryWrapper<JjrConfig>());
|
||||
if(jjrConfig != null){
|
||||
if(jjrApply == null){
|
||||
List<JjrApply> list = baseMapper.findList(null);
|
||||
for(int i=0;i<list.size();i++){
|
||||
JjrApply entity = list.get(i);
|
||||
entity.setRate(jjrConfig.getRate());
|
||||
baseMapper.setRate(entity);
|
||||
}
|
||||
}else{
|
||||
JjrApply entity = baseMapper.selectById(jjrApply.getId());
|
||||
if(jjrApply.getStatus() == 1){
|
||||
entity.setRate(jjrConfig.getRate());
|
||||
}else if(jjrApply.getStatus() == 2){
|
||||
entity.setRate(BigDecimal.ZERO);
|
||||
}
|
||||
baseMapper.setRate(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package com.sqx.modules.bl.commission.jjr.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.sqx.modules.bl.commission.jjr.dao.JjrConfigDao;
|
||||
import com.sqx.modules.bl.commission.jjr.entity.JjrConfig;
|
||||
import com.sqx.modules.bl.commission.jjr.service.JjrConfigService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class JjrConfigServiceImpl extends ServiceImpl<JjrConfigDao, JjrConfig> implements JjrConfigService {
|
||||
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package com.sqx.modules.bl.commission.jjr.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.bl.commission.jjr.dao.JjrDataDao;
|
||||
import com.sqx.modules.bl.commission.jjr.entity.JjrApply;
|
||||
import com.sqx.modules.bl.commission.jjr.entity.JjrData;
|
||||
import com.sqx.modules.bl.commission.jjr.service.JjrDataService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class JjrDataServiceImpl extends ServiceImpl<JjrDataDao, JjrData> implements JjrDataService {
|
||||
|
||||
@Override
|
||||
public Result findJjrPage(JjrData jjrData){
|
||||
Page<JjrData> pages=new Page<>(jjrData.getPage(),jjrData.getLimit());
|
||||
return Result.success().put("data",new PageUtils(baseMapper.findJjrPage(pages,jjrData)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public JjrData getByCode(String invitationCode){
|
||||
return baseMapper.getByCode(invitationCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void modifyJjr(JjrData jjrData){
|
||||
baseMapper.modifyJjr(jjrData);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
package com.sqx.modules.bl.commission.ywy.controller;
|
||||
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.bl.commission.ywy.entity.YwyApply;
|
||||
import com.sqx.modules.bl.commission.ywy.service.YwyApplyService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/commission/ywyApply")
|
||||
@Api(value = "分佣管理", tags = {"业务员申请"})
|
||||
public class YwyApplyController {
|
||||
|
||||
@Autowired
|
||||
private YwyApplyService service;
|
||||
|
||||
@GetMapping("/findPage")
|
||||
@ApiOperation("查询(分页)")
|
||||
public Result findPage(YwyApply ywyApply){
|
||||
return service.findPage(ywyApply);
|
||||
}
|
||||
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("添加")
|
||||
public Result add(YwyApply ywyApply){
|
||||
service.add(ywyApply);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
@ApiOperation("修改")
|
||||
public Result update(YwyApply ywyApply){
|
||||
service.update(ywyApply);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@PostMapping("/delete")
|
||||
@ApiOperation("删除")
|
||||
public Result delete(YwyApply ywyApply){
|
||||
service.removeById(ywyApply.getId());
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@PostMapping("/approve")
|
||||
@ApiOperation("审批")
|
||||
public Result approve(YwyApply ywyApply){
|
||||
service.approve(ywyApply);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@GetMapping("/findUserPage")
|
||||
@ApiOperation("查询(分页)")
|
||||
public Result findUserPage(YwyApply ywyApply){
|
||||
return service.findUserPage(ywyApply);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
package com.sqx.modules.bl.commission.ywy.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.bl.commission.ywy.entity.YwyConfig;
|
||||
import com.sqx.modules.bl.commission.ywy.service.YwyConfigService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/commission/ywyConfig")
|
||||
@Api(value = "分佣管理", tags = {"业务员配置"})
|
||||
public class YwyConfigController {
|
||||
|
||||
@Autowired
|
||||
private YwyConfigService service;
|
||||
|
||||
@GetMapping("/info")
|
||||
@ApiOperation("查询业务员配置")
|
||||
public Result info(YwyConfig ywyConfig){
|
||||
YwyConfig entity = service.getById(ywyConfig);
|
||||
if(entity == null){
|
||||
entity = service.getOne(new QueryWrapper<YwyConfig>());
|
||||
}
|
||||
return Result.success().put("data",entity);
|
||||
}
|
||||
|
||||
@PostMapping("/save")
|
||||
@ApiOperation("添加业务员")
|
||||
public Result save(YwyConfig ywyConfig){
|
||||
YwyConfig entity = service.getById(ywyConfig);
|
||||
if(entity!=null){
|
||||
service.updateById(ywyConfig);
|
||||
}else{
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
ywyConfig.setCreateTime(sdf.format(new Date()));
|
||||
service.save(ywyConfig);
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package com.sqx.modules.bl.commission.ywy.controller.app;
|
||||
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.bl.commission.ywy.entity.YwyApply;
|
||||
import com.sqx.modules.bl.commission.ywy.service.YwyApplyService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/app/commission/ywy")
|
||||
@Api(value = "分佣管理", tags = {"业务员管理app"})
|
||||
public class AppYwyController {
|
||||
|
||||
@Autowired
|
||||
private YwyApplyService service;
|
||||
|
||||
@GetMapping("/apply")
|
||||
@ApiOperation("申请业务员")
|
||||
public Result apply(YwyApply ywyApply){
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
ywyApply.setCreateTime(sdf.format(new Date()));
|
||||
service.add(ywyApply);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.sqx.modules.bl.commission.ywy.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.sqx.modules.bl.commission.ywy.entity.YwyApply;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@Mapper
|
||||
public interface YwyApplyDao extends BaseMapper<YwyApply> {
|
||||
IPage<YwyApply> findPage(Page<YwyApply> page, @Param("params") YwyApply ywyApply);
|
||||
int add(YwyApply ywyApply);
|
||||
int update(YwyApply ywyApply);
|
||||
int approve(YwyApply ywyApply);
|
||||
IPage<YwyApply> findUserPage(Page<YwyApply> page, @Param("params") YwyApply ywyApply);
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package com.sqx.modules.bl.commission.ywy.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.sqx.modules.bl.commission.ywy.entity.YwyConfig;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface YwyConfigDao extends BaseMapper<YwyConfig> {
|
||||
|
||||
}
|
|
@ -0,0 +1,103 @@
|
|||
package com.sqx.modules.bl.commission.ywy.entity;
|
||||
|
||||
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 lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @description bl_ywy_apply
|
||||
* 业务员申请表
|
||||
* @author caolei
|
||||
* @date 2024-08-03
|
||||
*/
|
||||
@Data
|
||||
@TableName("bl_ywy_apply")
|
||||
public class YwyApply implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
*用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
/**
|
||||
*姓名
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
*电话
|
||||
*/
|
||||
private String phone;
|
||||
/**
|
||||
*头像
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String avatar;
|
||||
/**
|
||||
*昵称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String userName;
|
||||
/**
|
||||
*邀请码
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String invitationCode;
|
||||
/**
|
||||
*备注
|
||||
*/
|
||||
private String remarks;
|
||||
/**
|
||||
*状态
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
*审批意见
|
||||
*/
|
||||
private String opinion;
|
||||
/**
|
||||
*创建时间
|
||||
*/
|
||||
private String createTime;
|
||||
/**
|
||||
*审批时间
|
||||
*/
|
||||
private String approveTime;
|
||||
/**
|
||||
*审批人
|
||||
*/
|
||||
private Long approveUser;
|
||||
/**
|
||||
*开始时间
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String startTime;
|
||||
/**
|
||||
*结束时间
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String endTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer page;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer limit;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer userPage;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer userLimit;
|
||||
|
||||
public YwyApply() {}
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
package com.sqx.modules.bl.commission.ywy.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @description bl_ywy_config
|
||||
* 业务员配置表
|
||||
* @author caolei
|
||||
* @date 2024-08-03
|
||||
*/
|
||||
@Data
|
||||
@TableName("bl_ywy_config")
|
||||
public class YwyConfig implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
*是否启用 1启用 0关闭
|
||||
*/
|
||||
private Integer isOpen;
|
||||
/**
|
||||
*审核 1启用 0关闭
|
||||
*/
|
||||
private Integer isApprove;
|
||||
/**
|
||||
*业务员返佣
|
||||
*/
|
||||
private BigDecimal salesmanRate;
|
||||
/**
|
||||
*技师承担
|
||||
*/
|
||||
private BigDecimal artificerRate;
|
||||
/**
|
||||
*代理商承担
|
||||
*/
|
||||
private BigDecimal agentRate;
|
||||
/**
|
||||
*业务员与渠道商分佣方式
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
*邀请业务员推广海报背景图
|
||||
*/
|
||||
private String salesmanImage;
|
||||
/**
|
||||
*创建时间
|
||||
*/
|
||||
private String createTime;
|
||||
|
||||
public YwyConfig() {}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package com.sqx.modules.bl.commission.ywy.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.bl.commission.ywy.entity.YwyApply;
|
||||
|
||||
public interface YwyApplyService extends IService<YwyApply> {
|
||||
Result findPage(YwyApply ywyApply);
|
||||
int add(YwyApply ywyApply);
|
||||
int update(YwyApply ywyApply);
|
||||
int approve(YwyApply ywyApply);
|
||||
Result findUserPage(YwyApply ywyApply);
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package com.sqx.modules.bl.commission.ywy.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.sqx.modules.bl.commission.ywy.entity.YwyConfig;
|
||||
|
||||
public interface YwyConfigService extends IService<YwyConfig> {
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
package com.sqx.modules.bl.commission.ywy.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.bl.commission.ywy.dao.YwyApplyDao;
|
||||
import com.sqx.modules.bl.commission.ywy.entity.YwyApply;
|
||||
import com.sqx.modules.bl.commission.ywy.service.YwyApplyService;
|
||||
import com.sqx.modules.sys.entity.SysUserEntity;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
@Service
|
||||
public class YwyApplyServiceImpl extends ServiceImpl<YwyApplyDao, YwyApply> implements YwyApplyService {
|
||||
|
||||
@Override
|
||||
public Result findPage(YwyApply ywyApply){
|
||||
Page<YwyApply> pages=new Page<>(ywyApply.getPage(),ywyApply.getLimit());
|
||||
return Result.success().put("data",new PageUtils(baseMapper.findPage(pages,ywyApply)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int add(YwyApply ywyApply){
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
ywyApply.setCreateTime(sdf.format(new Date()));
|
||||
ywyApply.setStatus(0);
|
||||
return baseMapper.add(ywyApply);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(YwyApply ywyApply){
|
||||
return baseMapper.update(ywyApply);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int approve(YwyApply ywyApply){
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
ywyApply.setApproveTime(sdf.format(new Date()));
|
||||
ywyApply.setApproveUser(((SysUserEntity) SecurityUtils.getSubject().getPrincipal()).getUserId());
|
||||
return baseMapper.approve(ywyApply);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result findUserPage(YwyApply ywyApply){
|
||||
Page<YwyApply> pages=new Page<>(ywyApply.getUserPage(),ywyApply.getUserLimit());
|
||||
return Result.success().put("data",new PageUtils(baseMapper.findUserPage(pages,ywyApply)));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package com.sqx.modules.bl.commission.ywy.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.sqx.modules.bl.commission.ywy.dao.YwyConfigDao;
|
||||
import com.sqx.modules.bl.commission.ywy.entity.YwyConfig;
|
||||
import com.sqx.modules.bl.commission.ywy.service.YwyConfigService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class YwyConfigServiceImpl extends ServiceImpl<YwyConfigDao, YwyConfig> implements YwyConfigService {
|
||||
|
||||
}
|
|
@ -48,7 +48,9 @@
|
|||
and a.longitude is not null and a.latitude is not null
|
||||
</if>
|
||||
) b
|
||||
where distance <= 5000
|
||||
<if test="isBack==null or isBack==''">
|
||||
where distance <= 5000
|
||||
</if>
|
||||
<if test="by!=null and by==1">
|
||||
order by
|
||||
<if test="status!=null and status==-1">
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
<?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.sqx.modules.bl.commission.fxy.dao.FxyApplyDao">
|
||||
|
||||
<select id="findPage" resultType="com.sqx.modules.bl.commission.fxy.entity.FxyApply">
|
||||
select a.id,a.user_id,b.avatar,b.user_name,a.name,a.phone,a.remarks,a.create_time,a.status,a.opinion
|
||||
from bl_fxy_apply a
|
||||
inner join tb_user b on a.user_id = b.user_id
|
||||
where 1=1
|
||||
<if test="params.status!=null">
|
||||
and a.status=#{params.status}
|
||||
</if>
|
||||
<if test="params.name!=null and params.name!=''">
|
||||
and a.name like concat('%',#{params.name},'%')
|
||||
</if>
|
||||
<if test="params.phone!=null and params.phone!=''">
|
||||
and a.phone like concat('%',#{params.phone},'%')
|
||||
</if>
|
||||
<if test="params.startTime!=null and params.startTime!=''">
|
||||
and a.create_time >= #{params.startTime}
|
||||
</if>
|
||||
<if test="params.endTime!=null and params.endTime!=''">
|
||||
and a.create_time <= #{params.endTime}
|
||||
</if>
|
||||
order by id desc
|
||||
</select>
|
||||
|
||||
<insert id="add" useGeneratedKeys="true" keyProperty="id" parameterType="com.sqx.modules.bl.commission.fxy.entity.FxyApply">
|
||||
insert into bl_fxy_apply(user_id,name,phone,remarks,create_time)
|
||||
values(#{userId},#{name},#{phone},#{remarks},#{createTime})
|
||||
</insert>
|
||||
|
||||
<update id="update" parameterType="com.sqx.modules.bl.commission.fxy.entity.FxyApply">
|
||||
update bl_fxy_apply
|
||||
set
|
||||
user_id=#{userId},
|
||||
name=#{name},
|
||||
phone=#{phone},
|
||||
remarks=#{remarks}
|
||||
where id=#{id}
|
||||
</update>
|
||||
|
||||
<update id="approve" parameterType="com.sqx.modules.bl.commission.fxy.entity.FxyApply">
|
||||
update bl_fxy_apply
|
||||
set status=#{status},
|
||||
opinion=#{opinion},
|
||||
approve_time=#{approveTime},
|
||||
approve_user=#{approveUser}
|
||||
where id=#{id}
|
||||
</update>
|
||||
|
||||
<select id="findUserPage" resultType="com.sqx.modules.bl.commission.fxy.entity.FxyApply">
|
||||
select b.user_id,b.avatar,b.user_name,b.phone,b.invitation_code
|
||||
from tb_user b
|
||||
where b.status = 1
|
||||
and b.user_id not in (
|
||||
select a.user_id
|
||||
from bl_fxy_apply a
|
||||
where a.status != 2
|
||||
)
|
||||
<if test="params.userName!=null and params.userName!=''">
|
||||
and b.user_name like concat('%',#{params.userName},'%')
|
||||
</if>
|
||||
<if test="params.phone!=null and params.phone!=''">
|
||||
and b.phone like concat('%',#{params.phone},'%')
|
||||
</if>
|
||||
<if test="params.invitationCode!=null and params.invitationCode!=''">
|
||||
and b.invitation_code like concat('%',#{params.invitationCode},'%')
|
||||
</if>
|
||||
order by b.user_id
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,88 @@
|
|||
<?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.sqx.modules.bl.commission.jjr.dao.JjrApplyDao">
|
||||
|
||||
<select id="findPage" resultType="com.sqx.modules.bl.commission.jjr.entity.JjrApply">
|
||||
select a.id,a.user_id,b.avatar,b.user_name,a.name,a.phone,a.remarks,a.create_time,a.status,a.opinion
|
||||
from bl_jjr_apply a
|
||||
inner join tb_user b on a.user_id = b.user_id
|
||||
where 1=1
|
||||
<if test="params.status!=null">
|
||||
and a.status=#{params.status}
|
||||
</if>
|
||||
<if test="params.name!=null and params.name!=''">
|
||||
and a.name like concat('%',#{params.name},'%')
|
||||
</if>
|
||||
<if test="params.phone!=null and params.phone!=''">
|
||||
and a.phone like concat('%',#{params.phone},'%')
|
||||
</if>
|
||||
<if test="params.startTime!=null and params.startTime!=''">
|
||||
and a.create_time >= #{params.startTime}
|
||||
</if>
|
||||
<if test="params.endTime!=null and params.endTime!=''">
|
||||
and a.create_time <= #{params.endTime}
|
||||
</if>
|
||||
order by id desc
|
||||
</select>
|
||||
|
||||
<select id="findList" resultType="com.sqx.modules.bl.commission.jjr.entity.JjrApply">
|
||||
select a.id,a.user_id,b.avatar,b.user_name,a.name,a.phone,a.remarks,a.create_time,a.status,a.opinion,b.invitation_code
|
||||
from bl_jjr_apply a
|
||||
inner join tb_user b on a.user_id = b.user_id
|
||||
where a.status = 1
|
||||
order by id desc
|
||||
</select>
|
||||
|
||||
<insert id="add" useGeneratedKeys="true" keyProperty="id" parameterType="com.sqx.modules.bl.commission.jjr.entity.JjrApply">
|
||||
insert into bl_jjr_apply(user_id,name,phone,remarks,create_time,status)
|
||||
values(#{userId},#{name},#{phone},#{remarks},#{createTime},0)
|
||||
</insert>
|
||||
|
||||
<update id="update" parameterType="com.sqx.modules.bl.commission.jjr.entity.JjrApply">
|
||||
update bl_jjr_apply
|
||||
set
|
||||
user_id=#{userId},
|
||||
name=#{name},
|
||||
phone=#{phone},
|
||||
remarks=#{remarks}
|
||||
where id=#{id}
|
||||
</update>
|
||||
|
||||
<update id="approve" parameterType="com.sqx.modules.bl.commission.jjr.entity.JjrApply">
|
||||
update bl_jjr_apply
|
||||
set status=#{status},
|
||||
opinion=#{opinion},
|
||||
approve_time=#{approveTime},
|
||||
approve_user=#{approveUser}
|
||||
where id=#{id}
|
||||
</update>
|
||||
|
||||
<select id="findUserPage" resultType="com.sqx.modules.bl.commission.jjr.entity.JjrApply">
|
||||
select b.user_id,b.avatar,b.user_name,b.phone,b.invitation_code
|
||||
from tb_user b
|
||||
where b.status = 1
|
||||
and b.user_id not in (
|
||||
select a.user_id
|
||||
from bl_jjr_apply a
|
||||
where a.status != 2
|
||||
)
|
||||
<if test="params.userName!=null and params.userName!=''">
|
||||
and b.user_name like concat('%',#{params.userName},'%')
|
||||
</if>
|
||||
<if test="params.phone!=null and params.phone!=''">
|
||||
and b.phone like concat('%',#{params.phone},'%')
|
||||
</if>
|
||||
<if test="params.invitationCode!=null and params.invitationCode!=''">
|
||||
and b.invitation_code like concat('%',#{params.invitationCode},'%')
|
||||
</if>
|
||||
order by b.user_id
|
||||
</select>
|
||||
|
||||
<update id="setRate" parameterType="com.sqx.modules.bl.commission.jjr.entity.JjrApply">
|
||||
update tb_user
|
||||
set shop_rate=#{rate}
|
||||
where user_id=#{userId}
|
||||
</update>
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,39 @@
|
|||
<?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.sqx.modules.bl.commission.jjr.dao.JjrDataDao">
|
||||
|
||||
<select id="findJjrPage" resultType="com.sqx.modules.bl.commission.jjr.entity.JjrData">
|
||||
select a.id,a.user_id,b.avatar,b.user_name,a.name,a.phone,a.remarks,a.create_time,a.status,a.opinion
|
||||
from bl_jjr_apply a
|
||||
inner join tb_user b on a.user_id = b.user_id
|
||||
where a.status= 1
|
||||
<if test="params.name!=null and params.name!=''">
|
||||
and a.name like concat('%',#{params.name},'%')
|
||||
</if>
|
||||
<if test="params.phone!=null and params.phone!=''">
|
||||
and a.phone like concat('%',#{params.phone},'%')
|
||||
</if>
|
||||
<if test="params.startTime!=null and params.startTime!=''">
|
||||
and a.create_time >= #{params.startTime}
|
||||
</if>
|
||||
<if test="params.endTime!=null and params.endTime!=''">
|
||||
and a.create_time <= #{params.endTime}
|
||||
</if>
|
||||
order by id desc
|
||||
</select>
|
||||
|
||||
<select id="getByCode" resultType="com.sqx.modules.bl.commission.jjr.entity.JjrData">
|
||||
select a.id,a.user_id,b.avatar,b.user_name,a.name,a.phone,a.remarks,a.create_time,a.status,a.opinion
|
||||
from bl_jjr_apply a
|
||||
inner join tb_user b on a.user_id = b.user_id
|
||||
where b.invitation_code= #{invitationCode}
|
||||
</select>
|
||||
|
||||
<update id="modifyJjr" parameterType="com.sqx.modules.bl.commission.jjr.entity.JjrApply">
|
||||
update tb_user
|
||||
set bl_jjr_code=#{invitationCode}
|
||||
where user_id=#{artificerUserId}
|
||||
</update>
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,74 @@
|
|||
<?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.sqx.modules.bl.commission.ywy.dao.YwyApplyDao">
|
||||
|
||||
<select id="findPage" resultType="com.sqx.modules.bl.commission.ywy.entity.YwyApply">
|
||||
select a.id,a.user_id,b.avatar,b.user_name,a.name,a.phone,a.remarks,a.create_time,a.status,a.opinion
|
||||
from bl_ywy_apply a
|
||||
inner join tb_user b on a.user_id = b.user_id
|
||||
where 1=1
|
||||
<if test="params.status!=null">
|
||||
and a.status=#{params.status}
|
||||
</if>
|
||||
<if test="params.name!=null and params.name!=''">
|
||||
and a.name like concat('%',#{params.name},'%')
|
||||
</if>
|
||||
<if test="params.phone!=null and params.phone!=''">
|
||||
and a.phone like concat('%',#{params.phone},'%')
|
||||
</if>
|
||||
<if test="params.startTime!=null and params.startTime!=''">
|
||||
and a.create_time >= #{params.startTime}
|
||||
</if>
|
||||
<if test="params.endTime!=null and params.endTime!=''">
|
||||
and a.create_time <= #{params.endTime}
|
||||
</if>
|
||||
order by id desc
|
||||
</select>
|
||||
|
||||
<insert id="add" useGeneratedKeys="true" keyProperty="id" parameterType="com.sqx.modules.bl.commission.ywy.entity.YwyApply">
|
||||
insert into bl_ywy_apply(user_id,name,phone,remarks,create_time,status)
|
||||
values(#{userId},#{name},#{phone},#{remarks},#{createTime},0)
|
||||
</insert>
|
||||
|
||||
<update id="update" parameterType="com.sqx.modules.bl.commission.ywy.entity.YwyApply">
|
||||
update bl_ywy_apply
|
||||
set
|
||||
user_id=#{userId},
|
||||
name=#{name},
|
||||
phone=#{phone},
|
||||
remarks=#{remarks}
|
||||
where id=#{id}
|
||||
</update>
|
||||
|
||||
<update id="approve" parameterType="com.sqx.modules.bl.commission.ywy.entity.YwyApply">
|
||||
update bl_ywy_apply
|
||||
set status=#{status},
|
||||
opinion=#{opinion},
|
||||
approve_time=#{approveTime},
|
||||
approve_user=#{approveUser}
|
||||
where id=#{id}
|
||||
</update>
|
||||
|
||||
<select id="findUserPage" resultType="com.sqx.modules.bl.commission.ywy.entity.YwyApply">
|
||||
select b.user_id,b.avatar,b.user_name,b.phone,b.invitation_code
|
||||
from tb_user b
|
||||
where b.status = 1
|
||||
and b.user_id not in (
|
||||
select a.user_id
|
||||
from bl_ywy_apply a
|
||||
where a.status != 2
|
||||
)
|
||||
<if test="params.userName!=null and params.userName!=''">
|
||||
and b.user_name like concat('%',#{params.userName},'%')
|
||||
</if>
|
||||
<if test="params.phone!=null and params.phone!=''">
|
||||
and b.phone like concat('%',#{params.phone},'%')
|
||||
</if>
|
||||
<if test="params.invitationCode!=null and params.invitationCode!=''">
|
||||
and b.invitation_code like concat('%',#{params.invitationCode},'%')
|
||||
</if>
|
||||
order by b.user_id
|
||||
</select>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue