Browse Source
feat(logistics): 添加物流管理模块功能
feat(logistics): 添加物流管理模块功能
- 新增 LogisticsController 提供物流记录查询和PO清单查询接口 - 创建 LogisticsMainData、LogisticsPoData、LogisticsSearchData、 LogisticsPoSearchData 数据模型类 - 实现 LogisticsMapper 接口及对应的 MyBatis XML 映射文件 - 完成 LogisticsService 接口定义和 LogisticsServiceImpl 实现类 - 集成分页查询功能支持物流数据的分页展示 - 添加进仓编号、供应商编码、供应商名称等多维度查询条件master
9 changed files with 265 additions and 0 deletions
-
38src/main/java/com/xujie/modules/npcIqc/controller/LogisticsController.java
-
23src/main/java/com/xujie/modules/npcIqc/data/LogisticsMainData.java
-
23src/main/java/com/xujie/modules/npcIqc/data/LogisticsPoData.java
-
19src/main/java/com/xujie/modules/npcIqc/data/LogisticsPoSearchData.java
-
24src/main/java/com/xujie/modules/npcIqc/data/LogisticsSearchData.java
-
25src/main/java/com/xujie/modules/npcIqc/mapper/LogisticsMapper.java
-
18src/main/java/com/xujie/modules/npcIqc/service/LogisticsService.java
-
34src/main/java/com/xujie/modules/npcIqc/service/impl/LogisticsServiceImpl.java
-
61src/main/resources/mapper/npcIqc/LogisticsMapper.xml
@ -0,0 +1,38 @@ |
|||
package com.xujie.modules.npcIqc.controller; |
|||
|
|||
import com.xujie.common.utils.PageUtils; |
|||
import com.xujie.common.utils.R; |
|||
import com.xujie.modules.npcIqc.data.LogisticsPoSearchData; |
|||
import com.xujie.modules.npcIqc.data.LogisticsSearchData; |
|||
import com.xujie.modules.npcIqc.service.LogisticsService; |
|||
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; |
|||
|
|||
@RestController |
|||
@RequestMapping("/srm/logistics") |
|||
public class LogisticsController { |
|||
|
|||
@Autowired |
|||
private LogisticsService logisticsService; |
|||
|
|||
/** |
|||
* 查询物流记录 |
|||
*/ |
|||
@PostMapping("/search") |
|||
public R search(@RequestBody LogisticsSearchData searchData){ |
|||
PageUtils page = logisticsService.queryPage(searchData); |
|||
return R.ok().put("page", page); |
|||
} |
|||
|
|||
/** |
|||
* 查询PO清单 |
|||
*/ |
|||
@PostMapping("/getPoList") |
|||
public R getPoList(@RequestBody LogisticsPoSearchData searchData){ |
|||
PageUtils page = logisticsService.getPoListPage(searchData); |
|||
return R.ok().put("page", page); |
|||
} |
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
package com.xujie.modules.npcIqc.data; |
|||
|
|||
import lombok.Data; |
|||
|
|||
@Data |
|||
public class LogisticsMainData { |
|||
|
|||
private String flexId; |
|||
|
|||
private String supplierNo; |
|||
|
|||
private String supplierName; |
|||
|
|||
/** |
|||
* PO数量 |
|||
*/ |
|||
private Integer poCount; |
|||
|
|||
/** |
|||
* 发货数量 |
|||
*/ |
|||
private Double shippedQty; |
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
package com.xujie.modules.npcIqc.data; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
@Data |
|||
public class LogisticsPoData { |
|||
|
|||
private String orderNo; |
|||
|
|||
private Integer itemNo; |
|||
|
|||
private String partNo; |
|||
|
|||
private Date orderDate; |
|||
|
|||
private Double qty; |
|||
|
|||
private Double shippedQty; |
|||
|
|||
private String flexId; |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
package com.xujie.modules.npcIqc.data; |
|||
import com.xujie.common.utils.QueryPage; |
|||
import lombok.Data; |
|||
|
|||
@Data |
|||
public class LogisticsPoSearchData extends QueryPage { |
|||
|
|||
private String site; |
|||
|
|||
/** |
|||
* 进仓编号 |
|||
*/ |
|||
private String flexId; |
|||
|
|||
/** |
|||
* 供应商编码 |
|||
*/ |
|||
private String supplierNo; |
|||
} |
|||
@ -0,0 +1,24 @@ |
|||
package com.xujie.modules.npcIqc.data; |
|||
import com.xujie.common.utils.QueryPage; |
|||
import lombok.Data; |
|||
|
|||
@Data |
|||
public class LogisticsSearchData extends QueryPage { |
|||
|
|||
private String site; |
|||
|
|||
/** |
|||
* 进仓编号 |
|||
*/ |
|||
private String flexId; |
|||
|
|||
/** |
|||
* 供应商编码 |
|||
*/ |
|||
private String supplierNo; |
|||
|
|||
/** |
|||
* 供应商名称 |
|||
*/ |
|||
private String supplierName; |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
package com.xujie.modules.npcIqc.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.xujie.modules.npcIqc.data.LogisticsMainData; |
|||
import com.xujie.modules.npcIqc.data.LogisticsPoData; |
|||
import com.xujie.modules.npcIqc.data.LogisticsPoSearchData; |
|||
import com.xujie.modules.npcIqc.data.LogisticsSearchData; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
@Mapper |
|||
public interface LogisticsMapper { |
|||
|
|||
/** |
|||
* 查询物流记录(分页) |
|||
*/ |
|||
IPage<LogisticsMainData> queryPage(Page<?> page, @Param("param") LogisticsSearchData searchData); |
|||
|
|||
/** |
|||
* 查询PO清单(分页) |
|||
*/ |
|||
IPage<LogisticsPoData> getPoListPage(Page<?> page, @Param("param") LogisticsPoSearchData searchData); |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
package com.xujie.modules.npcIqc.service; |
|||
|
|||
import com.xujie.common.utils.PageUtils; |
|||
import com.xujie.modules.npcIqc.data.LogisticsPoSearchData; |
|||
import com.xujie.modules.npcIqc.data.LogisticsSearchData; |
|||
|
|||
public interface LogisticsService { |
|||
|
|||
/** |
|||
* 查询物流记录(分页) |
|||
*/ |
|||
PageUtils queryPage(LogisticsSearchData searchData); |
|||
|
|||
/** |
|||
* 查询PO清单(分页) |
|||
*/ |
|||
PageUtils getPoListPage(LogisticsPoSearchData searchData); |
|||
} |
|||
@ -0,0 +1,34 @@ |
|||
package com.xujie.modules.npcIqc.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.xujie.common.utils.PageUtils; |
|||
import com.xujie.modules.npcIqc.data.LogisticsMainData; |
|||
import com.xujie.modules.npcIqc.data.LogisticsPoData; |
|||
import com.xujie.modules.npcIqc.data.LogisticsPoSearchData; |
|||
import com.xujie.modules.npcIqc.data.LogisticsSearchData; |
|||
import com.xujie.modules.npcIqc.mapper.LogisticsMapper; |
|||
import com.xujie.modules.npcIqc.service.LogisticsService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
@Service |
|||
public class LogisticsServiceImpl implements LogisticsService { |
|||
|
|||
@Autowired |
|||
private LogisticsMapper logisticsMapper; |
|||
|
|||
@Override |
|||
public PageUtils queryPage(LogisticsSearchData searchData) { |
|||
Page<LogisticsMainData> page = new Page<>(searchData.getPage(), searchData.getLimit()); |
|||
IPage<LogisticsMainData> resultList = logisticsMapper.queryPage(page, searchData); |
|||
return new PageUtils(resultList); |
|||
} |
|||
|
|||
@Override |
|||
public PageUtils getPoListPage(LogisticsPoSearchData searchData) { |
|||
Page<LogisticsPoData> page = new Page<>(searchData.getPage(), searchData.getLimit()); |
|||
IPage<LogisticsPoData> resultList = logisticsMapper.getPoListPage(page, searchData); |
|||
return new PageUtils(resultList); |
|||
} |
|||
} |
|||
@ -0,0 +1,61 @@ |
|||
<?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.xujie.modules.npcIqc.mapper.LogisticsMapper"> |
|||
|
|||
<!-- 查询物流记录 --> |
|||
<select id="queryPage" resultType="com.xujie.modules.npcIqc.data.LogisticsMainData"> |
|||
SELECT |
|||
d.c_flexid AS flexId, |
|||
h.supplier_no AS supplierNo, |
|||
ISNULL(s.supplier_name, '') AS supplierName, |
|||
COUNT(DISTINCT d.order_no) AS poCount, |
|||
ISNULL(SUM(d.shipped_qty), 0) AS shippedQty |
|||
FROM PODetail d |
|||
INNER JOIN POHeader h |
|||
ON d.order_no = h.order_no |
|||
AND d.site = h.site |
|||
LEFT JOIN srm_supplier s |
|||
ON h.supplier_no = s.supplier_no |
|||
WHERE d.site = #{param.site} |
|||
AND ISNULL(d.c_flexid, '') != '' |
|||
<if test="param.flexId != null and param.flexId != ''"> |
|||
AND d.c_flexid LIKE '%' + #{param.flexId} + '%' |
|||
</if> |
|||
<if test="param.supplierNo != null and param.supplierNo != ''"> |
|||
AND h.supplier_no LIKE '%' + #{param.supplierNo} + '%' |
|||
</if> |
|||
<if test="param.supplierName != null and param.supplierName != ''"> |
|||
AND s.supplier_name LIKE '%' + #{param.supplierName} + '%' |
|||
</if> |
|||
GROUP BY |
|||
d.c_flexid, |
|||
h.supplier_no, |
|||
s.supplier_name |
|||
ORDER BY d.c_flexid DESC |
|||
</select> |
|||
|
|||
<!-- 查询PO清单 --> |
|||
<select id="getPoListPage" resultType="com.xujie.modules.npcIqc.data.LogisticsPoData"> |
|||
SELECT |
|||
d.order_no AS orderNo, |
|||
d.item_no AS itemNo, |
|||
d.part_no AS partNo, |
|||
h.order_date AS orderDate, |
|||
d.qty, |
|||
d.shipped_qty AS shippedQty, |
|||
d.c_flexid AS flexId, |
|||
p.sku |
|||
FROM PODetail d |
|||
LEFT JOIN POHeader h |
|||
ON d.order_no = h.order_no |
|||
AND d.site = h.site |
|||
LEFT JOIN part p |
|||
ON d.part_no = p.part_no |
|||
and d.site = p.site |
|||
WHERE d.c_flexid = #{param.flexId} |
|||
AND d.site = #{param.site} |
|||
AND h.supplier_no = #{param.supplierNo} |
|||
ORDER BY h.order_date DESC |
|||
</select> |
|||
|
|||
</mapper> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue