Răsfoiți Sursa

快递月发生额

yzc 11 luni în urmă
părinte
comite
67ad009bd6

+ 46 - 0
hx-common/src/main/java/com/fjhx/common/controller/logistics/LogisticsAmountController.java

@@ -0,0 +1,46 @@
+package com.fjhx.common.controller.logistics;
+
+import com.fjhx.common.entity.logistics.dto.LogisticsAmountDto;
+import com.fjhx.common.entity.logistics.dto.LogisticsAmountSelectDto;
+import com.fjhx.common.entity.logistics.vo.LogisticsAmountVo;
+import com.fjhx.common.service.logistics.LogisticsAmountService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 物流发生额 前端控制器
+ * </p>
+ *
+ * @author
+ * @since 2024-05-06
+ */
+@RestController
+@RequestMapping("/logisticsAmount")
+public class LogisticsAmountController {
+
+    @Autowired
+    private LogisticsAmountService logisticsAmountService;
+
+    /**
+     * 物流发生额列表
+     */
+    @PostMapping("/list")
+    public List<LogisticsAmountVo> list(@RequestBody LogisticsAmountSelectDto dto) {
+        return logisticsAmountService.getList(dto);
+    }
+
+    /**
+     * 物流发生额编辑
+     */
+    @PostMapping("/saveOrEdit")
+    public void saveOrEdit(@RequestBody LogisticsAmountDto logisticsAmountDto) {
+        logisticsAmountService.saveOrEdit(logisticsAmountDto);
+    }
+
+}

+ 17 - 0
hx-common/src/main/java/com/fjhx/common/entity/logistics/dto/LogisticsAmountDto.java

@@ -0,0 +1,17 @@
+package com.fjhx.common.entity.logistics.dto;
+
+import com.fjhx.common.entity.logistics.po.LogisticsAmount;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 物流发生额新增编辑入参实体
+ *
+ * @author
+ * @since 2024-05-06
+ */
+@Getter
+@Setter
+public class LogisticsAmountDto extends LogisticsAmount {
+
+}

+ 27 - 0
hx-common/src/main/java/com/fjhx/common/entity/logistics/dto/LogisticsAmountSelectDto.java

@@ -0,0 +1,27 @@
+package com.fjhx.common.entity.logistics.dto;
+
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 物流发生额列表查询入参实体
+ *
+ * @author
+ * @since 2024-05-06
+ */
+@Getter
+@Setter
+public class LogisticsAmountSelectDto extends BaseSelectDto {
+
+    /**
+     * 物流公司id
+     */
+    private Long logisticsCompanyId;
+
+    /**
+     * 年份
+     */
+    private Integer year;
+
+}

+ 107 - 0
hx-common/src/main/java/com/fjhx/common/entity/logistics/po/LogisticsAmount.java

@@ -0,0 +1,107 @@
+package com.fjhx.common.entity.logistics.po;
+
+import com.baomidou.mybatisplus.annotation.FieldStrategy;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.ruoyi.common.core.domain.BasePo;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.math.BigDecimal;
+
+/**
+ * <p>
+ * 物流发生额
+ * </p>
+ *
+ * @author
+ * @since 2024-05-06
+ */
+@Getter
+@Setter
+@TableName("logistics_amount")
+public class LogisticsAmount extends BasePo {
+
+    /**
+     * 物流公司id
+     */
+    private Long logisticsCompanyId;
+
+    /**
+     * 年份
+     */
+    private Integer year;
+
+    /**
+     * 1月
+     */
+    @TableField(updateStrategy = FieldStrategy.IGNORED)
+    private BigDecimal month1Amount;
+
+    /**
+     * 2月
+     */
+    @TableField(updateStrategy = FieldStrategy.IGNORED)
+    private BigDecimal month2Amount;
+
+    /**
+     * 3月
+     */
+    @TableField(updateStrategy = FieldStrategy.IGNORED)
+    private BigDecimal month3Amount;
+
+    /**
+     * 4月
+     */
+    @TableField(updateStrategy = FieldStrategy.IGNORED)
+    private BigDecimal month4Amount;
+
+    /**
+     * 5月
+     */
+    @TableField(updateStrategy = FieldStrategy.IGNORED)
+    private BigDecimal month5Amount;
+
+    /**
+     * 6月
+     */
+    @TableField(updateStrategy = FieldStrategy.IGNORED)
+    private BigDecimal month6Amount;
+
+    /**
+     * 7月
+     */
+    @TableField(updateStrategy = FieldStrategy.IGNORED)
+    private BigDecimal month7Amount;
+
+    /**
+     * 8月
+     */
+    @TableField(updateStrategy = FieldStrategy.IGNORED)
+    private BigDecimal month8Amount;
+
+    /**
+     * 9月
+     */
+    @TableField(updateStrategy = FieldStrategy.IGNORED)
+    private BigDecimal month9Amount;
+
+    /**
+     * 10月
+     */
+    @TableField(updateStrategy = FieldStrategy.IGNORED)
+    private BigDecimal month10Amount;
+
+    /**
+     * 11月
+     */
+    @TableField(updateStrategy = FieldStrategy.IGNORED)
+    private BigDecimal month11Amount;
+
+    /**
+     * 12月
+     */
+    @TableField(updateStrategy = FieldStrategy.IGNORED)
+    private BigDecimal month12Amount;
+
+}

+ 17 - 0
hx-common/src/main/java/com/fjhx/common/entity/logistics/vo/LogisticsAmountVo.java

@@ -0,0 +1,17 @@
+package com.fjhx.common.entity.logistics.vo;
+
+import com.fjhx.common.entity.logistics.po.LogisticsAmount;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 物流发生额列表查询返回值实体
+ *
+ * @author
+ * @since 2024-05-06
+ */
+@Getter
+@Setter
+public class LogisticsAmountVo extends LogisticsAmount {
+
+}

+ 26 - 0
hx-common/src/main/java/com/fjhx/common/mapper/logistics/LogisticsAmountMapper.java

@@ -0,0 +1,26 @@
+package com.fjhx.common.mapper.logistics;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fjhx.common.entity.logistics.po.LogisticsAmount;
+import com.fjhx.common.entity.logistics.vo.LogisticsAmountVo;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 物流发生额 Mapper 接口
+ * </p>
+ *
+ * @author
+ * @since 2024-05-06
+ */
+public interface LogisticsAmountMapper extends BaseMapper<LogisticsAmount> {
+
+    /**
+     * 物流发生额列表
+     */
+    List<LogisticsAmountVo> getList(@Param("ew") IWrapper<LogisticsAmount> wrapper);
+
+}

+ 31 - 0
hx-common/src/main/java/com/fjhx/common/service/logistics/LogisticsAmountService.java

@@ -0,0 +1,31 @@
+package com.fjhx.common.service.logistics;
+
+import com.fjhx.common.entity.logistics.dto.LogisticsAmountDto;
+import com.fjhx.common.entity.logistics.dto.LogisticsAmountSelectDto;
+import com.fjhx.common.entity.logistics.po.LogisticsAmount;
+import com.fjhx.common.entity.logistics.vo.LogisticsAmountVo;
+import com.ruoyi.common.core.service.BaseService;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 物流发生额 服务类
+ * </p>
+ *
+ * @author
+ * @since 2024-05-06
+ */
+public interface LogisticsAmountService extends BaseService<LogisticsAmount> {
+
+    /**
+     * 物流发生额列表
+     */
+    List<LogisticsAmountVo> getList(LogisticsAmountSelectDto dto);
+
+    /**
+     * 物流发生额编辑
+     */
+    void saveOrEdit(LogisticsAmountDto logisticsAmountDto);
+
+}

+ 43 - 0
hx-common/src/main/java/com/fjhx/common/service/logistics/impl/LogisticsAmountServiceImpl.java

@@ -0,0 +1,43 @@
+package com.fjhx.common.service.logistics.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fjhx.common.entity.logistics.dto.LogisticsAmountDto;
+import com.fjhx.common.entity.logistics.dto.LogisticsAmountSelectDto;
+import com.fjhx.common.entity.logistics.po.LogisticsAmount;
+import com.fjhx.common.entity.logistics.vo.LogisticsAmountVo;
+import com.fjhx.common.mapper.logistics.LogisticsAmountMapper;
+import com.fjhx.common.service.logistics.LogisticsAmountService;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 物流发生额 服务实现类
+ * </p>
+ *
+ * @author
+ * @since 2024-05-06
+ */
+@Service
+public class LogisticsAmountServiceImpl extends ServiceImpl<LogisticsAmountMapper, LogisticsAmount> implements LogisticsAmountService {
+
+    @Override
+    public List<LogisticsAmountVo> getList(LogisticsAmountSelectDto dto) {
+        IWrapper<LogisticsAmount> wrapper = getWrapper();
+
+        wrapper.eq("la", LogisticsAmount::getYear, dto.getYear());
+        wrapper.eq("la", LogisticsAmount::getLogisticsCompanyId, dto.getYear());
+
+        wrapper.orderByDesc("la", LogisticsAmount::getYear);
+        List<LogisticsAmountVo> list = this.baseMapper.getList(wrapper);
+        return list;
+    }
+
+    @Override
+    public void saveOrEdit(LogisticsAmountDto logisticsAmountDto) {
+        this.saveOrUpdate(logisticsAmountDto);
+    }
+
+}

+ 28 - 0
hx-common/src/main/resources/mapper/logistics/LogisticsAmountMapper.xml

@@ -0,0 +1,28 @@
+<?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.common.mapper.logistics.LogisticsAmountMapper">
+    <select id="getList" resultType="com.fjhx.common.entity.logistics.vo.LogisticsAmountVo">
+        select la.id,
+               la.logistics_company_id,
+               la.year,
+               la.month1_amount,
+               la.month2_amount,
+               la.month3_amount,
+               la.month4_amount,
+               la.month5_amount,
+               la.month6_amount,
+               la.month7_amount,
+               la.month8_amount,
+               la.month9_amount,
+               la.month10_amount,
+               la.month11_amount,
+               la.month12_amount,
+               la.create_user,
+               la.create_time,
+               la.update_user,
+               la.update_time
+        from logistics_amount la
+            ${ew.customSqlSegment}
+    </select>
+
+</mapper>