Forráskód Böngészése

货代公司管理

yzc 2 éve
szülő
commit
76be618650

+ 68 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/controller/freight/FreightForwarderController.java

@@ -0,0 +1,68 @@
+package com.fjhx.ehsd.controller.freight;
+
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.ehsd.entity.freight.vo.FreightForwarderVo;
+import com.fjhx.ehsd.entity.freight.dto.FreightForwarderSelectDto;
+import com.fjhx.ehsd.entity.freight.dto.FreightForwarderDto;
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import com.fjhx.ehsd.service.freight.FreightForwarderService;
+import org.springframework.beans.factory.annotation.Autowired;
+
+
+/**
+ * <p>
+ * 货代公司管理 前端控制器
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-05
+ */
+@RestController
+@RequestMapping("/freightForwarder")
+public class FreightForwarderController {
+
+    @Autowired
+    private FreightForwarderService freightForwarderService;
+
+    /**
+     * 货代公司管理分页
+     */
+    @PostMapping("/page")
+    public Page<FreightForwarderVo> page(@RequestBody FreightForwarderSelectDto dto) {
+        return freightForwarderService.getPage(dto);
+    }
+
+    /**
+     * 货代公司管理明细
+     */
+    @PostMapping("/detail")
+    public FreightForwarderVo detail(@RequestBody BaseSelectDto dto) {
+        return freightForwarderService.detail(dto.getId());
+    }
+
+    /**
+     * 货代公司管理新增
+     */
+    @PostMapping("/add")
+    public void add(@RequestBody FreightForwarderDto freightForwarderDto) {
+        freightForwarderService.add(freightForwarderDto);
+    }
+
+    /**
+     * 货代公司管理编辑
+     */
+    @PostMapping("/edit")
+    public void edit(@RequestBody FreightForwarderDto freightForwarderDto) {
+        freightForwarderService.edit(freightForwarderDto);
+    }
+
+    /**
+     * 货代公司管理删除
+     */
+    @PostMapping("/delete")
+    public void delete(@RequestBody BaseSelectDto dto) {
+        freightForwarderService.delete(dto.getId());
+    }
+
+}

+ 17 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/entity/freight/dto/FreightForwarderDto.java

@@ -0,0 +1,17 @@
+package com.fjhx.ehsd.entity.freight.dto;
+
+import com.fjhx.ehsd.entity.freight.po.FreightForwarder;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 货代公司管理新增编辑入参实体
+ *
+ * @author 
+ * @since 2023-05-05
+ */
+@Getter
+@Setter
+public class FreightForwarderDto extends FreightForwarder {
+
+}

+ 17 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/entity/freight/dto/FreightForwarderSelectDto.java

@@ -0,0 +1,17 @@
+package com.fjhx.ehsd.entity.freight.dto;
+
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 货代公司管理列表查询入参实体
+ *
+ * @author 
+ * @since 2023-05-05
+ */
+@Getter
+@Setter
+public class FreightForwarderSelectDto extends BaseSelectDto {
+
+}

+ 82 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/entity/freight/po/FreightForwarder.java

@@ -0,0 +1,82 @@
+package com.fjhx.ehsd.entity.freight.po;
+
+import com.ruoyi.common.core.domain.BasePo;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 货代公司管理
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-05
+ */
+@Getter
+@Setter
+@TableName("freight_forwarder")
+public class FreightForwarder extends BasePo {
+
+    /**
+     * 公司名称
+     */
+    private String companyName;
+
+    /**
+     * 公司电话
+     */
+    private String companyTel;
+
+    /**
+     * 省份
+     */
+    private String province;
+
+    /**
+     * 城市
+     */
+    private String city;
+
+    /**
+     * 地址
+     */
+    private String address;
+
+    /**
+     * 联系人
+     */
+    private String personName;
+
+    /**
+     * 联系电话
+     */
+    private String personTel;
+
+    /**
+     * 联系人邮箱
+     */
+    private String personMail;
+
+    /**
+     * 统一社会信用代码
+     */
+    private String unifiedCode;
+
+    /**
+     * 银行
+     */
+    private String bankName;
+
+    /**
+     * 账户名
+     */
+    private String bankAccountName;
+
+    /**
+     * 账户
+     */
+    private String bankAccount;
+
+}

+ 17 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/entity/freight/vo/FreightForwarderVo.java

@@ -0,0 +1,17 @@
+package com.fjhx.ehsd.entity.freight.vo;
+
+import com.fjhx.ehsd.entity.freight.po.FreightForwarder;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 货代公司管理列表查询返回值实体
+ *
+ * @author 
+ * @since 2023-05-05
+ */
+@Getter
+@Setter
+public class FreightForwarderVo extends FreightForwarder {
+
+}

+ 26 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/mapper/freight/FreightForwarderMapper.java

@@ -0,0 +1,26 @@
+package com.fjhx.ehsd.mapper.freight;
+
+import com.fjhx.ehsd.entity.freight.po.FreightForwarder;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.ehsd.entity.freight.vo.FreightForwarderVo;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import org.apache.ibatis.annotations.Param;
+
+
+/**
+ * <p>
+ * 货代公司管理 Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-05
+ */
+public interface FreightForwarderMapper extends BaseMapper<FreightForwarder> {
+
+    /**
+     * 货代公司管理分页
+     */
+    Page<FreightForwarderVo> getPage(@Param("page") Page<Object> page, @Param("ew") IWrapper<FreightForwarder> wrapper);
+
+}

+ 46 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/service/freight/FreightForwarderService.java

@@ -0,0 +1,46 @@
+package com.fjhx.ehsd.service.freight;
+
+import com.fjhx.ehsd.entity.freight.po.FreightForwarder;
+import com.ruoyi.common.core.service.BaseService;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.ehsd.entity.freight.vo.FreightForwarderVo;
+import com.fjhx.ehsd.entity.freight.dto.FreightForwarderSelectDto;
+import com.fjhx.ehsd.entity.freight.dto.FreightForwarderDto;
+
+
+/**
+ * <p>
+ * 货代公司管理 服务类
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-05
+ */
+public interface FreightForwarderService extends BaseService<FreightForwarder> {
+
+    /**
+     * 货代公司管理分页
+     */
+    Page<FreightForwarderVo> getPage(FreightForwarderSelectDto dto);
+
+    /**
+     * 货代公司管理明细
+     */
+    FreightForwarderVo detail(Long id);
+
+    /**
+     * 货代公司管理新增
+     */
+    void add(FreightForwarderDto freightForwarderDto);
+
+    /**
+     * 货代公司管理编辑
+     */
+    void edit(FreightForwarderDto freightForwarderDto);
+
+    /**
+     * 货代公司管理删除
+     */
+    void delete(Long id);
+
+}

+ 58 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/service/freight/impl/FreightForwarderServiceImpl.java

@@ -0,0 +1,58 @@
+package com.fjhx.ehsd.service.freight.impl;
+
+import cn.hutool.core.bean.BeanUtil;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fjhx.ehsd.entity.freight.dto.FreightForwarderDto;
+import com.fjhx.ehsd.entity.freight.dto.FreightForwarderSelectDto;
+import com.fjhx.ehsd.entity.freight.po.FreightForwarder;
+import com.fjhx.ehsd.entity.freight.vo.FreightForwarderVo;
+import com.fjhx.ehsd.mapper.freight.FreightForwarderMapper;
+import com.fjhx.ehsd.service.freight.FreightForwarderService;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import org.springframework.stereotype.Service;
+
+
+/**
+ * <p>
+ * 货代公司管理 服务实现类
+ * </p>
+ *
+ * @author
+ * @since 2023-05-05
+ */
+@Service
+public class FreightForwarderServiceImpl extends ServiceImpl<FreightForwarderMapper, FreightForwarder> implements FreightForwarderService {
+
+    @Override
+    public Page<FreightForwarderVo> getPage(FreightForwarderSelectDto dto) {
+        IWrapper<FreightForwarder> wrapper = getWrapper();
+        wrapper.like("ff", FreightForwarder::getCompanyName, dto.getKeyword());
+        wrapper.orderByDesc("ff", FreightForwarder::getId);
+        Page<FreightForwarderVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
+        return page;
+    }
+
+    @Override
+    public FreightForwarderVo detail(Long id) {
+        FreightForwarder FreightForwarder = this.getById(id);
+        FreightForwarderVo result = BeanUtil.toBean(FreightForwarder, FreightForwarderVo.class);
+        return result;
+    }
+
+    @Override
+    public void add(FreightForwarderDto freightForwarderDto) {
+        this.save(freightForwarderDto);
+    }
+
+    @Override
+    public void edit(FreightForwarderDto freightForwarderDto) {
+        this.updateById(freightForwarderDto);
+    }
+
+    @Override
+    public void delete(Long id) {
+        this.removeById(id);
+    }
+
+}

+ 27 - 0
hx-ehsd/src/main/resources/mapper/freight/FreightForwarderMapper.xml

@@ -0,0 +1,27 @@
+<?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.fjhx.ehsd.mapper.freight.FreightForwarderMapper">
+    <select id="getPage" resultType="com.fjhx.ehsd.entity.freight.vo.FreightForwarderVo">
+        select
+            ff.id,
+            ff.company_name,
+            ff.company_tel,
+            ff.province,
+            ff.city,
+            ff.address,
+            ff.person_name,
+            ff.person_tel,
+            ff.person_mail,
+            ff.unified_code,
+            ff.bank_name,
+            ff.bank_account_name,
+            ff.bank_account,
+            ff.create_user,
+            ff.create_time,
+            ff.update_user,
+            ff.update_time
+        from freight_forwarder ff
+            ${ew.customSqlSegment}
+    </select>
+
+</mapper>