feat(wms): 新增供应商信息管理功能

- 添加供应商信息相关实体类、Mapper、Service、Controller
- 实现供应商信息的增删改查、分页查询、导出等功能
- 新增用户信息相关实体类、Mapper、Service、Controller
- 实现用户信息的增删改查、分页查询等功能
hwmom-htk
zangch@mesnac.com 5 months ago
parent 2e58e35bab
commit 8632bb8872

@ -0,0 +1,117 @@
package org.dromara.wms.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.RequiredArgsConstructor;
import org.dromara.common.core.domain.R;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.excel.utils.ExcelUtil;
import org.dromara.common.idempotent.annotation.RepeatSubmit;
import org.dromara.common.log.annotation.Log;
import org.dromara.common.log.enums.BusinessType;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.web.core.BaseController;
import org.dromara.wms.domain.bo.BaseSupplierInfoBo;
import org.dromara.wms.domain.vo.BaseSupplierInfoVo;
import org.dromara.wms.service.IBaseSupplierInfoService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
*
* 访:/wms/baseSupplierInfo
*
* @author ZangCH
* @date 2025-01-07
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/baseSupplierInfo")
public class BaseSupplierInfoController extends BaseController {
private final IBaseSupplierInfoService baseSupplierInfoService;
/**
*
*/
// @SaCheckPermission("mes:baseSupplierInfo:list")
@GetMapping("/list")
public TableDataInfo<BaseSupplierInfoVo> list(BaseSupplierInfoBo bo, PageQuery pageQuery) {
return baseSupplierInfoService.queryPageList(bo, pageQuery);
}
/**
*
*/
@SaCheckPermission("mes:baseSupplierInfo:export")
@Log(title = "供应商信息", businessType = BusinessType.EXPORT)
// @PostMapping("/export")
public void export(BaseSupplierInfoBo bo, HttpServletResponse response) {
List<BaseSupplierInfoVo> list = baseSupplierInfoService.queryList(bo);
ExcelUtil.exportExcel(list, "供应商信息", BaseSupplierInfoVo.class, response);
}
/**
*
*
* @param supplierId
*/
@SaCheckPermission("mes:baseSupplierInfo:query")
// @GetMapping("/{supplierId}")
public R<BaseSupplierInfoVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long supplierId) {
return R.ok(baseSupplierInfoService.queryById(supplierId));
}
/**
*
*/
@SaCheckPermission("mes:baseSupplierInfo:add")
@Log(title = "供应商信息", businessType = BusinessType.INSERT)
@RepeatSubmit()
// @PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody BaseSupplierInfoBo bo) {
return toAjax(baseSupplierInfoService.insertByBo(bo));
}
/**
*
*/
@SaCheckPermission("mes:baseSupplierInfo:edit")
@Log(title = "供应商信息", businessType = BusinessType.UPDATE)
@RepeatSubmit()
// @PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BaseSupplierInfoBo bo) {
return toAjax(baseSupplierInfoService.updateByBo(bo));
}
/**
*
*
* @param supplierIds
*/
@SaCheckPermission("mes:baseSupplierInfo:remove")
@Log(title = "供应商信息", businessType = BusinessType.DELETE)
// @DeleteMapping("/{supplierIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] supplierIds) {
return toAjax(baseSupplierInfoService.deleteWithValidByIds(List.of(supplierIds), true));
}
/**
*
*/
// @GetMapping("getBaseSupplierInfoList")
public R<List<BaseSupplierInfoVo>> getBaseSupplierInfolist(BaseSupplierInfoBo bo) {
List<BaseSupplierInfoVo> list = baseSupplierInfoService.queryList(bo);
return R.ok(list);
}
}

@ -15,7 +15,7 @@ import java.util.Date;
* @date 2025-01-07
*/
@Data
@TableName("base_supplier_info")
@TableName("base_supplier_info1")
public class BaseSupplierInfo {
@Serial
@ -37,6 +37,76 @@ public class BaseSupplierInfo {
*/
private String supplierName;
/**
*
*/
private String supplierShortName;
/**
*
*/
private String contactPerson;
/**
*
*/
private String contactPhone;
/**
*
*/
private String contactEmail;
/**
*
*/
private String contactAddress;
/**
*
*/
private String businessLicenseNo;
/**
* JSON
*/
private String qualificationFiles;
/**
*
*/
private Date qualificationExpireDate;
/**
*
*/
private String bankAccountName;
/**
*
*/
private String bankName;
/**
*
*/
private String bankAccountNo;
/**
* 1 0
*/
private String cooperationStatus;
/**
* 1 0 2
*/
private String auditStatus;
/**
*
*/
private String auditRemark;
/**
* erp
*/
@ -65,13 +135,19 @@ public class BaseSupplierInfo {
* id
*/
private String tenantId;
/**
*
*/
@TableField(fill = FieldFill.INSERT)
private Long createDept;
@TableField(fill = FieldFill.INSERT)
private String createBy;
/**
*
*/
@TableField(fill = FieldFill.INSERT)
private Date createTime;
/**

@ -0,0 +1,115 @@
package org.dromara.wms.domain;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.dromara.common.core.constant.UserConstants;
import org.dromara.common.tenant.core.TenantEntity;
import java.util.Date;
/**
* sys_user
*
* @author Lion Li
*/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName("sys_user")
public class SysUser extends TenantEntity {
/**
* ID
*/
@TableId(value = "user_id")
private Long userId;
/**
* ID
*/
private Long deptId;
/**
*
*/
private String userName;
/**
*
*/
private String nickName;
/**
* sys_user
*/
private String userType;
/**
*
*/
private String email;
/**
*
*/
private String phonenumber;
/**
*
*/
private String sex;
/**
*
*/
private Long avatar;
/**
*
*/
@TableField(
insertStrategy = FieldStrategy.NOT_EMPTY,
updateStrategy = FieldStrategy.NOT_EMPTY,
whereStrategy = FieldStrategy.NOT_EMPTY
)
private String password;
/**
* 0 1
*/
private String status;
/**
* 0 2
*/
@TableLogic
private String delFlag;
/**
* IP
*/
private String loginIp;
/**
*
*/
private Date loginDate;
/**
*
*/
private String remark;
public SysUser(Long userId) {
this.userId = userId;
}
public boolean isSuperAdmin() {
return UserConstants.SUPER_ADMIN_ID.equals(this.userId);
}
}

@ -0,0 +1,138 @@
package org.dromara.wms.domain.bo;
import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.wms.domain.BaseSupplierInfo;
import java.util.Date;
/**
* base_supplier_info
*
* @author ZangCH
* @date 2025-01-07
*/
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = BaseSupplierInfo.class, reverseConvertGenerate = false)
public class BaseSupplierInfoBo extends BaseEntity {
/**
*
*/
private Long supplierId;
/**
*
*/
@NotBlank(message = "供应商编号不能为空", groups = { AddGroup.class, EditGroup.class })
private String supplierCode;
/**
*
*/
@NotBlank(message = "供应商名称不能为空", groups = { AddGroup.class, EditGroup.class })
private String supplierName;
/**
*
*/
private String supplierShortName;
/**
*
*/
private String contactPerson;
/**
*
*/
private String contactPhone;
/**
*
*/
private String contactEmail;
/**
*
*/
private String contactAddress;
/**
*
*/
private String businessLicenseNo;
/**
* JSON
*/
private String qualificationFiles;
/**
*
*/
private Date qualificationExpireDate;
/**
*
*/
private String bankAccountName;
/**
*
*/
private String bankName;
/**
*
*/
private String bankAccountNo;
/**
* 1 0
*/
private String cooperationStatus;
/**
* 1 0 2
*/
private String auditStatus;
/**
*
*/
private String auditRemark;
/**
* erp
*/
private Long erpId;
/**
* 1 0
*/
private String supplierStatus;
/**
*
*/
private Date auditDate;
/**
* erp
*/
private Date erpModifyDate;
/**
*
*/
private String remark;
}

@ -51,6 +51,92 @@ public class BaseSupplierInfoVo implements Serializable {
@ExcelProperty(value = "供应商名称")
private String supplierName;
/**
*
*/
@ExcelProperty(value = "供应商简称")
private String supplierShortName;
/**
*
*/
@ExcelProperty(value = "联系人")
private String contactPerson;
/**
*
*/
@ExcelProperty(value = "联系电话")
private String contactPhone;
/**
*
*/
@ExcelProperty(value = "邮箱")
private String contactEmail;
/**
*
*/
@ExcelProperty(value = "联系地址")
private String contactAddress;
/**
*
*/
@ExcelProperty(value = "营业执照编号")
private String businessLicenseNo;
/**
* JSON
*/
@ExcelProperty(value = "资质文件")
private String qualificationFiles;
/**
*
*/
@ExcelProperty(value = "资质到期日期")
private Date qualificationExpireDate;
/**
*
*/
@ExcelProperty(value = "银行账户名")
private String bankAccountName;
/**
*
*/
@ExcelProperty(value = "开户行")
private String bankName;
/**
*
*/
@ExcelProperty(value = "银行账号")
private String bankAccountNo;
/**
* 1 0
*/
@ExcelProperty(value = "合作状态", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "cooperation_status")
private String cooperationStatus;
/**
* 1 0 2
*/
@ExcelProperty(value = "审核状态", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "audit_status")
private String auditStatus;
/**
*
*/
@ExcelProperty(value = "审核备注")
private String auditRemark;
/**
* erp
*/

@ -0,0 +1,141 @@
package org.dromara.wms.domain.vo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import org.dromara.common.sensitive.annotation.Sensitive;
import org.dromara.common.sensitive.core.SensitiveStrategy;
import org.dromara.common.translation.annotation.Translation;
import org.dromara.common.translation.constant.TransConstant;
import org.dromara.wms.domain.SysUser;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* sys_user
*
* @author Michelle.Chung
*/
@Data
@AutoMapper(target = SysUser.class)
public class SysUserVo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* ID
*/
private Long userId;
/**
* ID
*/
private String tenantId;
/**
* ID
*/
private Long deptId;
/**
*
*/
private String userName;
/**
*
*/
private String nickName;
/**
* sys_user
*/
private String userType;
/**
*
*/
@Sensitive(strategy = SensitiveStrategy.EMAIL, perms = "system:user:edit")
private String email;
/**
*
*/
@Sensitive(strategy = SensitiveStrategy.PHONE, perms = "system:user:edit")
private String phonenumber;
/**
* 0 1 2
*/
private String sex;
/**
*
*/
@Translation(type = TransConstant.OSS_ID_TO_URL)
private Long avatar;
/**
*
*/
@JsonIgnore
@JsonProperty
private String password;
/**
* 0 1
*/
private String status;
/**
* IP
*/
private String loginIp;
/**
*
*/
private Date loginDate;
/**
*
*/
private String remark;
/**
*
*/
private Date createTime;
/**
*
*/
@Translation(type = TransConstant.DEPT_ID_TO_NAME, mapper = "deptId")
private String deptName;
/**
*
*/
// private List<SysRoleVo> roles;
/**
*
*/
private Long[] roleIds;
/**
*
*/
private Long[] postIds;
/**
* ID
*/
private Long roleId;
}

@ -0,0 +1,90 @@
package org.dromara.wms.mapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.dromara.common.mybatis.annotation.DataColumn;
import org.dromara.common.mybatis.annotation.DataPermission;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import org.dromara.wms.domain.SysUser;
import org.dromara.wms.domain.vo.SysUserVo;
import java.util.List;
/**
*
*
* @author Lion Li
*/
public interface SysUserMapper extends BaseMapperPlus<SysUser, SysUserVo> {
@DataPermission({
@DataColumn(key = "deptName", value = "u.dept_id"),
@DataColumn(key = "userName", value = "u.user_id")
})
Page<SysUserVo> selectPageUserList(@Param("page") Page<SysUser> page, @Param(Constants.WRAPPER) Wrapper<SysUser> queryWrapper);
@DataPermission({
@DataColumn(key = "deptName", value = "dept_id"),
@DataColumn(key = "userName", value = "user_id")
})
List<SysUserVo> selectUserList(@Param(Constants.WRAPPER) Wrapper<SysUser> queryWrapper);
/**
*
*
* @param queryWrapper
* @return
*/
// @DataPermission({
// @DataColumn(key = "deptName", value = "d.dept_id"),
// @DataColumn(key = "userName", value = "u.user_id")
// })
// List<SysUserExportVo> selectUserExportList(@Param(Constants.WRAPPER) Wrapper<SysUser> queryWrapper);
/**
*
*
* @param queryWrapper
* @return
*/
@DataPermission({
@DataColumn(key = "deptName", value = "d.dept_id"),
@DataColumn(key = "userName", value = "u.user_id")
})
Page<SysUserVo> selectAllocatedList(@Param("page") Page<SysUser> page, @Param(Constants.WRAPPER) Wrapper<SysUser> queryWrapper);
/**
*
*
* @param queryWrapper
* @return
*/
@DataPermission({
@DataColumn(key = "deptName", value = "d.dept_id"),
@DataColumn(key = "userName", value = "u.user_id")
})
Page<SysUserVo> selectUnallocatedList(@Param("page") Page<SysUser> page, @Param(Constants.WRAPPER) Wrapper<SysUser> queryWrapper);
@DataPermission({
@DataColumn(key = "deptName", value = "dept_id"),
@DataColumn(key = "userName", value = "user_id")
})
long countUserById(Long userId);
@Override
@DataPermission({
@DataColumn(key = "deptName", value = "dept_id"),
@DataColumn(key = "userName", value = "user_id")
})
int update(@Param(Constants.ENTITY) SysUser user, @Param(Constants.WRAPPER) Wrapper<SysUser> updateWrapper);
@Override
@DataPermission({
@DataColumn(key = "deptName", value = "dept_id"),
@DataColumn(key = "userName", value = "user_id")
})
int updateById(@Param(Constants.ENTITY) SysUser user);
}

@ -0,0 +1,68 @@
package org.dromara.wms.service;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.wms.domain.bo.BaseSupplierInfoBo;
import org.dromara.wms.domain.vo.BaseSupplierInfoVo;
import java.util.Collection;
import java.util.List;
/**
* Service
*
* @author ZangCH
* @date 2025-01-07
*/
public interface IBaseSupplierInfoService {
/**
*
*
* @param supplierId
* @return
*/
BaseSupplierInfoVo queryById(Long supplierId);
/**
*
*
* @param bo
* @param pageQuery
* @return
*/
TableDataInfo<BaseSupplierInfoVo> queryPageList(BaseSupplierInfoBo bo, PageQuery pageQuery);
/**
*
*
* @param bo
* @return
*/
List<BaseSupplierInfoVo> queryList(BaseSupplierInfoBo bo);
/**
*
*
* @param bo
* @return
*/
Boolean insertByBo(BaseSupplierInfoBo bo);
/**
*
*
* @param bo
* @return
*/
Boolean updateByBo(BaseSupplierInfoBo bo);
/**
*
*
* @param ids
* @param isValid
* @return
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
}

@ -70,6 +70,7 @@ public interface IWmsPurchaseOrderDetailService {
/**
* -
* WmsInstockRecord
*
* @param bo
* @return -

@ -0,0 +1,195 @@
package org.dromara.wms.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.toolkit.JoinWrappers;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import lombok.RequiredArgsConstructor;
import org.dromara.common.core.exception.ServiceException;
import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.wms.domain.BaseSupplierInfo;
import org.dromara.wms.domain.bo.BaseSupplierInfoBo;
import org.dromara.wms.domain.vo.BaseSupplierInfoVo;
import org.dromara.wms.mapper.BaseSupplierInfoMapper;
import org.dromara.wms.service.IBaseSupplierInfoService;
import org.springframework.stereotype.Service;
import java.util.Collection;
import java.util.List;
import java.util.Map;
/**
* Service
*
* @author ZangCH
* @date 2025-01-07
*/
@RequiredArgsConstructor
@Service
public class BaseSupplierInfoServiceImpl implements IBaseSupplierInfoService {
private final BaseSupplierInfoMapper baseMapper;
/**
*
*
* @param supplierId
* @return
*/
@Override
public BaseSupplierInfoVo queryById(Long supplierId){
return baseMapper.selectVoById(supplierId);
}
/**
*
*
* @param bo
* @param pageQuery
* @return
*/
@Override
public TableDataInfo<BaseSupplierInfoVo> queryPageList(BaseSupplierInfoBo bo, PageQuery pageQuery) {
MPJLambdaWrapper<BaseSupplierInfo> lqw = buildQueryWrapper(bo);
Page<BaseSupplierInfoVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
*
*
* @param bo
* @return
*/
@Override
public List<BaseSupplierInfoVo> queryList(BaseSupplierInfoBo bo) {
MPJLambdaWrapper<BaseSupplierInfo> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private MPJLambdaWrapper<BaseSupplierInfo> buildQueryWrapper(BaseSupplierInfoBo bo) {
Map<String, Object> params = bo.getParams();
MPJLambdaWrapper<BaseSupplierInfo> lqw = JoinWrappers.lambda(BaseSupplierInfo.class)
.selectAll(BaseSupplierInfo.class)
.eq(bo.getSupplierId() != null, BaseSupplierInfo::getSupplierId, bo.getSupplierId())
.eq(StringUtils.isNotBlank(bo.getSupplierCode()), BaseSupplierInfo::getSupplierCode, bo.getSupplierCode())
.like(StringUtils.isNotBlank(bo.getSupplierName()), BaseSupplierInfo::getSupplierName, bo.getSupplierName())
.like(StringUtils.isNotBlank(bo.getSupplierShortName()), BaseSupplierInfo::getSupplierShortName, bo.getSupplierShortName())
.like(StringUtils.isNotBlank(bo.getContactPerson()), BaseSupplierInfo::getContactPerson, bo.getContactPerson())
.eq(StringUtils.isNotBlank(bo.getContactPhone()), BaseSupplierInfo::getContactPhone, bo.getContactPhone())
.eq(StringUtils.isNotBlank(bo.getContactEmail()), BaseSupplierInfo::getContactEmail, bo.getContactEmail())
.eq(StringUtils.isNotBlank(bo.getBusinessLicenseNo()), BaseSupplierInfo::getBusinessLicenseNo, bo.getBusinessLicenseNo())
.eq(StringUtils.isNotBlank(bo.getCooperationStatus()), BaseSupplierInfo::getCooperationStatus, bo.getCooperationStatus())
.eq(StringUtils.isNotBlank(bo.getAuditStatus()), BaseSupplierInfo::getAuditStatus, bo.getAuditStatus())
.eq(bo.getErpId() != null, BaseSupplierInfo::getErpId, bo.getErpId())
.eq(StringUtils.isNotBlank(bo.getSupplierStatus()), BaseSupplierInfo::getSupplierStatus, bo.getSupplierStatus())
.between(params.get("beginAuditDate") != null && params.get("endAuditDate") != null,
BaseSupplierInfo::getAuditDate ,params.get("beginAuditDate"), params.get("endAuditDate"))
.between(params.get("beginErpModifyDate") != null && params.get("endErpModifyDate") != null,
BaseSupplierInfo::getErpModifyDate ,params.get("beginErpModifyDate"), params.get("endErpModifyDate"))
.between(params.get("beginQualificationExpireDate") != null && params.get("endQualificationExpireDate") != null,
BaseSupplierInfo::getQualificationExpireDate ,params.get("beginQualificationExpireDate"), params.get("endQualificationExpireDate"))
.orderByDesc(BaseSupplierInfo::getCreateTime);
return lqw;
}
/**
*
*
* @param bo
* @return
*/
@Override
public Boolean insertByBo(BaseSupplierInfoBo bo) {
BaseSupplierInfo add = MapstructUtils.convert(bo, BaseSupplierInfo.class);
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setSupplierId(add.getSupplierId());
}
return flag;
}
/**
*
*
* @param bo
* @return
*/
@Override
public Boolean updateByBo(BaseSupplierInfoBo bo) {
BaseSupplierInfo update = MapstructUtils.convert(bo, BaseSupplierInfo.class);
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
}
/**
*
*/
private void validEntityBeforeSave(BaseSupplierInfo entity){
//TODO 做一些数据校验,如唯一约束
//校验编码是否重复
if (StringUtils.isNotBlank(entity.getSupplierCode())) {
BaseSupplierInfoBo query = new BaseSupplierInfoBo();
query.setSupplierCode(entity.getSupplierCode());
MPJLambdaWrapper<BaseSupplierInfo> lqw = buildQueryWrapper(query);
BaseSupplierInfo baseSupplierInfo = baseMapper.selectOne(lqw);
if (baseSupplierInfo != null && !baseSupplierInfo.getSupplierId().equals(entity.getSupplierId())) {
throw new ServiceException("供应商编码已存在");
}
}
//校验营业执照编号是否重复
if (StringUtils.isNotBlank(entity.getBusinessLicenseNo())) {
BaseSupplierInfoBo query = new BaseSupplierInfoBo();
query.setBusinessLicenseNo(entity.getBusinessLicenseNo());
MPJLambdaWrapper<BaseSupplierInfo> lqw = buildQueryWrapper(query);
BaseSupplierInfo baseSupplierInfo = baseMapper.selectOne(lqw);
if (baseSupplierInfo != null && !baseSupplierInfo.getSupplierId().equals(entity.getSupplierId())) {
throw new ServiceException("营业执照编号已存在");
}
}
//设置默认值
if (StringUtils.isBlank(entity.getSupplierStatus())) {
entity.setSupplierStatus("1"); // 默认启用
}
if (StringUtils.isBlank(entity.getCooperationStatus())) {
entity.setCooperationStatus("1"); // 默认正常合作
}
if (StringUtils.isBlank(entity.getAuditStatus())) {
entity.setAuditStatus("0"); // 默认待审核
}
}
/**
*
*
* @param ids
* @param isValid
* @return
*/
@Override
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
if(isValid){
//TODO 做一些业务上的校验,判断是否需要校验
// 校验是否有未完成的采购订单
for (Long supplierId : ids) {
// 这里需要根据实际的采购订单表结构来检查
// 例如:检查 purchase_order 表中是否有 supplier_id = supplierId 且 status != '已完成' 的记录
// 这里仅作为示例,实际需要根据你的采购订单表来实现
BaseSupplierInfoVo supplier = queryById(supplierId);
if (supplier != null) {
// 这里可以调用采购订单的Service来检查
// boolean hasUnfinishedOrders = purchaseOrderService.hasUnfinishedOrdersBySupplierId(supplierId);
// if (hasUnfinishedOrders) {
// throw new ServiceException("供应商「" + supplier.getSupplierName() + "」存在未完成的采购订单,不允许删除");
// }
}
}
}
return baseMapper.deleteByIds(ids) > 0;
}
}

@ -0,0 +1,7 @@
<?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="org.dromara.wms.mapper.BaseSupplierInfoMapper">
</mapper>

@ -0,0 +1,73 @@
<?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="org.dromara.wms.mapper.SysUserMapper">
<resultMap type="org.dromara.wms.domain.vo.SysUserVo" id="SysUserResult">
<id property="userId" column="user_id"/>
</resultMap>
<!-- <resultMap type="org.dromara.wms.domain.vo.SysUserExportVo" id="SysUserExportResult">-->
<!-- <id property="userId" column="user_id"/>-->
<!-- </resultMap>-->
<select id="selectPageUserList" resultMap="SysUserResult">
select
<if test="ew.getSqlSelect != null">
${ew.getSqlSelect}
</if>
<if test="ew.getSqlSelect == null">
u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex,
u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark
</if>
from sys_user u
${ew.getCustomSqlSegment}
</select>
<select id="selectUserList" resultMap="SysUserResult">
select
<if test="ew.getSqlSelect != null">
${ew.getSqlSelect}
</if>
<if test="ew.getSqlSelect == null">
u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex,
u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark
</if>
from sys_user u
${ew.getCustomSqlSegment}
</select>
<!-- <select id="selectUserExportList" resultMap="SysUserExportResult">-->
<!-- select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex,-->
<!-- u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,-->
<!-- d.dept_name, d.leader, u1.user_name as leaderName-->
<!-- from sys_user u-->
<!-- left join sys_dept d on u.dept_id = d.dept_id-->
<!-- left join sys_user u1 on u1.user_id = d.leader-->
<!-- ${ew.getCustomSqlSegment}-->
<!-- </select>-->
<select id="selectAllocatedList" resultMap="SysUserResult">
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
from sys_user u
left join sys_dept d on u.dept_id = d.dept_id
left join sys_user_role sur on u.user_id = sur.user_id
left join sys_role r on r.role_id = sur.role_id
${ew.getCustomSqlSegment}
</select>
<select id="selectUnallocatedList" resultMap="SysUserResult">
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
from sys_user u
left join sys_dept d on u.dept_id = d.dept_id
left join sys_user_role sur on u.user_id = sur.user_id
left join sys_role r on r.role_id = sur.role_id
${ew.getCustomSqlSegment}
</select>
<select id="countUserById" resultType="Long">
select count(*) from sys_user where del_flag = '0' and user_id = #{userId}
</select>
</mapper>
Loading…
Cancel
Save