常熟吴彦祖 2 months ago
parent
commit
24a063f95e
  1. 17
      src/main/java/com/heai/modules/production/controller/OutboundLabelScanController.java
  2. 7
      src/main/java/com/heai/modules/production/dao/OutboundLabelScanMapper.java
  3. 21
      src/main/java/com/heai/modules/production/entity/OutboundLabelDetailQueryData.java
  4. 53
      src/main/java/com/heai/modules/production/entity/OutboundLabelDetailRowData.java
  5. 5
      src/main/java/com/heai/modules/production/service/OutboundLabelScanService.java
  6. 20
      src/main/java/com/heai/modules/production/service/impl/OutboundLabelScanServiceImpl.java
  7. 81
      src/main/resources/mapper/production/OutboundLabelScanMapper.xml

17
src/main/java/com/heai/modules/production/controller/OutboundLabelScanController.java

@ -1,6 +1,9 @@
package com.heai.modules.production.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.heai.common.utils.R;
import com.heai.modules.production.entity.OutboundLabelDetailQueryData;
import com.heai.modules.production.entity.OutboundLabelDetailRowData;
import com.heai.modules.production.entity.OutboundLabelScanData;
import com.heai.modules.production.entity.OutboundLabelScan;
import com.heai.modules.production.entity.PrintLabelRecord;
@ -23,6 +26,20 @@ public class OutboundLabelScanController {
return R.ok().put("rows",list);
}
/**
* @Description 发货明细关联主表分页查询 - rqrq
* @Title searchOutboundLabelDetailPage
* @param queryData 查询参数 - rqrq
* @return 分页结果 - rqrq
* @author rqrq
* @date 2026/07/24
*/
@PostMapping("/detail/page")
public R searchOutboundLabelDetailPage(@RequestBody OutboundLabelDetailQueryData queryData){
IPage<OutboundLabelDetailRowData> page = outboundLabelScanService.searchOutboundLabelDetailPage(queryData);
return R.ok().put("page", page);
}
/**
* @Description 查询先进先出更早日期袋贴 - rqrq
* @Title queryEarlierInboundBagList

7
src/main/java/com/heai/modules/production/dao/OutboundLabelScanMapper.java

@ -1,7 +1,11 @@
package com.heai.modules.production.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.heai.modules.production.entity.OutboundLabelScan;
import com.heai.modules.production.entity.OutboundLabelDetailQueryData;
import com.heai.modules.production.entity.OutboundLabelDetailRowData;
import com.heai.modules.production.entity.OutboundLabelScanData;
import com.heai.modules.production.entity.PrintLabelRecord;
import com.heai.modules.production.entity.SOScheduledRoutingOutData;
@ -17,6 +21,9 @@ public interface OutboundLabelScanMapper extends BaseMapper<OutboundLabelScan> {
List<OutboundLabelScanData> searchOutboundLabelScanList(OutboundLabelScanData outboundLabelScanData);
IPage<OutboundLabelDetailRowData> searchOutboundLabelDetailPage(@Param("page") Page<OutboundLabelDetailRowData> page,
@Param("query") OutboundLabelDetailQueryData query);
String getUserName(String createBy);
List<OutboundLabelScan> queryOutboundLabelScanList(OutboundLabelScan outboundLabelScan);

21
src/main/java/com/heai/modules/production/entity/OutboundLabelDetailQueryData.java

@ -0,0 +1,21 @@
package com.heai.modules.production.entity;
import lombok.Data;
/**
* 发货明细关联主表查询参数 - rqrq
*/
@Data
public class OutboundLabelDetailQueryData {
private Integer no;
private Integer size;
private String site;
private String startDate;
private String endDate;
private String customerId;
private String delNotifyNo;
private String shipFlag;
private String partDesc;
private String partNo;
private String orderNo;
}

53
src/main/java/com/heai/modules/production/entity/OutboundLabelDetailRowData.java

@ -0,0 +1,53 @@
package com.heai.modules.production.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
/**
* 发货明细关联主表查询结果 - rqrq
*/
@Data
public class OutboundLabelDetailRowData {
private String site;
private String delNotifyNo;
private BigDecimal delNotifyItemNo;
private String partNo;
private String partDescription;
private String approveResultFlag;
private BigDecimal notifyQty;
private BigDecimal shipQty;
private BigDecimal allNum;
private String UMId;
private String orderNo;
private BigDecimal itemNo;
private String customerPONo;
private String orderType;
private String custPartNo;
private String intSales;
private String extSales;
private String subOrderType;
private String techInfo;
private String detailRemark;
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date notifyDate;
private String customerId;
private String customerName;
private String billAirwayNo;
private String forwarderId;
private String headerRemark;
private String receiver;
private String delAddId;
private String creditFlag;
private String shipFlag;
private String shipResult;
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date realShipDate;
}

5
src/main/java/com/heai/modules/production/service/OutboundLabelScanService.java

@ -1,7 +1,10 @@
package com.heai.modules.production.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.heai.modules.production.entity.OutboundLabelScan;
import com.heai.modules.production.entity.OutboundLabelDetailQueryData;
import com.heai.modules.production.entity.OutboundLabelDetailRowData;
import com.heai.modules.production.entity.OutboundLabelScanData;
import com.heai.modules.production.entity.PrintLabelRecord;
import com.heai.modules.production.entity.SOScheduledRoutingOutData;
@ -14,6 +17,8 @@ public interface OutboundLabelScanService extends IService<OutboundLabelScan> {
List<OutboundLabelScanData> searchOutboundLabelScanList(OutboundLabelScanData outboundLabelScanData);
IPage<OutboundLabelDetailRowData> searchOutboundLabelDetailPage(OutboundLabelDetailQueryData queryData);
void saveLabel(OutboundLabelScan outboundLabelScan);
SOScheduledRoutingOutData queryStandardWeight(SOScheduledRoutingOutData data);

20
src/main/java/com/heai/modules/production/service/impl/OutboundLabelScanServiceImpl.java

@ -1,8 +1,12 @@
package com.heai.modules.production.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.heai.modules.production.dao.OutboundLabelScanMapper;
import com.heai.modules.production.entity.OutboundLabelScan;
import com.heai.modules.production.entity.OutboundLabelDetailQueryData;
import com.heai.modules.production.entity.OutboundLabelDetailRowData;
import com.heai.modules.production.entity.OutboundLabelScanData;
import com.heai.modules.production.entity.PrintLabelRecord;
import com.heai.modules.production.entity.SOScheduledRoutingOutData;
@ -70,6 +74,22 @@ public class OutboundLabelScanServiceImpl extends ServiceImpl<OutboundLabelScanM
return baseMapper.searchOutboundLabelScanList(outboundLabelScanData);
}
@Override
public IPage<OutboundLabelDetailRowData> searchOutboundLabelDetailPage(OutboundLabelDetailQueryData queryData) {
if (Objects.isNull(queryData)) {
throw new RuntimeException("请求参数错误");
}
if (StringUtils.hasText(queryData.getStartDate())) {
queryData.setStartDate(queryData.getStartDate() + " 00:00:00");
}
if (StringUtils.hasText(queryData.getEndDate())) {
queryData.setEndDate(queryData.getEndDate() + " 23:59:59");
}
int no = Objects.isNull(queryData.getNo()) ? 1 : queryData.getNo();
int size = Objects.isNull(queryData.getSize()) ? 50 : queryData.getSize();
return baseMapper.searchOutboundLabelDetailPage(new Page<>(no, size), queryData);
}
@Override
@Transactional
public void saveLabel(OutboundLabelScan outboundLabelScan) {

81
src/main/resources/mapper/production/OutboundLabelScanMapper.xml

@ -51,6 +51,87 @@
order by a.create_data desc
</select>
<!-- 发货明细关联主表分页查询(支持明细维度筛选)- rqrq -->
<select id="searchOutboundLabelDetailPage" resultType="com.heai.modules.production.entity.OutboundLabelDetailRowData">
select T.Site as site,
T.DelNotifyNo as delNotifyNo,
D.DelNotifyItemNo as delNotifyItemNo,
D.PartNo as partNo,
P.PartDescription + ' / ' + isnull(P.Spec, '') as partDescription,
D.Ins_ApproveResultFlag as approveResultFlag,
D.NotifyQty as notifyQty,
D.ShipQty as shipQty,
(select sum(o.scan_qty)
from outbound_label_scan o
where o.Site = D.Site
and o.del_notify_no = D.DelNotifyNo
and o.del_notify_item_no = D.DelNotifyItemNo) as allNum,
C.UMid as UMId,
D.OrderNo as orderNo,
D.ItemNo as itemNo,
Y.CustomerPONo as customerPONo,
Y.OrderType as orderType,
C.CustPartNo as custPartNo,
Y.IntSales as intSales,
Y.ExtSales as extSales,
Y.SubOrderType as subOrderType,
D.TechInfo as techInfo,
D.Remark as detailRemark,
T.NotifyDate as notifyDate,
T.CustomerID as customerId,
X.CustomerName as customerName,
T.BillAirwayNo as billAirwayNo,
T.ForwarderID as forwarderId,
T.Remark as headerRemark,
T.Receiver as receiver,
T.DelAddID as delAddId,
T.CreditFlag as creditFlag,
T.ShipFlag as shipFlag,
T.ShipResult as shipResult,
T.RealShipDate as realShipDate
from CODelNotifyDetail D
inner join CODelNotifyHeader T
on T.Site = D.Site and T.DelNotifyNo = D.DelNotifyNo
inner join Customer X
on X.Site = T.Site and X.CustomerID = T.CustomerID
inner join COHeader Y
on Y.Site = D.Site and Y.OrderNo = D.OrderNo
inner join CODetail C
on C.Site = D.Site and C.OrderNo = D.OrderNo and C.ItemNo = D.ItemNo
inner join Part P
on P.Site = D.Site and P.PartNo = D.PartNo
<where>
<if test="query.site != null and query.site != ''">
and T.Site = #{query.site}
</if>
<if test="query.customerId != null and query.customerId != ''">
and T.CustomerID like '%' + #{query.customerId} + '%'
</if>
<if test="query.delNotifyNo != null and query.delNotifyNo != ''">
and T.DelNotifyNo like '%' + #{query.delNotifyNo} + '%'
</if>
<if test="query.startDate != null and query.startDate != ''">
and T.NotifyDate &gt;= #{query.startDate}
</if>
<if test="query.endDate != null and query.endDate != ''">
and T.NotifyDate &lt;= #{query.endDate}
</if>
<if test="query.shipFlag != null and query.shipFlag != ''">
and T.ShipResult &lt;&gt; '全部发货'
</if>
<if test="query.partDesc != null and query.partDesc != ''">
and P.PartDescription + ' / ' + isnull(P.Spec, '') like '%' + #{query.partDesc} + '%'
</if>
<if test="query.partNo != null and query.partNo != ''">
and D.PartNo like '%' + #{query.partNo} + '%'
</if>
<if test="query.orderNo != null and query.orderNo != ''">
and D.OrderNo like '%' + #{query.orderNo} + '%'
</if>
</where>
order by T.NotifyDate desc, T.DelNotifyNo, D.DelNotifyItemNo
</select>
<select id="getUserName" resultType="java.lang.String">
select dbo.Get_UserName(#{userId})
</select>

Loading…
Cancel
Save