1.1版本
增加分销商
This commit is contained in:
parent
d4a759339a
commit
0163f85aa1
@ -0,0 +1,175 @@
|
||||
package com.ruoyi.system.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Anonymous;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.domain.BsDistribution;
|
||||
import com.ruoyi.system.domain.vo.BsDistributionVO;
|
||||
import com.ruoyi.system.service.IBsDistributionService;
|
||||
import com.ruoyi.system.service.ISysDeptService;
|
||||
import com.ruoyi.system.service.ISysRoleService;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 分销商信息Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-11-18
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/distribution")
|
||||
public class BsDistributionController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IBsDistributionService bsDistributionService;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService userService;
|
||||
|
||||
@Autowired
|
||||
private ISysRoleService roleService;
|
||||
|
||||
@Autowired
|
||||
private ISysDeptService deptService;
|
||||
|
||||
/**
|
||||
* 查询分销商信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:distribution:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BsDistribution bsDistribution)
|
||||
{
|
||||
startPage();
|
||||
List<BsDistribution> list = bsDistributionService.selectBsDistributionList(bsDistribution);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出分销商信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:distribution:export')")
|
||||
@Log(title = "分销商信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BsDistribution bsDistribution)
|
||||
{
|
||||
List<BsDistribution> list = bsDistributionService.selectBsDistributionList(bsDistribution);
|
||||
ExcelUtil<BsDistribution> util = new ExcelUtil<BsDistribution>(BsDistribution.class);
|
||||
util.exportExcel(response, list, "分销商信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分销商信息详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:distribution:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(bsDistributionService.selectBsDistributionById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增分销商信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:distribution:add')")
|
||||
@Log(title = "分销商信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BsDistribution bsDistribution)
|
||||
{
|
||||
SysUser sysUser = new SysUser();
|
||||
Long[] ids = {101L};
|
||||
sysUser.setDeptId(200L);
|
||||
sysUser.setNickName(bsDistribution.getName());
|
||||
sysUser.setPassword("123456");
|
||||
sysUser.setPhonenumber(bsDistribution.getPhone());
|
||||
sysUser.setUserName(bsDistribution.getPhone());
|
||||
sysUser.setRoleIds(ids);
|
||||
|
||||
deptService.checkDeptDataScope(sysUser.getDeptId());
|
||||
roleService.checkRoleDataScope(sysUser.getRoleIds());
|
||||
if (!userService.checkUserNameUnique(sysUser))
|
||||
{
|
||||
return error("新增用户'" + sysUser.getUserName() + "'失败,登录账号已存在");
|
||||
}
|
||||
else if (StringUtils.isNotEmpty(sysUser.getPhonenumber()) && !userService.checkPhoneUnique(sysUser))
|
||||
{
|
||||
return error("新增用户'" + sysUser.getUserName() + "'失败,手机号码已存在");
|
||||
}
|
||||
else if (StringUtils.isNotEmpty(sysUser.getEmail()) && !userService.checkEmailUnique(sysUser))
|
||||
{
|
||||
return error("新增用户'" + sysUser.getUserName() + "'失败,邮箱账号已存在");
|
||||
}
|
||||
sysUser.setCreateBy(getUsername());
|
||||
sysUser.setPassword(SecurityUtils.encryptPassword(sysUser.getPassword()));
|
||||
userService.insertUser(sysUser);
|
||||
|
||||
return toAjax(bsDistributionService.insertBsDistribution(bsDistribution));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改分销商信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:distribution:edit')")
|
||||
@Log(title = "分销商信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BsDistribution bsDistribution)
|
||||
{
|
||||
return toAjax(bsDistributionService.updateBsDistribution(bsDistribution));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除分销商信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:distribution:remove')")
|
||||
@Log(title = "分销商信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
List<Long> sysUserId = bsDistributionService.getSysUserId(ids);
|
||||
Long[] array = sysUserId.toArray(new Long[0]);
|
||||
if (ArrayUtils.contains(array, getUserId())) {
|
||||
return error("当前用户不能删除");
|
||||
}
|
||||
userService.deleteUserByIds(array);
|
||||
return toAjax(bsDistributionService.deleteBsDistributionByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单信息
|
||||
*/
|
||||
@GetMapping("disAllOrder")
|
||||
public TableDataInfo disAllOrder(BsDistribution bsDistribution)
|
||||
{
|
||||
startPage();
|
||||
List<BsDistributionVO> list = bsDistributionService.disAllOrder(bsDistribution);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分销商信息
|
||||
*/
|
||||
@GetMapping("/getDisMsg")
|
||||
public AjaxResult getDisMsg()
|
||||
{
|
||||
String phone = getLoginUser().getUser().getPhonenumber();
|
||||
BsDistribution bsDistribution = bsDistributionService.selectOneMsg(phone);
|
||||
if(bsDistribution == null){
|
||||
return success("");
|
||||
}
|
||||
return success(bsDistribution.getId());
|
||||
}
|
||||
|
||||
}
|
@ -1,7 +1,13 @@
|
||||
package com.ruoyi.system.controller;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ruoyi.system.domain.BsDistribution;
|
||||
import com.ruoyi.system.domain.dto.BsOrderDTO;
|
||||
import com.ruoyi.system.domain.vo.BsOrdersVO;
|
||||
import com.ruoyi.system.service.IBsDistributionService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@ -34,6 +40,9 @@ public class BsOrderController extends BaseController
|
||||
@Autowired
|
||||
private IBsOrderService bsOrderService;
|
||||
|
||||
@Autowired
|
||||
private IBsDistributionService bsDistributionService;
|
||||
|
||||
/**
|
||||
* 查询订单列表
|
||||
*/
|
||||
@ -131,4 +140,31 @@ public class BsOrderController extends BaseController
|
||||
{
|
||||
return success(bsOrderService.userGetOrder(orderNo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单信息(包含分销商信息)
|
||||
*/
|
||||
@GetMapping("/allOrderList")
|
||||
public TableDataInfo allOrderList(BsOrderDTO bsOrderDTO)
|
||||
{
|
||||
startPage();
|
||||
List<BsOrdersVO> list = bsOrderService.selectAllList(bsOrderDTO);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分销商查询订单信息
|
||||
*/
|
||||
@GetMapping("/distributionOrder")
|
||||
public TableDataInfo distributionGetOrder(){
|
||||
String phonenumber = getLoginUser().getUser().getPhonenumber();
|
||||
BsDistribution bsDistribution = bsDistributionService.selectOneMsg(phonenumber);
|
||||
if (bsDistribution == null) {
|
||||
// 返回空数据,或者可以返回一个特定的错误信息
|
||||
return getDataTable(Collections.emptyList());
|
||||
}
|
||||
Long id = bsDistribution.getId();
|
||||
List<BsOrdersVO> list = bsOrderService.distributionGetOrder(id.intValue());
|
||||
return getDataTable(list);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,94 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 分销商信息对象 bs_distribution
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-11-18
|
||||
*/
|
||||
public class BsDistribution extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键id */
|
||||
private Long id;
|
||||
|
||||
/** 姓名 */
|
||||
@Excel(name = "姓名")
|
||||
private String name;
|
||||
|
||||
/** 联系方式 */
|
||||
@Excel(name = "联系方式")
|
||||
private String phone;
|
||||
|
||||
/** 来源 */
|
||||
@Excel(name = "来源")
|
||||
private String source;
|
||||
|
||||
/** 提成 */
|
||||
@Excel(name = "提成")
|
||||
private Long commission;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setPhone(String phone)
|
||||
{
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getPhone()
|
||||
{
|
||||
return phone;
|
||||
}
|
||||
public void setSource(String source)
|
||||
{
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public String getSource()
|
||||
{
|
||||
return source;
|
||||
}
|
||||
public void setCommission(Long commission)
|
||||
{
|
||||
this.commission = commission;
|
||||
}
|
||||
|
||||
public Long getCommission()
|
||||
{
|
||||
return commission;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("name", getName())
|
||||
.append("phone", getPhone())
|
||||
.append("source", getSource())
|
||||
.append("remark", getRemark())
|
||||
.append("commission", getCommission())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -2,6 +2,7 @@ package com.ruoyi.system.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
@ -14,129 +15,149 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
||||
* @author ruoyi
|
||||
* @date 2024-10-25
|
||||
*/
|
||||
public class BsOrder extends BaseEntity
|
||||
{
|
||||
public class BsOrder extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/** 商户单号 */
|
||||
/**
|
||||
* 商户单号
|
||||
*/
|
||||
@Excel(name = "商户单号")
|
||||
private String orderNo;
|
||||
|
||||
/** 订单号 */
|
||||
/**
|
||||
* 订单号
|
||||
*/
|
||||
@Excel(name = "交易流水号")
|
||||
private String transactionId;
|
||||
|
||||
/** 1:微信,2:支付宝 */
|
||||
/**
|
||||
* 1:微信,2:支付宝
|
||||
*/
|
||||
@Excel(name = "1:微信,2:支付宝")
|
||||
private Long channel;
|
||||
|
||||
/** 支付时间 */
|
||||
/**
|
||||
* 支付时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "支付时间", width = 50, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date payTime;
|
||||
|
||||
/** 创建时间 */
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "创建时间", width = 50, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
/** 商品名称 */
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
@Excel(name = "商品名称")
|
||||
private String goodsName;
|
||||
|
||||
/** 商品id */
|
||||
/**
|
||||
* 商品id
|
||||
*/
|
||||
@Excel(name = "商品id")
|
||||
private Long goodsmin;
|
||||
|
||||
/** 订单价格 */
|
||||
/**
|
||||
* 订单价格
|
||||
*/
|
||||
@Excel(name = "订单价格")
|
||||
private BigDecimal price;
|
||||
|
||||
/** 购买人id */
|
||||
/**
|
||||
* 购买人id
|
||||
*/
|
||||
@Excel(name = "购买人id")
|
||||
private String createId;
|
||||
|
||||
/** 支付状态 */
|
||||
/**
|
||||
* 支付状态
|
||||
*/
|
||||
@Excel(name = "支付状态")
|
||||
private int payStatus;
|
||||
|
||||
/** 购买人openid */
|
||||
/**
|
||||
* 购买人openid
|
||||
*/
|
||||
@Excel(name = "购买人openid")
|
||||
private String openid;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
/**
|
||||
* 分销商id
|
||||
*/
|
||||
@Excel(name = "分销商id")
|
||||
private int distributor;
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
public void setOrderNo(String orderNo)
|
||||
{
|
||||
|
||||
public void setOrderNo(String orderNo) {
|
||||
this.orderNo = orderNo;
|
||||
}
|
||||
|
||||
public String getOrderNo()
|
||||
{
|
||||
public String getOrderNo() {
|
||||
return orderNo;
|
||||
}
|
||||
public void setChannel(Long channel)
|
||||
{
|
||||
|
||||
public void setChannel(Long channel) {
|
||||
this.channel = channel;
|
||||
}
|
||||
|
||||
public Long getChannel()
|
||||
{
|
||||
public Long getChannel() {
|
||||
return channel;
|
||||
}
|
||||
public void setPayTime(Date payTime)
|
||||
{
|
||||
|
||||
public void setPayTime(Date payTime) {
|
||||
this.payTime = payTime;
|
||||
}
|
||||
|
||||
public Date getPayTime()
|
||||
{
|
||||
public Date getPayTime() {
|
||||
return payTime;
|
||||
}
|
||||
public void setGoodsName(String goodsName)
|
||||
{
|
||||
|
||||
public void setGoodsName(String goodsName) {
|
||||
this.goodsName = goodsName;
|
||||
}
|
||||
|
||||
public String getGoodsName()
|
||||
{
|
||||
public String getGoodsName() {
|
||||
return goodsName;
|
||||
}
|
||||
public void setGoodsmin(Long goodsmin)
|
||||
{
|
||||
|
||||
public void setGoodsmin(Long goodsmin) {
|
||||
this.goodsmin = goodsmin;
|
||||
}
|
||||
|
||||
public Long getGoodsmin()
|
||||
{
|
||||
public Long getGoodsmin() {
|
||||
return goodsmin;
|
||||
}
|
||||
public void setPrice(BigDecimal price)
|
||||
{
|
||||
|
||||
public void setPrice(BigDecimal price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public BigDecimal getPrice()
|
||||
{
|
||||
public BigDecimal getPrice() {
|
||||
return price;
|
||||
}
|
||||
public void setCreateId(String createId)
|
||||
{
|
||||
|
||||
public void setCreateId(String createId) {
|
||||
this.createId = createId;
|
||||
}
|
||||
|
||||
public String getCreateId()
|
||||
{
|
||||
public String getCreateId() {
|
||||
return createId;
|
||||
}
|
||||
|
||||
@ -174,21 +195,30 @@ public class BsOrder extends BaseEntity
|
||||
this.openid = openid;
|
||||
}
|
||||
|
||||
public int getDistributor() {
|
||||
return distributor;
|
||||
}
|
||||
|
||||
public void setDistributor(int distributor) {
|
||||
this.distributor = distributor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("orderNo", getOrderNo())
|
||||
.append("channel", getChannel())
|
||||
.append("payTime", getPayTime())
|
||||
.append("goodsName", getGoodsName())
|
||||
.append("goodsmin", getGoodsmin())
|
||||
.append("price", getPrice())
|
||||
.append("createId", getCreateId())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("payStatus", getPayStatus())
|
||||
.append("openid", getOpenid())
|
||||
.append("transactionId", getTransactionId())
|
||||
.toString();
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("orderNo", getOrderNo())
|
||||
.append("channel", getChannel())
|
||||
.append("payTime", getPayTime())
|
||||
.append("goodsName", getGoodsName())
|
||||
.append("goodsmin", getGoodsmin())
|
||||
.append("price", getPrice())
|
||||
.append("createId", getCreateId())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("payStatus", getPayStatus())
|
||||
.append("openid", getOpenid())
|
||||
.append("transactionId", getTransactionId())
|
||||
.append("distributor", getDistributor())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,27 @@
|
||||
package com.ruoyi.system.domain.dto;
|
||||
|
||||
import com.ruoyi.system.domain.BsOrder;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class BsOrderDTO extends BsOrder {
|
||||
|
||||
/**
|
||||
* 分销商姓名
|
||||
*/
|
||||
private String distributionName;
|
||||
|
||||
/**
|
||||
* 分销商联系方式
|
||||
*/
|
||||
private String distributionPhone;
|
||||
|
||||
/**
|
||||
* 分销商distributionId
|
||||
*/
|
||||
private Long distributionId;
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.ruoyi.system.domain.vo;
|
||||
|
||||
import com.ruoyi.system.domain.BsDistribution;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class BsDistributionVO extends BsDistribution {
|
||||
|
||||
private int allOrderCount;
|
||||
|
||||
private int monthOrderCount;
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.ruoyi.system.domain.vo;
|
||||
|
||||
import com.ruoyi.system.domain.BsOrder;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class BsOrdersVO extends BsOrder {
|
||||
|
||||
/**
|
||||
* 分销商姓名
|
||||
*/
|
||||
private String distributionName;
|
||||
|
||||
/**
|
||||
* 分销商联系方式
|
||||
*/
|
||||
private String distributionPhone;
|
||||
|
||||
/**
|
||||
* 分销商distributionId
|
||||
*/
|
||||
private Long distributionId;
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import com.ruoyi.system.domain.BsDistribution;
|
||||
import com.ruoyi.system.domain.vo.BsDistributionVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 分销商信息Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-11-18
|
||||
*/
|
||||
public interface BsDistributionMapper
|
||||
{
|
||||
/**
|
||||
* 查询分销商信息
|
||||
*
|
||||
* @param id 分销商信息主键
|
||||
* @return 分销商信息
|
||||
*/
|
||||
public BsDistribution selectBsDistributionById(Long id);
|
||||
|
||||
/**
|
||||
* 查询分销商信息列表
|
||||
*
|
||||
* @param bsDistribution 分销商信息
|
||||
* @return 分销商信息集合
|
||||
*/
|
||||
public List<BsDistribution> selectBsDistributionList(BsDistribution bsDistribution);
|
||||
|
||||
/**
|
||||
* 新增分销商信息
|
||||
*
|
||||
* @param bsDistribution 分销商信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBsDistribution(BsDistribution bsDistribution);
|
||||
|
||||
/**
|
||||
* 修改分销商信息
|
||||
*
|
||||
* @param bsDistribution 分销商信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBsDistribution(BsDistribution bsDistribution);
|
||||
|
||||
/**
|
||||
* 删除分销商信息
|
||||
*
|
||||
* @param id 分销商信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBsDistributionById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除分销商信息
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBsDistributionByIds(Long[] ids);
|
||||
|
||||
|
||||
/**
|
||||
* 根据手机号查询分销商信息
|
||||
*/
|
||||
public BsDistribution selectOneMsg(String phone);
|
||||
|
||||
/**
|
||||
* 查询分销商所有订单信息
|
||||
*/
|
||||
public List<BsDistributionVO> disAllOrder(BsDistribution bsDistribution);
|
||||
|
||||
/**
|
||||
* 根据手机号查询分销商信息是否存在
|
||||
*/
|
||||
public boolean existsByPhone(@Param("phone") String phone, @Param("id") Long id);
|
||||
|
||||
/**
|
||||
* 联合删除用户信息
|
||||
*/
|
||||
public List<Long> getSysUserId(Long[] ids);
|
||||
}
|
@ -2,6 +2,8 @@ package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.BsOrder;
|
||||
import com.ruoyi.system.domain.dto.BsOrderDTO;
|
||||
import com.ruoyi.system.domain.vo.BsOrdersVO;
|
||||
|
||||
/**
|
||||
* 订单Mapper接口
|
||||
@ -82,4 +84,14 @@ public interface BsOrderMapper
|
||||
* @return 结果
|
||||
*/
|
||||
public BsOrder userGetOrder(String orderNo);
|
||||
|
||||
/**
|
||||
* 所有分销商订单
|
||||
*/
|
||||
public List<BsOrdersVO> getAllOrder(BsOrderDTO bsOrderDTO);
|
||||
|
||||
/**
|
||||
* 分销商查询订单
|
||||
*/
|
||||
public List<BsOrdersVO> distributionGetOrder(int distributorId);
|
||||
}
|
||||
|
@ -0,0 +1,83 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import com.ruoyi.system.domain.BsDistribution;
|
||||
import com.ruoyi.system.domain.vo.BsDistributionVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 分销商信息Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-11-18
|
||||
*/
|
||||
public interface IBsDistributionService
|
||||
{
|
||||
/**
|
||||
* 查询分销商信息
|
||||
*
|
||||
* @param id 分销商信息主键
|
||||
* @return 分销商信息
|
||||
*/
|
||||
public BsDistribution selectBsDistributionById(Long id);
|
||||
|
||||
/**
|
||||
* 查询分销商信息列表
|
||||
*
|
||||
* @param bsDistribution 分销商信息
|
||||
* @return 分销商信息集合
|
||||
*/
|
||||
public List<BsDistribution> selectBsDistributionList(BsDistribution bsDistribution);
|
||||
|
||||
/**
|
||||
* 新增分销商信息
|
||||
*
|
||||
* @param bsDistribution 分销商信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBsDistribution(BsDistribution bsDistribution);
|
||||
|
||||
/**
|
||||
* 修改分销商信息
|
||||
*
|
||||
* @param bsDistribution 分销商信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBsDistribution(BsDistribution bsDistribution);
|
||||
|
||||
/**
|
||||
* 批量删除分销商信息
|
||||
*
|
||||
* @param ids 需要删除的分销商信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBsDistributionByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除分销商信息信息
|
||||
*
|
||||
* @param id 分销商信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBsDistributionById(Long id);
|
||||
|
||||
/**
|
||||
* 根据手机号查询分销商信息
|
||||
*/
|
||||
public BsDistribution selectOneMsg(String phone);
|
||||
|
||||
/**
|
||||
* 查询分销商所有订单信息
|
||||
*/
|
||||
public List<BsDistributionVO> disAllOrder(BsDistribution bsDistribution);
|
||||
|
||||
/**
|
||||
* 根据手机号查询分销商信息是否存在
|
||||
*/
|
||||
public boolean existsByPhone(String phone);
|
||||
|
||||
/**
|
||||
* 联合删除用户信息
|
||||
*/
|
||||
public List<Long> getSysUserId(Long[] ids);
|
||||
}
|
@ -2,6 +2,8 @@ package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.BsOrder;
|
||||
import com.ruoyi.system.domain.dto.BsOrderDTO;
|
||||
import com.ruoyi.system.domain.vo.BsOrdersVO;
|
||||
|
||||
/**
|
||||
* 订单Service接口
|
||||
@ -82,4 +84,14 @@ public interface IBsOrderService
|
||||
* @return 结果
|
||||
*/
|
||||
public BsOrder userGetOrder(String orderNo);
|
||||
|
||||
/**
|
||||
* 所有分销商订单
|
||||
*/
|
||||
public List<BsOrdersVO> selectAllList(BsOrderDTO bsOrderDTO);
|
||||
|
||||
/**
|
||||
* 分销商查询订单
|
||||
*/
|
||||
public List<BsOrdersVO> distributionGetOrder(int distributorId);
|
||||
}
|
||||
|
@ -0,0 +1,131 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import com.ruoyi.system.domain.BsDistribution;
|
||||
import com.ruoyi.system.domain.vo.BsDistributionVO;
|
||||
import com.ruoyi.system.mapper.BsDistributionMapper;
|
||||
import com.ruoyi.system.service.IBsDistributionService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 分销商信息Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-11-18
|
||||
*/
|
||||
@Service
|
||||
public class BsDistributionServiceImpl implements IBsDistributionService
|
||||
{
|
||||
@Autowired
|
||||
private BsDistributionMapper bsDistributionMapper;
|
||||
|
||||
/**
|
||||
* 查询分销商信息
|
||||
*
|
||||
* @param id 分销商信息主键
|
||||
* @return 分销商信息
|
||||
*/
|
||||
@Override
|
||||
public BsDistribution selectBsDistributionById(Long id)
|
||||
{
|
||||
return bsDistributionMapper.selectBsDistributionById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分销商信息列表
|
||||
*
|
||||
* @param bsDistribution 分销商信息
|
||||
* @return 分销商信息
|
||||
*/
|
||||
@Override
|
||||
public List<BsDistribution> selectBsDistributionList(BsDistribution bsDistribution)
|
||||
{
|
||||
return bsDistributionMapper.selectBsDistributionList(bsDistribution);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增分销商信息
|
||||
*
|
||||
* @param bsDistribution 分销商信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBsDistribution(BsDistribution bsDistribution)
|
||||
{
|
||||
if(bsDistributionMapper.existsByPhone(bsDistribution.getPhone(), bsDistribution.getId())){
|
||||
throw new RuntimeException("该手机号已存在!");
|
||||
}
|
||||
return bsDistributionMapper.insertBsDistribution(bsDistribution);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改分销商信息
|
||||
*
|
||||
* @param bsDistribution 分销商信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBsDistribution(BsDistribution bsDistribution)
|
||||
{
|
||||
if(bsDistributionMapper.existsByPhone(bsDistribution.getPhone(), bsDistribution.getId())){
|
||||
throw new RuntimeException("该手机号已存在!");
|
||||
}
|
||||
return bsDistributionMapper.updateBsDistribution(bsDistribution);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除分销商信息
|
||||
*
|
||||
* @param ids 需要删除的分销商信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBsDistributionByIds(Long[] ids)
|
||||
{
|
||||
return bsDistributionMapper.deleteBsDistributionByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除分销商信息信息
|
||||
*
|
||||
* @param id 分销商信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBsDistributionById(Long id)
|
||||
{
|
||||
return bsDistributionMapper.deleteBsDistributionById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据手机号查询分销商信息
|
||||
*/
|
||||
@Override
|
||||
public BsDistribution selectOneMsg(String phone) {
|
||||
return bsDistributionMapper.selectOneMsg(phone);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分销商所有订单信息
|
||||
*/
|
||||
@Override
|
||||
public List<BsDistributionVO> disAllOrder(BsDistribution bsDistribution) {
|
||||
return bsDistributionMapper.disAllOrder(bsDistribution);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean existsByPhone(String phone) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 联合删除用户信息
|
||||
*/
|
||||
@Override
|
||||
public List<Long> getSysUserId(Long[] ids) {
|
||||
return bsDistributionMapper.getSysUserId(ids);
|
||||
}
|
||||
|
||||
}
|
@ -3,6 +3,8 @@ package com.ruoyi.system.service.impl;
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.uuid.IdUtils;
|
||||
import com.ruoyi.system.domain.dto.BsOrderDTO;
|
||||
import com.ruoyi.system.domain.vo.BsOrdersVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.system.mapper.BsOrderMapper;
|
||||
@ -128,4 +130,20 @@ public class BsOrderServiceImpl implements IBsOrderService
|
||||
public BsOrder userGetOrder(String orderNo) {
|
||||
return bsOrderMapper.userGetOrder(orderNo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 所有分销商订单
|
||||
*/
|
||||
@Override
|
||||
public List<BsOrdersVO> selectAllList(BsOrderDTO bsOrderDTO) {
|
||||
return bsOrderMapper.getAllOrder(bsOrderDTO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分销商查询订单
|
||||
*/
|
||||
@Override
|
||||
public List<BsOrdersVO> distributionGetOrder(int distributorId) {
|
||||
return bsOrderMapper.distributionGetOrder(distributorId);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
package com.ruoyi.web.controller.system;
|
||||
|
||||
import com.ruoyi.system.domain.BsDistribution;
|
||||
import com.ruoyi.system.service.IBsDistributionService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@ -25,7 +27,7 @@ import com.ruoyi.system.service.ISysUserService;
|
||||
|
||||
/**
|
||||
* 个人信息 业务处理
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@RestController
|
||||
@ -38,6 +40,9 @@ public class SysProfileController extends BaseController
|
||||
@Autowired
|
||||
private TokenService tokenService;
|
||||
|
||||
@Autowired
|
||||
private IBsDistributionService bsDistributionService;
|
||||
|
||||
/**
|
||||
* 个人信息
|
||||
*/
|
||||
@ -60,11 +65,19 @@ public class SysProfileController extends BaseController
|
||||
public AjaxResult updateProfile(@RequestBody SysUser user)
|
||||
{
|
||||
LoginUser loginUser = getLoginUser();
|
||||
System.out.println("登录人手机号"+loginUser.getUser().getPhonenumber());
|
||||
SysUser currentUser = loginUser.getUser();
|
||||
BsDistribution bsDistribution = bsDistributionService.selectOneMsg(currentUser.getPhonenumber());
|
||||
|
||||
if (bsDistribution != null) {
|
||||
bsDistribution.setPhone(user.getPhonenumber());
|
||||
System.out.println("影响行数");
|
||||
}
|
||||
currentUser.setNickName(user.getNickName());
|
||||
currentUser.setEmail(user.getEmail());
|
||||
currentUser.setPhonenumber(user.getPhonenumber());
|
||||
currentUser.setSex(user.getSex());
|
||||
|
||||
if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(currentUser))
|
||||
{
|
||||
return error("修改用户'" + loginUser.getUsername() + "'失败,手机号码已存在");
|
||||
@ -77,6 +90,7 @@ public class SysProfileController extends BaseController
|
||||
{
|
||||
// 更新缓存用户信息
|
||||
tokenService.setLoginUser(loginUser);
|
||||
bsDistributionService.updateBsDistribution(bsDistribution);
|
||||
return success();
|
||||
}
|
||||
return error("修改个人信息异常,请联系管理员");
|
||||
|
@ -21,6 +21,7 @@ server:
|
||||
servlet:
|
||||
# 应用的访问路径
|
||||
context-path: /bsw
|
||||
# context-path:
|
||||
tomcat:
|
||||
# tomcat的URI编码
|
||||
uri-encoding: UTF-8
|
||||
@ -142,6 +143,7 @@ wechat:
|
||||
pay:
|
||||
merchantId: 1695785302
|
||||
privateKeyPath: /www/wwwroot/bishe/apiclient_key.pem
|
||||
# privateKeyPath: D:\Code\bishe2\RuoYi-Vue\ruoyi-admin\src\main\resources\apiclient_key.pem
|
||||
merchantSerialNumber: 3E96EC705218574D63ECE2EA792B83B224FE9319
|
||||
apiV3Key: Su7vFDrgVScnUqABUrIWLYyrNapWeH1a
|
||||
appId: wxb1f71e5e0c5f9ee7
|
||||
|
@ -0,0 +1,142 @@
|
||||
<?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.BsDistributionMapper">
|
||||
|
||||
<resultMap type="BsDistribution" id="BsDistributionResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="phone" column="phone" />
|
||||
<result property="source" column="source" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="commission" column="commission" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
<resultMap type="BsDistributionVO" id="BsDistributionVOResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="phone" column="phone" />
|
||||
<result property="source" column="source" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="commission" column="commission" />
|
||||
<result property="allOrderCount" column="allOrderCount" />
|
||||
<result property="monthOrderCount" column="monthOrderCount" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBsDistributionVo">
|
||||
select id, name, phone, source, remark, commission from bs_distribution
|
||||
</sql>
|
||||
|
||||
<select id="selectBsDistributionList" parameterType="BsDistribution" resultMap="BsDistributionResult">
|
||||
<include refid="selectBsDistributionVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
|
||||
<if test="source != null and source != ''"> and source = #{source}</if>
|
||||
<if test="commission != null "> and commission = #{commission}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBsDistributionById" parameterType="Long" resultMap="BsDistributionResult">
|
||||
<include refid="selectBsDistributionVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertBsDistribution" parameterType="BsDistribution" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into bs_distribution
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="name != null">name,</if>
|
||||
<if test="phone != null">phone,</if>
|
||||
<if test="source != null">source,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="commission != null">commission,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="phone != null">#{phone},</if>
|
||||
<if test="source != null">#{source},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="commission != null">#{commission},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBsDistribution" parameterType="BsDistribution">
|
||||
update bs_distribution
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="phone != null">phone = #{phone},</if>
|
||||
<if test="source != null">source = #{source},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="commission != null">commission = #{commission},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBsDistributionById" parameterType="Long">
|
||||
delete from bs_distribution where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBsDistributionByIds" parameterType="String">
|
||||
delete from bs_distribution where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectOneMsg" parameterType="String" resultType="BsDistribution">
|
||||
select id, name, phone, source, remark, commission from bs_distribution
|
||||
where phone = #{phone}
|
||||
</select>
|
||||
|
||||
<select id="disAllOrder" resultMap="BsDistributionVOResult">
|
||||
select
|
||||
bd.id,
|
||||
bd.name,
|
||||
bd.phone,
|
||||
bd.source,
|
||||
bd.remark,
|
||||
bd.commission,
|
||||
COUNT(bo.id) AS allOrderCount,
|
||||
COUNT(CASE WHEN YEAR(bo.pay_time) = YEAR(CURRENT_DATE) AND MONTH(bo.pay_time) = MONTH(CURRENT_DATE) THEN 1 END) AS monthOrderCount
|
||||
FROM
|
||||
bs_distribution AS bd
|
||||
LEFT JOIN
|
||||
bs_order AS bo ON bd.id = bo.distributor AND bo.payStatus = 1
|
||||
<where>
|
||||
<if test="name != null and name != ''">
|
||||
AND bd.name = #{name}
|
||||
</if>
|
||||
<if test="phone != null and phone != ''">
|
||||
AND bd.phone = #{phone}
|
||||
</if>
|
||||
<if test="source != null and source != ''">
|
||||
AND bd.source = #{source}
|
||||
</if>
|
||||
<if test="id != null">
|
||||
AND bd.id = #{id}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
bd.id, bd.name, bd.phone, bd.source, bd.remark, bd.commission
|
||||
</select>
|
||||
|
||||
<!-- 检查手机号是否存在 -->
|
||||
<select id="existsByPhone" parameterType="BsDistribution" resultType="boolean">
|
||||
SELECT COUNT(1) > 0
|
||||
FROM bs_distribution
|
||||
WHERE phone = #{phone} AND id != #{id}
|
||||
</select>
|
||||
|
||||
<select id="getSysUserId" parameterType="String" resultType="Long">
|
||||
select su.user_id from bs_distribution as bd
|
||||
left join sys_user as su on su.phonenumber = bd.phone
|
||||
where bd.id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
@ -17,6 +17,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="payStatus" column="payStatus"/>
|
||||
<result property="openid" column="openid"/>
|
||||
<result property="distributor" column="distributor"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="BsOrdersVO" id="BsOrdersVOResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="orderNo" column="order_no"/>
|
||||
<result property="channel" column="channel"/>
|
||||
<result property="transactionId" column="transaction_id"/>
|
||||
<result property="payTime" column="pay_time"/>
|
||||
<result property="goodsName" column="goods_name"/>
|
||||
<result property="goodsmin" column="goodsmin"/>
|
||||
<result property="price" column="price"/>
|
||||
<result property="createId" column="create_id"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="payStatus" column="payStatus"/>
|
||||
<result property="openid" column="openid"/>
|
||||
<result property="distributor" column="distributor"/>
|
||||
<result property="distributionName" column="distributionName"/>
|
||||
<result property="distributionPhone" column="distributionPhone"/>
|
||||
<result property="distributionId" column="distributionId"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBsOrderVo">
|
||||
@ -32,7 +52,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
create_id,
|
||||
create_time,
|
||||
payStatus,
|
||||
openid
|
||||
openid,
|
||||
distributor
|
||||
from bs_order </sql>
|
||||
|
||||
<select id="selectBsOrderList" parameterType="BsOrder" resultMap="BsOrderResult">
|
||||
@ -76,6 +97,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="payStatus != null">payStatus,</if>
|
||||
<if test="openid != null">openid,</if>
|
||||
<if test="distributor != null">distributor,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="orderNo != null">#{orderNo},</if>
|
||||
@ -89,6 +111,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="payStatus != null">#{payStatus},</if>
|
||||
<if test="openid != null">#{openid},</if>
|
||||
<if test="distributor != null">#{distributor},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@ -133,4 +156,46 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<select id="userGetOrder" parameterType="String" resultMap="BsOrderResult">
|
||||
select order_no,channel,transaction_id,pay_time,goods_name,goodsmin,price,create_time from bs_order where order_no = #{orderNo} and payStatus = 1
|
||||
</select>
|
||||
|
||||
<select id="getAllOrder" parameterType="com.ruoyi.system.domain.dto.BsOrderDTO" resultMap="BsOrdersVOResult">
|
||||
select
|
||||
bo.id,
|
||||
bo.order_no,
|
||||
bo.channel,
|
||||
bo.transaction_id,
|
||||
bo.pay_time,
|
||||
bo.goods_name,
|
||||
bo.goodsmin,
|
||||
bo.price,
|
||||
bo.create_time,
|
||||
bo.openid,
|
||||
bo.payStatus,
|
||||
bo.distributor,
|
||||
bd.name as distributionName,
|
||||
bd.phone as distributionPhone,
|
||||
bd.id as distributionId
|
||||
from bs_order as bo
|
||||
left join bs_distribution as bd on bd.id = bo.distributor
|
||||
<where>
|
||||
<if test="orderNo != null and orderNo != ''"> AND bo.order_no = #{orderNo} </if>
|
||||
<if test="channel != null"> AND bo.channel = #{channel} </if>
|
||||
<if test="transactionId != null"> AND bo.transaction_id LIKE CONCAT('%', #{transactionId}, '%') </if>
|
||||
<if test="payTime != null"> AND DATE(bo.pay_time) = #{payTime} </if>
|
||||
<if test="goodsName != null and goodsName != ''"> AND bo.goods_name LIKE CONCAT('%', #{goodsName}, '%') </if>
|
||||
<if test="goodsmin != null"> AND bo.goodsmin = #{goodsmin} </if>
|
||||
<if test="price != null and price != ''"> AND bo.price = #{price} </if>
|
||||
<if test="createId != null and createId != ''"> AND bo.create_id = #{createId} </if>
|
||||
<if test="createTime != null"> AND bo.create_time = #{createTime} </if>
|
||||
<if test="openid != null and openid != ''"> AND bo.openid = #{openid} </if>
|
||||
<if test="distributionName != null and distributionName != ''"> AND bd.name = #{distributionName} </if>
|
||||
<if test="distributionPhone != null and distributionPhone != ''"> AND bd.phone = #{distributionPhone} </if>
|
||||
<if test="distributionId != null"> AND bd.id = #{distributionId} </if>
|
||||
AND bo.payStatus = 1
|
||||
</where>
|
||||
ORDER BY bo.pay_time DESC
|
||||
</select>
|
||||
|
||||
<select id="distributionGetOrder" parameterType="Integer" resultMap="BsOrdersVOResult">
|
||||
select order_no,channel,transaction_id,pay_time,goods_name,goodsmin,payStatus,price,create_time,openid from bs_order where distributor = #{distributor} and payStatus = 1
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -6,7 +6,7 @@ ENV = 'development'
|
||||
|
||||
# 若依管理系统/开发环境
|
||||
# VUE_APP_BASE_API = '/dev-api'
|
||||
# VUE_APP_BASE_API = 'http://124.222.105.7:7198/bsw'
|
||||
# VUE_APP_BASE_API = 'http://127.0.0.1:40506'
|
||||
VUE_APP_BASE_API = 'https://bishe.lighting-it.cn/bsw'
|
||||
|
||||
# 路由懒加载
|
||||
|
61
ruoyi-ui/src/api/system/distribution.js
Normal file
61
ruoyi-ui/src/api/system/distribution.js
Normal file
@ -0,0 +1,61 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询分销商信息列表
|
||||
export function listDistribution(query) {
|
||||
return request({
|
||||
url: '/system/distribution/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询分销商信息列表2
|
||||
export function disAllOrder(query) {
|
||||
return request({
|
||||
url: '/system/distribution/disAllOrder',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询分销商信息详细
|
||||
export function getDistribution(id) {
|
||||
return request({
|
||||
url: '/system/distribution/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询分销商信息详细2
|
||||
export function getDisMsg() {
|
||||
return request({
|
||||
url: '/system/distribution/getDisMsg',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增分销商信息
|
||||
export function addDistribution(data) {
|
||||
return request({
|
||||
url: '/system/distribution',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改分销商信息
|
||||
export function updateDistribution(data) {
|
||||
return request({
|
||||
url: '/system/distribution',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除分销商信息
|
||||
export function delDistribution(id) {
|
||||
return request({
|
||||
url: '/system/distribution/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
@ -9,6 +9,15 @@ export function listOrder(query) {
|
||||
})
|
||||
}
|
||||
|
||||
// 查询订单列表2
|
||||
export function listAllOrder(query) {
|
||||
return request({
|
||||
url: '/system/order/allOrderList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询订单详细
|
||||
export function getOrder(id) {
|
||||
return request({
|
||||
@ -73,3 +82,12 @@ export function userGetOrder(orderNo) {
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 分销商订单详细
|
||||
export function distributionOrder(query) {
|
||||
return request({
|
||||
url: '/system/order/distributionOrder',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
@ -101,6 +101,11 @@ export const constantRoutes = [
|
||||
component: () => import('@/views/system/userFront/precautions'),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/distributorOrder',
|
||||
component: () => import('@/views/system/distribution/distributorOrder'),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
component: Layout,
|
||||
|
File diff suppressed because it is too large
Load Diff
308
ruoyi-ui/src/views/system/distribution/distributorOrder.vue
Normal file
308
ruoyi-ui/src/views/system/distribution/distributorOrder.vue
Normal file
@ -0,0 +1,308 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="订单号" prop="orderNo">
|
||||
<el-input
|
||||
v-model="queryParams.orderNo"
|
||||
placeholder="请输入商户单号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="支付时间" prop="payTime">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.payTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择支付时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品名称" prop="goodsName">
|
||||
<el-input
|
||||
v-model="queryParams.goodsName"
|
||||
placeholder="请输入商品名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item label="openid" prop="openid">
|
||||
<el-input
|
||||
v-model="queryParams.openid"
|
||||
placeholder="请输入openid"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!-- <el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:order:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['system:order:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['system:order:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['system:order:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>-->
|
||||
|
||||
<div class="lj" v-if="this.distributor != null">
|
||||
<span style="color: red">您的专属链接为:https://bishe.lighting-it.cn/cus?distributorId={{this.distributor}}</span>
|
||||
</div>
|
||||
|
||||
<el-table v-loading="loading" :data="orderList" @selection-change="handleSelectionChange">
|
||||
<el-table-column label="商户单号" align="center" prop="orderNo" />
|
||||
<el-table-column label="交易流水号" align="center" prop="transactionId" />
|
||||
<el-table-column label="支付方式" align="center" prop="channel" >
|
||||
<template slot-scope="scope">
|
||||
{{ getPaymentMethod(scope.row.channel) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品名称" align="center" prop="goodsName" />
|
||||
<el-table-column label="商品id" align="center" prop="goodsmin" />
|
||||
<el-table-column label="订单价格" align="center" prop="price" />
|
||||
<el-table-column label="订单状态" align="center" prop="payStatus">
|
||||
<template slot-scope="scope">
|
||||
{{ getPayStatus(scope.row.payStatus) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="openid" align="center" prop="openid" />
|
||||
<el-table-column label="支付时间" align="center" prop="payTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.payTime, '{y}-{m}-{d}:{h}:{m}:{s}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}:{h}:{m}:{s}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改订单对话框 -->
|
||||
<!-- <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="订单号" prop="orderNo">
|
||||
<el-input v-model="form.orderNo" placeholder="请输入订单号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="1:微信,2:支付宝" prop="channel">
|
||||
<el-input v-model="form.channel" placeholder="请输入1:微信,2:支付宝" />
|
||||
</el-form-item>
|
||||
<el-form-item label="支付时间" prop="payTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.payTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择支付时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品名称" prop="goodsName">
|
||||
<el-input v-model="form.goodsName" placeholder="请输入商品名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="订单价格" prop="price">
|
||||
<el-input v-model="form.price" placeholder="请输入订单价格" />
|
||||
</el-form-item>
|
||||
<el-form-item label="购买人id" prop="createId">
|
||||
<el-input v-model="form.createId" placeholder="请输入购买人id" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>-->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {listOrder, getOrder, delOrder, addOrder, updateOrder, distributionOrder} from "@/api/system/order";
|
||||
import {getDisMsg} from "@/api/system/distribution";
|
||||
import {parseTime} from "../../../utils/ruoyi";
|
||||
|
||||
export default {
|
||||
name: "Order",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 订单表格数据
|
||||
orderList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
id: null,
|
||||
orderNo: null,
|
||||
channel: null,
|
||||
transactionId: null,
|
||||
payTime: null,
|
||||
goodsName: null,
|
||||
goodsmin: null,
|
||||
price: null,
|
||||
createId: null,
|
||||
createTime: null,
|
||||
payStatus: null,
|
||||
openid: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
},
|
||||
distributor:null,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getID();
|
||||
},
|
||||
methods: {
|
||||
parseTime,
|
||||
/** 查询订单列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
distributionOrder(this.queryParams).then(response => {
|
||||
this.orderList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
getID(){
|
||||
getDisMsg().then(response => {
|
||||
this.distributor = response.data
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
orderNo: null,
|
||||
channel: null,
|
||||
transactionId: null,
|
||||
payTime: null,
|
||||
goodsName: null,
|
||||
goodsmin: null,
|
||||
price: null,
|
||||
createId: null,
|
||||
createTime: null,
|
||||
payStatus: null,
|
||||
openid: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
getPaymentMethod(channel) {
|
||||
switch (channel) {
|
||||
case 1:
|
||||
return '微信支付';
|
||||
case 2:
|
||||
return '支付宝支付';
|
||||
default:
|
||||
return '未知支付方式';
|
||||
}
|
||||
},
|
||||
getPayStatus(payStatus) {
|
||||
switch (payStatus) {
|
||||
case 1:
|
||||
return '已支付';
|
||||
case 2:
|
||||
return '未支付';
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
.lj {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
</style>
|
345
ruoyi-ui/src/views/system/distribution/index.vue
Normal file
345
ruoyi-ui/src/views/system/distribution/index.vue
Normal file
@ -0,0 +1,345 @@
|
||||
<!-- 分销商信息页面 -->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="编号" prop="id">
|
||||
<el-input
|
||||
v-model="queryParams.id"
|
||||
placeholder="请输入编号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入姓名"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="联系方式" prop="phone">
|
||||
<el-input
|
||||
v-model="queryParams.phone"
|
||||
placeholder="请输入联系方式"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="来源" prop="source">
|
||||
<el-input
|
||||
v-model="queryParams.source"
|
||||
placeholder="请输入来源"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:distribution:add']"
|
||||
>新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['system:distribution:edit']"
|
||||
>修改
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['system:distribution:remove']"
|
||||
>删除
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['system:distribution:export']"
|
||||
>导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
<span style="margin-left: 250px;color: red">链接:https://bishe.lighting-it.cn/cus?distributorId=编号</span>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="distributionList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<el-table-column label="编号(distributorId)" align="center" prop="id"/>
|
||||
<el-table-column label="姓名" align="center" prop="name"/>
|
||||
<el-table-column label="联系方式" align="center" prop="phone"/>
|
||||
<el-table-column label="来源" align="center" prop="source"/>
|
||||
<el-table-column label="备注" align="center" prop="remark"/>
|
||||
<el-table-column label="提成" align="center" prop="commission"/>
|
||||
<el-table-column label="销售总数" align="center" prop="allOrderCount"/>
|
||||
<el-table-column label="当月销售数量" align="center" prop="monthOrderCount"/>
|
||||
<el-table-column label="链接" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button @click="showDetails(scope.row.id)" size="mini" type="text">查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:distribution:edit']"
|
||||
>修改
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:distribution:remove']"
|
||||
>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改分销商信息对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入姓名"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="联系方式" prop="phone">
|
||||
<el-input v-model="form.phone" placeholder="请输入联系方式"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="来源" prop="source">
|
||||
<el-input v-model="form.source" placeholder="请输入来源"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="提成" prop="commission">
|
||||
<el-input v-model="form.commission" placeholder="请输入提成"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="链接" :visible.sync="showDialog" width="400px">
|
||||
<p>https://bishe.lighting-it.cn/cus?distributorId={{ currentId }}</p>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="copyToClipboard('https://bishe.lighting-it.cn/cus?distributorId='+currentId)" type="primary">
|
||||
复制
|
||||
</el-button>
|
||||
<el-button @click="showDialog = false">关闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listDistribution,
|
||||
getDistribution,
|
||||
delDistribution,
|
||||
addDistribution,
|
||||
updateDistribution,
|
||||
disAllOrder
|
||||
} from "@/api/system/distribution";
|
||||
|
||||
export default {
|
||||
name: "Distribution",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 分销商信息表格数据
|
||||
distributionList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: null,
|
||||
phone: null,
|
||||
source: null,
|
||||
commission: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {},
|
||||
// 控制弹出框显示
|
||||
showDialog: false,
|
||||
// 当前选中行的 ID
|
||||
currentId: null,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询分销商信息列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
disAllOrder(this.queryParams).then(response => {
|
||||
this.distributionList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
name: null,
|
||||
phone: null,
|
||||
source: null,
|
||||
remark: null,
|
||||
commission: null,
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
// 弹窗
|
||||
showDetails(id) {
|
||||
// 将当前行的 ID 保存到 data 中
|
||||
this.currentId = id;
|
||||
// 显示弹出框
|
||||
this.showDialog = true;
|
||||
},
|
||||
// 复制按钮
|
||||
copyToClipboard(text) {
|
||||
navigator.clipboard.writeText(text).then(() => {
|
||||
this.$message.success('复制成功!');
|
||||
}).catch(err => {
|
||||
this.$message.error('复制失败:' + err);
|
||||
});
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加分销商信息";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getDistribution(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改分销商信息";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateDistribution(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addDistribution(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除分销商信息编号为"' + ids + '"的数据项?').then(function () {
|
||||
return delDistribution(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/distribution/export', {
|
||||
...this.queryParams
|
||||
}, `distribution_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -10,6 +10,15 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="分销商手机号" prop="distributionPhone">
|
||||
<el-input
|
||||
v-model="queryParams.distributionPhone"
|
||||
placeholder="请输入分销商手机号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="支付时间" prop="payTime">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.payTime"
|
||||
@ -89,7 +98,7 @@
|
||||
<!-- </el-row>-->
|
||||
|
||||
<el-table v-loading="loading" :data="orderList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<!-- <el-table-column type="selection" width="55" align="center" />-->
|
||||
<el-table-column label="商户单号" align="center" prop="orderNo" />
|
||||
<el-table-column label="交易流水号" align="center" prop="transactionId" />
|
||||
<el-table-column label="支付方式" align="center" prop="channel" >
|
||||
@ -102,7 +111,7 @@
|
||||
<el-table-column label="订单价格" align="center" prop="price" />
|
||||
<el-table-column label="订单状态" align="center" prop="payStatus">
|
||||
<template slot-scope="scope">
|
||||
{{ getPayStatus(scope.row.channel) }}
|
||||
{{ getPayStatus(scope.row.payStatus) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="openid" align="center" prop="openid" />
|
||||
@ -116,15 +125,10 @@
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}:{h}:{m}:{s}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<el-table-column label="分销商姓名" align="center" prop="distributionName" />
|
||||
<el-table-column label="分销商联系方式" align="center" prop="distributionPhone" />
|
||||
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<!-- <el-button-->
|
||||
<!-- size="mini"-->
|
||||
<!-- type="text"-->
|
||||
<!-- icon="el-icon-edit"-->
|
||||
<!-- @click="handleUpdate(scope.row)"-->
|
||||
<!-- v-hasPermi="['system:order:edit']"-->
|
||||
<!-- >修改</el-button>-->
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
@ -133,7 +137,7 @@
|
||||
v-hasPermi="['system:order:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>-->
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
@ -180,7 +184,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listOrder, getOrder, delOrder, addOrder, updateOrder } from "@/api/system/order";
|
||||
import {listOrder, getOrder, delOrder, addOrder, updateOrder, listAllOrder} from "@/api/system/order";
|
||||
import {parseTime} from "../../../utils/ruoyi";
|
||||
|
||||
export default {
|
||||
name: "Order",
|
||||
@ -219,7 +224,10 @@ export default {
|
||||
createId: null,
|
||||
createTime: null,
|
||||
payStatus: null,
|
||||
openid: null
|
||||
openid: null,
|
||||
distributionName:null,
|
||||
distributionPhone:null,
|
||||
distributionId:null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
@ -232,10 +240,11 @@ export default {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
parseTime,
|
||||
/** 查询订单列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listOrder(this.queryParams).then(response => {
|
||||
listAllOrder(this.queryParams).then(response => {
|
||||
this.orderList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
@ -342,8 +351,8 @@ export default {
|
||||
return '未知支付方式';
|
||||
}
|
||||
},
|
||||
getPayStatus(channel) {
|
||||
switch (channel) {
|
||||
getPayStatus(payStatus) {
|
||||
switch (payStatus) {
|
||||
case 1:
|
||||
return '已支付';
|
||||
case 2:
|
||||
|
@ -79,7 +79,7 @@
|
||||
<!-- @click="downloadFile(goods.resource)"-->
|
||||
<div class="pay-but">
|
||||
<!-- <router-link :to="`/cusDetPay/${goods.id}`">-->
|
||||
<router-link :to="{ path: '/cusDetPay', query: { id: goods.id } }">
|
||||
<router-link :to="{ path: '/cusDetPay', query: { id: goods.id ,distributorId: distributorId } }">
|
||||
<el-button class="but-pay" ><i class="el-icon-download"></i> 支付下载</el-button>
|
||||
</router-link>
|
||||
</div>
|
||||
@ -158,6 +158,7 @@ export default {
|
||||
|
||||
fuText:null,
|
||||
showButton: false,
|
||||
distributorId: null,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
@ -169,6 +170,7 @@ export default {
|
||||
created() {
|
||||
// this.goodsId = this.$route.params.id;
|
||||
this.goodsId = this.$route.query.id;
|
||||
this.distributorId = this.$route.query.distributorId;
|
||||
this.getGood(this.goodsId);
|
||||
this.getTnList()
|
||||
this.getDnList()
|
||||
|
@ -78,7 +78,7 @@
|
||||
<template v-if="goodsList.length > 0">
|
||||
<el-col :span="6" v-for="(item, index) in goodsList" :key="index" style="margin-bottom: 30px">
|
||||
<!-- <router-link :to="{ path: `/cusDetails/${item.id}` }">-->
|
||||
<router-link :to="{ path: '/cusDetails', query: { id: item.id } }">
|
||||
<router-link :to="{ path: '/cusDetails', query: { id: item.id, distributorId: distributorId } }">
|
||||
<el-card :body-style="{ padding: '5px' }">
|
||||
<!-- <el-image :src="`http://127.0.0.1:40506${item.cover}`" class="image" />-->
|
||||
<el-image :src="item.cover ? `https://bishe.lighting-it.cn/bsw${item.cover}` : defaultImage" class="image" @error="item.cover = defaultImage"/>
|
||||
@ -189,16 +189,28 @@ export default {
|
||||
},
|
||||
technicalType: null,
|
||||
defaultImage: require('@/assets/images/moren.png'),
|
||||
// 分销商ID
|
||||
distributorId: null,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getList();
|
||||
// 从 URL 查询参数中获取 distributorId
|
||||
const distributorId = this.$route.query.distributorId;
|
||||
if (distributorId) {
|
||||
this.distributorId = distributorId;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
console.log('aaa',this.goodsList)
|
||||
this.getTnList()
|
||||
this.getDnList()
|
||||
|
||||
// 从 URL 查询参数中获取 distributorId
|
||||
const distributorId = this.$route.query.distributorId;
|
||||
if (distributorId) {
|
||||
this.distributorId = distributorId;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/** 查询商品列表 */
|
||||
|
@ -69,11 +69,12 @@ export default {
|
||||
loading: null,
|
||||
imageUrl: '',
|
||||
defaultImage: require('@/assets/images/moren.png'),
|
||||
|
||||
distributorId: null,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.goodsId = this.$route.query.id;
|
||||
this.distributorId = this.$route.query.distributorId;
|
||||
this.getGood(this.goodsId);
|
||||
|
||||
},
|
||||
@ -97,6 +98,7 @@ export default {
|
||||
this.form.price = this.goods.price
|
||||
this.form.goodsName = this.goods.name
|
||||
this.form.goodsmin = this.goods.id
|
||||
this.form.distributor = this.distributorId;
|
||||
addOrder(this.form).then(response => {
|
||||
this.orderNo = response.data;
|
||||
});
|
||||
@ -107,7 +109,7 @@ export default {
|
||||
orderPay(this.orderNo).then(response => {
|
||||
this.payUrl = response;
|
||||
this.loading = true;
|
||||
this.$router.push({ path: '/payMent', query: { id: this.goodsId, url: this.payUrl, orderNo: this.orderNo } });
|
||||
this.$router.push({ path: '/payMent', query: { id: this.goodsId, url: this.payUrl, orderNo: this.orderNo, distributorId: this.distributorId } });
|
||||
}).catch(error => {
|
||||
console.error('支付失败', error);
|
||||
}).finally(() => {
|
||||
|
@ -57,12 +57,14 @@ export default {
|
||||
goodsResource: null,
|
||||
goodsId: null,
|
||||
goods: [],
|
||||
distributorId: null,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.payUrl = this.$route.query.url;
|
||||
this.orderNo = this.$route.query.orderNo;
|
||||
this.goodsId = this.$route.query.id;
|
||||
this.distributorId = this.$route.query.distributorId;
|
||||
this.getGood(this.goodsId);
|
||||
this.generateQrCode()
|
||||
this.payStatus = 2;
|
||||
|
Loading…
Reference in New Issue
Block a user