first commit
This commit is contained in:
+50
@@ -0,0 +1,50 @@
|
||||
package com.mhd.user.domain.driverFollowShipper.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import java.math.BigDecimal;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
|
||||
/**
|
||||
* 车主关注货主对象 driver_follow_shipper
|
||||
*
|
||||
* @author gen
|
||||
* @date 2023-12-26
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class DriverFollowShipper extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long driverFollowShipperId;
|
||||
|
||||
@ApiModelProperty("司机用户主表ID(车主)")
|
||||
@Excel(name = "司机用户主表ID(车主)")
|
||||
private Long driverUserId;
|
||||
|
||||
@ApiModelProperty("货主用户主表ID")
|
||||
@Excel(name = "货主用户主表ID")
|
||||
private Long shipperUserId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织表name")
|
||||
@Excel(name = "组织表name")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
package com.mhd.user.domain.driverFollowShipper.repository.facade;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mhd.user.domain.driverFollowShipper.entity.DriverFollowShipper;
|
||||
import com.mhd.user.domain.driverFollowShipper.repository.po.DriverFollowShipperPO;
|
||||
import com.mhd.user.domain.driverFollowShipper.repository.todo.DriverFollowShipperDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 车主关注货主Service接口
|
||||
*
|
||||
* @author gen
|
||||
* @date 2023-12-26
|
||||
*/
|
||||
public interface IDriverFollowShipperService extends IService<DriverFollowShipper>
|
||||
{
|
||||
/**
|
||||
* 分页查询车主关注货主列表
|
||||
*/
|
||||
public List<DriverFollowShipperPO> queryList(DriverFollowShipperDO driverFollowShipperDO);
|
||||
|
||||
/**
|
||||
* 新增车主关注货主
|
||||
*/
|
||||
public Boolean insert(DriverFollowShipperDO driverFollowShipperDO);
|
||||
|
||||
/**
|
||||
* 修改车主关注货主
|
||||
*/
|
||||
public Boolean update(DriverFollowShipperDO driverFollowShipperDO);
|
||||
|
||||
/**
|
||||
* 批量删除车主关注货主
|
||||
*/
|
||||
public Boolean delete(Long[] driverFollowShipperIds);
|
||||
|
||||
|
||||
/**
|
||||
* 查询车主关注货主
|
||||
*/
|
||||
public DriverFollowShipperPO getInfo(Long driverFollowShipperId);
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.mhd.user.domain.driverFollowShipper.repository.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mhd.user.domain.driverFollowShipper.entity.DriverFollowShipper;
|
||||
import com.mhd.user.domain.driverFollowShipper.repository.po.DriverFollowShipperPO;
|
||||
import com.mhd.user.domain.driverFollowShipper.repository.todo.DriverFollowShipperDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
/**
|
||||
* 车主关注货主Mapper接口
|
||||
*
|
||||
* @author gen
|
||||
* @date 2023-12-26
|
||||
*/
|
||||
public interface DriverFollowShipperMapper extends BaseMapper<DriverFollowShipper>
|
||||
{
|
||||
/**
|
||||
* 查询车主关注货主列表
|
||||
*/
|
||||
public List<DriverFollowShipperPO> queryList(DriverFollowShipperDO driverFollowShipperDO);
|
||||
|
||||
}
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
package com.mhd.user.domain.driverFollowShipper.repository.persistence;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mhd.user.domain.driverFollowShipper.entity.DriverFollowShipper;
|
||||
import com.mhd.user.domain.driverFollowShipper.repository.facade.IDriverFollowShipperService;
|
||||
import com.mhd.user.domain.driverFollowShipper.repository.mapper.DriverFollowShipperMapper;
|
||||
import com.mhd.user.domain.driverFollowShipper.repository.po.DriverFollowShipperPO;
|
||||
import com.mhd.user.domain.driverFollowShipper.repository.todo.DriverFollowShipperDO;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 车主关注货主Service业务层处理
|
||||
*
|
||||
* @author gen
|
||||
* @date 2023-12-26
|
||||
*/
|
||||
@Service
|
||||
public class DriverFollowShipperImpl extends ServiceImpl<DriverFollowShipperMapper, DriverFollowShipper> implements IDriverFollowShipperService{
|
||||
@Autowired
|
||||
private DriverFollowShipperMapper driverFollowShipperMapper;
|
||||
|
||||
/**
|
||||
* 查询车主关注货主列表
|
||||
*/
|
||||
@Override
|
||||
public List<DriverFollowShipperPO> queryList(DriverFollowShipperDO driverFollowShipperDO)
|
||||
{
|
||||
return driverFollowShipperMapper.queryList(driverFollowShipperDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增车主关注货主
|
||||
*/
|
||||
@Override
|
||||
public Boolean insert(DriverFollowShipperDO driverFollowShipperDO) {
|
||||
DriverFollowShipper driverFollowShipper = new DriverFollowShipper();
|
||||
BeanUtils.copyProperties(driverFollowShipperDO,driverFollowShipper);
|
||||
return this.save(driverFollowShipper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改车主关注货主
|
||||
*/
|
||||
@Override
|
||||
public Boolean update(DriverFollowShipperDO driverFollowShipperDO) {
|
||||
DriverFollowShipper driverFollowShipper = new DriverFollowShipper();
|
||||
BeanUtils.copyProperties(driverFollowShipperDO,driverFollowShipper);
|
||||
return this.updateById(driverFollowShipper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除车主关注货主
|
||||
*/
|
||||
@Override
|
||||
public Boolean delete(Long[] driverFollowShipperIds ) {
|
||||
List<DriverFollowShipper> list = new ArrayList<>();
|
||||
for (Long id : driverFollowShipperIds) {
|
||||
DriverFollowShipper driverFollowShipper = new DriverFollowShipper();
|
||||
driverFollowShipper.setDriverFollowShipperId(id);
|
||||
driverFollowShipper.setDelFlag(2);
|
||||
list.add(driverFollowShipper);
|
||||
}
|
||||
return this.updateBatchById(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改车主关注货主
|
||||
*/
|
||||
@Override
|
||||
public DriverFollowShipperPO getInfo(Long driverFollowShipperId) {
|
||||
DriverFollowShipper driverFollowShipper = this.getById(driverFollowShipperId);
|
||||
DriverFollowShipperPO driverFollowShipperPO = new DriverFollowShipperPO();
|
||||
BeanUtils.copyProperties(driverFollowShipper,driverFollowShipperPO);
|
||||
return driverFollowShipperPO;
|
||||
}
|
||||
}
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
package com.mhd.user.domain.driverFollowShipper.repository.po;
|
||||
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
|
||||
|
||||
/**
|
||||
* 车主关注货主对象 driver_follow_shipper
|
||||
*
|
||||
* @author gen
|
||||
* @date 2023-12-26
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "车主关注货主对象", description = "车主关注货主响应对象")
|
||||
public class DriverFollowShipperPO extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
private Long driverFollowShipperId;
|
||||
|
||||
@ApiModelProperty("司机用户主表ID(车主)")
|
||||
@Excel(name = "司机用户主表ID(车主)")
|
||||
private Long driverUserId;
|
||||
|
||||
@ApiModelProperty("货主用户主表ID")
|
||||
@Excel(name = "货主用户主表ID")
|
||||
private Long shipperUserId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织表name")
|
||||
@Excel(name = "组织表name")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
|
||||
|
||||
}
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
package com.mhd.user.domain.driverFollowShipper.repository.todo;
|
||||
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import java.math.BigDecimal;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 车主关注货主对象 driver_follow_shipper
|
||||
*
|
||||
* @author gen
|
||||
* @date 2023-12-26
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class DriverFollowShipperDO extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
private Long driverFollowShipperId;
|
||||
|
||||
@ApiModelProperty("司机用户主表ID(车主)")
|
||||
@Excel(name = "司机用户主表ID(车主)")
|
||||
private Long driverUserId;
|
||||
|
||||
@ApiModelProperty("货主用户主表ID")
|
||||
@Excel(name = "货主用户主表ID")
|
||||
private Long shipperUserId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织表name")
|
||||
@Excel(name = "组织表name")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty(name = "组织ID集合")
|
||||
private List<Long> organizationIdList;
|
||||
|
||||
@ApiModelProperty(name = "权限菜单ID")
|
||||
private Long permissionMenuId;
|
||||
|
||||
@ApiModelProperty("用户操作类型(1-关注,2-取消关注)")
|
||||
private Integer followType;
|
||||
}
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
package com.mhd.user.domain.driverFollowShipper.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.mhd.user.domain.driverFollowShipper.entity.DriverFollowShipper;
|
||||
import com.mhd.user.domain.driverFollowShipper.repository.facade.IDriverFollowShipperService;
|
||||
import com.mhd.user.domain.driverFollowShipper.repository.po.DriverFollowShipperPO;
|
||||
import com.mhd.user.domain.driverFollowShipper.repository.todo.DriverFollowShipperDO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
/**
|
||||
* 车主关注货主
|
||||
*
|
||||
* @author gen
|
||||
* @date 2023-12-26
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class DriverFollowShipperDomainService {
|
||||
|
||||
@Autowired
|
||||
private IDriverFollowShipperService driverFollowShipperService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询车主关注货主列表
|
||||
*/
|
||||
public List<DriverFollowShipperPO> queryList(DriverFollowShipperDO driverFollowShipperDO) {
|
||||
return driverFollowShipperService.queryList(driverFollowShipperDO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增车主关注货主
|
||||
*/
|
||||
public Boolean insert(DriverFollowShipperDO driverFollowShipperDO) {
|
||||
|
||||
return driverFollowShipperService.insert(driverFollowShipperDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改车主关注货主
|
||||
*/
|
||||
public Boolean update(DriverFollowShipperDO driverFollowShipperDO) {
|
||||
return driverFollowShipperService.update(driverFollowShipperDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除车主关注货主
|
||||
*/
|
||||
public Boolean delete(Long[] driverFollowShipperIds) {
|
||||
return driverFollowShipperService.delete(driverFollowShipperIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取车主关注货主详细信息
|
||||
*/
|
||||
public DriverFollowShipperPO getInfo(Long driverFollowShipperId)
|
||||
{
|
||||
return driverFollowShipperService.getInfo(driverFollowShipperId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据货主用户id 删除司机关注
|
||||
* @param shipperUserId 货主用户id
|
||||
* @param driverUserId 司机用户id
|
||||
* @return
|
||||
*/
|
||||
public boolean deleteByShipperUserId(Long shipperUserId, Long driverUserId) {
|
||||
LambdaQueryWrapper<DriverFollowShipper> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(DriverFollowShipper::getDelFlag,0);
|
||||
queryWrapper.eq(DriverFollowShipper::getShipperUserId,shipperUserId);
|
||||
queryWrapper.eq(DriverFollowShipper::getDriverUserId,driverUserId);
|
||||
return driverFollowShipperService.remove(queryWrapper);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user