diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/controller/admin/BaseSupplierController.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/controller/admin/BaseSupplierController.java new file mode 100644 index 00000000..34e81a47 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/controller/admin/BaseSupplierController.java @@ -0,0 +1,91 @@ +package cn.iocoder.yudao.module.supplier.controller.admin; + +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import cn.iocoder.yudao.module.supplier.entity.BaseSupplier; +import cn.iocoder.yudao.module.supplier.service.BaseSupplierService; +import cn.iocoder.yudao.module.supplier.vo.BaseSupplierPageReqVO; +import cn.iocoder.yudao.module.supplier.vo.BaseSupplierRespVO; +import cn.iocoder.yudao.module.supplier.vo.BaseSupplierSaveReqVO; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; + +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +@Tag(name = "管理后台 - 供应商") +@RestController +@RequestMapping("/supplier/baseSupplier") +@Validated +public class BaseSupplierController { + + @Resource + private BaseSupplierService baseSupplierService; + + /** + * 新增供应商 + * + * @param saveReqVO BaseSupplierSaveReqVO实体 + * @return cn.iocoder.yudao.framework.common.pojo.CommonResult + * @author PQZ + * @date 11:00 2024/9/11 + **/ + @PostMapping("/create") + @Operation(summary = "创建供应商") + @PreAuthorize("@ss.hasPermission('supplier:base-supplier:create')") + public CommonResult createBaseSupplier(@Valid @RequestBody BaseSupplierSaveReqVO saveReqVO) { + baseSupplierService.saveBaseSupplier(saveReqVO); + return success(true); + } + + /** + * 更新供应商 + * + * @param saveReqVO BaseSupplierSaveReqVO实体 + * @return cn.iocoder.yudao.framework.common.pojo.CommonResult + * @author PQZ + * @date 11:14 2024/9/11 + **/ + @PutMapping("/update") + @Operation(summary = "更新供应商") + @PreAuthorize("@ss.hasPermission('supplier:base-supplier:update')") + public CommonResult updateBaseSupplier(@Valid @RequestBody BaseSupplierSaveReqVO saveReqVO) { + baseSupplierService.saveBaseSupplier(saveReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除供应商") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('supplier:base-supplier:delete')") + public CommonResult deleteBaseSupplier(@RequestParam("id") String id) { + baseSupplierService.deleteBaseSupplier(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得供应商") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('supplier:base-supplier:query')") + public CommonResult getBaseSupplier(@RequestParam("id") String id) { + BaseSupplier baseSupplier = baseSupplierService.getBaseSupplier(id); + return success(BeanUtils.toBean(baseSupplier, BaseSupplierRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得供应商分页") + @PreAuthorize("@ss.hasPermission('supplier:base-supplier:query')") + public CommonResult> getBaseSupplierPage(@Valid BaseSupplierPageReqVO pageReqVO) { + PageResult pageResult = baseSupplierService.getBaseSupplierPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, BaseSupplierRespVO.class)); + } + + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/entity/BaseSupplier.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/entity/BaseSupplier.java new file mode 100644 index 00000000..988fd293 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/entity/BaseSupplier.java @@ -0,0 +1,73 @@ +package cn.iocoder.yudao.module.supplier.entity; + +import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.*; + +/** + * 供应商 DO + * + * @author pqz + */ +@TableName("dl_base_supplier") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class BaseSupplier extends TenantBaseDO { + + /** + * 主键标识 + */ + @TableId(type = IdType.ASSIGN_UUID) + private String id; + /** + * 供应商名称 + */ + private String name; + /** + * 联系人 + */ + private String linkName; + /** + * 联系电话 + */ + private String linkPhone; + /** + * 联系方式 + */ + private String phone; + /** + * 传真 + */ + private String fax; + /** + * 结算方式 + */ + private String billing; + /** + * 排序 + */ + private Long sort; + /** + * 地址 + */ + private String address; + /** + * 状态 + */ + private String status; + /** + * 备注 + */ + private String remark; + /** + * 关联子公司 + */ + private String corpId; + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/entity/BaseSupplierAccount.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/entity/BaseSupplierAccount.java new file mode 100644 index 00000000..e73e5cb1 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/entity/BaseSupplierAccount.java @@ -0,0 +1,47 @@ +package cn.iocoder.yudao.module.supplier.entity; + +import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO; +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; + +/** + * 供应商关联账户 DO + * + * @author pqz + */ +@TableName("dl_base_supplier_account") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class BaseSupplierAccount extends TenantBaseDO { + + /** + * 主键标识 + */ + @TableId(type = IdType.INPUT) + private String id; + /** + * 供应商id + */ + private String supplierId; + /** + * 开户行 + */ + private String bankName; + /** + * 开户名 + */ + private String countName; + /** + * 银行卡号 + */ + private String countNo; + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/mapper/BaseSupplierAccountMapper.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/mapper/BaseSupplierAccountMapper.java new file mode 100644 index 00000000..d9178cbf --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/mapper/BaseSupplierAccountMapper.java @@ -0,0 +1,15 @@ +package cn.iocoder.yudao.module.supplier.mapper; + +import cn.iocoder.yudao.module.supplier.entity.BaseSupplierAccount; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 供应商关联账户 Mapper + * + * @author pqz + */ +@Mapper +public interface BaseSupplierAccountMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/mapper/BaseSupplierMapper.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/mapper/BaseSupplierMapper.java new file mode 100644 index 00000000..7e018786 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/mapper/BaseSupplierMapper.java @@ -0,0 +1,15 @@ +package cn.iocoder.yudao.module.supplier.mapper; + +import cn.iocoder.yudao.module.supplier.entity.BaseSupplier; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 供应商 Mapper + * + * @author pqz + */ +@Mapper +public interface BaseSupplierMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/service/BaseSupplierAccountService.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/service/BaseSupplierAccountService.java new file mode 100644 index 00000000..a212eff7 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/service/BaseSupplierAccountService.java @@ -0,0 +1,14 @@ +package cn.iocoder.yudao.module.supplier.service; + +import cn.iocoder.yudao.module.supplier.entity.BaseSupplierAccount; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * 供应商关联账户 Service 接口 + * + * @author pqz + */ +public interface BaseSupplierAccountService extends IService { + + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/service/BaseSupplierService.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/service/BaseSupplierService.java new file mode 100644 index 00000000..76272a08 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/service/BaseSupplierService.java @@ -0,0 +1,50 @@ +package cn.iocoder.yudao.module.supplier.service; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.supplier.entity.BaseSupplier; +import cn.iocoder.yudao.module.supplier.vo.BaseSupplierPageReqVO; +import cn.iocoder.yudao.module.supplier.vo.BaseSupplierSaveReqVO; +import com.baomidou.mybatisplus.extension.service.IService; + +import javax.validation.Valid; + +/** + * 供应商 Service 接口 + * + * @author pqz + */ +public interface BaseSupplierService extends IService { + + + /** + * 保存供应商 + * @author PQZ + * @date 11:00 2024/9/11 + * @param saveReqVO BaseSupplierSaveReqVO + **/ + void saveBaseSupplier(BaseSupplierSaveReqVO saveReqVO); + + /** + * 删除供应商 + * + * @param id 编号 + */ + void deleteBaseSupplier(String id); + + /** + * 获得供应商 + * + * @param id 编号 + * @return 供应商 + */ + BaseSupplier getBaseSupplier(String id); + + /** + * 获得供应商分页 + * + * @param pageReqVO 分页查询 + * @return 供应商分页 + */ + PageResult getBaseSupplierPage(BaseSupplierPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/service/impl/BaseSupplierAccountServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/service/impl/BaseSupplierAccountServiceImpl.java new file mode 100644 index 00000000..f82ad26b --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/service/impl/BaseSupplierAccountServiceImpl.java @@ -0,0 +1,20 @@ +package cn.iocoder.yudao.module.supplier.service.impl; + +import cn.iocoder.yudao.module.supplier.entity.BaseSupplierAccount; +import cn.iocoder.yudao.module.supplier.mapper.BaseSupplierAccountMapper; +import cn.iocoder.yudao.module.supplier.service.BaseSupplierAccountService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +/** + * 供应商关联账户 Service 实现类 + * + * @author pqz + */ +@Service +@Validated +public class BaseSupplierAccountServiceImpl extends ServiceImpl implements BaseSupplierAccountService { + + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/service/impl/BaseSupplierServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/service/impl/BaseSupplierServiceImpl.java new file mode 100644 index 00000000..303cbf84 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/service/impl/BaseSupplierServiceImpl.java @@ -0,0 +1,60 @@ +package cn.iocoder.yudao.module.supplier.service.impl; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import cn.iocoder.yudao.module.supplier.entity.BaseSupplier; +import cn.iocoder.yudao.module.supplier.mapper.BaseSupplierMapper; +import cn.iocoder.yudao.module.supplier.service.BaseSupplierService; +import cn.iocoder.yudao.module.supplier.vo.BaseSupplierPageReqVO; +import cn.iocoder.yudao.module.supplier.vo.BaseSupplierSaveReqVO; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +import javax.annotation.Resource; + +/** + * 供应商 Service 实现类 + * + * @author pqz + */ +@Service +@Validated +public class BaseSupplierServiceImpl extends ServiceImpl implements BaseSupplierService { + + @Resource + private BaseSupplierMapper baseSupplierMapper; + + /** + * 保存供应商 + * + * @param saveReqVO BaseSupplierSaveReqVO + * @author PQZ + * @date 11:00 2024/9/11 + **/ + @Override + public void saveBaseSupplier(BaseSupplierSaveReqVO saveReqVO) { + + } + + + + @Override + public void deleteBaseSupplier(String id) { + // 校验存在 + baseSupplierMapper.deleteById(id); + } + + + + @Override + public BaseSupplier getBaseSupplier(String id) { + return baseSupplierMapper.selectById(id); + } + + @Override + public PageResult getBaseSupplierPage(BaseSupplierPageReqVO pageReqVO) { + return null; + } + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/vo/BaseSupplierAccountPageReqVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/vo/BaseSupplierAccountPageReqVO.java new file mode 100644 index 00000000..d39ea317 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/vo/BaseSupplierAccountPageReqVO.java @@ -0,0 +1,34 @@ +package cn.iocoder.yudao.module.supplier.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 供应商关联账户分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class BaseSupplierAccountPageReqVO extends PageParam { + + @Schema(description = "供应商id", example = "9583") + private String supplierId; + + @Schema(description = "开户行", example = "王五") + private String bankName; + + @Schema(description = "开户名", example = "李四") + private String countName; + + @Schema(description = "银行卡号") + private String countNo; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/vo/BaseSupplierAccountRespVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/vo/BaseSupplierAccountRespVO.java new file mode 100644 index 00000000..af5812a4 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/vo/BaseSupplierAccountRespVO.java @@ -0,0 +1,35 @@ +package cn.iocoder.yudao.module.supplier.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 供应商关联账户 Response VO") +@Data +@ExcelIgnoreUnannotated +public class BaseSupplierAccountRespVO { + + @Schema(description = "供应商id", example = "9583") + @ExcelProperty("供应商id") + private String supplierId; + + @Schema(description = "开户行", example = "王五") + @ExcelProperty("开户行") + private String bankName; + + @Schema(description = "开户名", example = "李四") + @ExcelProperty("开户名") + private String countName; + + @Schema(description = "银行卡号") + @ExcelProperty("银行卡号") + private String countNo; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/vo/BaseSupplierAccountSaveReqVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/vo/BaseSupplierAccountSaveReqVO.java new file mode 100644 index 00000000..81f6a839 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/vo/BaseSupplierAccountSaveReqVO.java @@ -0,0 +1,12 @@ +package cn.iocoder.yudao.module.supplier.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import javax.validation.constraints.*; + +@Schema(description = "管理后台 - 供应商关联账户新增/修改 Request VO") +@Data +public class BaseSupplierAccountSaveReqVO { + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/vo/BaseSupplierPageReqVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/vo/BaseSupplierPageReqVO.java new file mode 100644 index 00000000..e04298c3 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/vo/BaseSupplierPageReqVO.java @@ -0,0 +1,23 @@ +package cn.iocoder.yudao.module.supplier.vo; + +import cn.iocoder.yudao.module.supplier.entity.BaseSupplier; +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; + +import javax.validation.constraints.Max; +import javax.validation.constraints.Min; +import javax.validation.constraints.NotNull; +import java.time.LocalDateTime; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 供应商分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class BaseSupplierPageReqVO extends BaseSupplier { + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/vo/BaseSupplierRespVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/vo/BaseSupplierRespVO.java new file mode 100644 index 00000000..d259420f --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/vo/BaseSupplierRespVO.java @@ -0,0 +1,14 @@ +package cn.iocoder.yudao.module.supplier.vo; + +import cn.iocoder.yudao.module.supplier.entity.BaseSupplier; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 供应商 Response VO") +@Data +@ExcelIgnoreUnannotated +public class BaseSupplierRespVO extends BaseSupplier { + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/vo/BaseSupplierSaveReqVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/vo/BaseSupplierSaveReqVO.java new file mode 100644 index 00000000..3d812536 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/vo/BaseSupplierSaveReqVO.java @@ -0,0 +1,16 @@ +package cn.iocoder.yudao.module.supplier.vo; + +import cn.iocoder.yudao.module.supplier.entity.BaseSupplier; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import javax.validation.constraints.*; + +@Schema(description = "管理后台 - 供应商新增/修改 Request VO") +@Data +public class BaseSupplierSaveReqVO extends BaseSupplier { + + + + +} \ No newline at end of file diff --git a/dl-module-base/src/main/resources/mapper/supplier/BaseSupplierAccountMapper.xml b/dl-module-base/src/main/resources/mapper/supplier/BaseSupplierAccountMapper.xml new file mode 100644 index 00000000..088b7f62 --- /dev/null +++ b/dl-module-base/src/main/resources/mapper/supplier/BaseSupplierAccountMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/dl-module-base/src/main/resources/mapper/supplier/BaseSupplierMapper.xml b/dl-module-base/src/main/resources/mapper/supplier/BaseSupplierMapper.xml new file mode 100644 index 00000000..918fe026 --- /dev/null +++ b/dl-module-base/src/main/resources/mapper/supplier/BaseSupplierMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file