常熟吴彦祖 2 weeks ago
parent
commit
43605df354
  1. 16
      src/main/java/com/gaotao/modules/automatedWarehouse/entity/WmsLabelAndPalletData.java
  2. 8
      src/main/java/com/gaotao/modules/handlingunit/entity/dto/HandlingUnitDto.java
  3. 25
      src/main/java/com/gaotao/modules/warehouse/service/impl/LabelQueryServiceImpl.java
  4. 7
      src/main/resources/mapper/automatedWarehouse/WcsIntegrationMapper.xml
  5. 1
      src/main/resources/mapper/warehouse/LabelQueryMapper.xml

16
src/main/java/com/gaotao/modules/automatedWarehouse/entity/WmsLabelAndPalletData.java

@ -1,6 +1,10 @@
package com.gaotao.modules.automatedWarehouse.entity; package com.gaotao.modules.automatedWarehouse.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
public class WmsLabelAndPalletData { public class WmsLabelAndPalletData {
/** /**
@ -69,7 +73,9 @@ public class WmsLabelAndPalletData {
* WDR编号 - rqrq * WDR编号 - rqrq
*/ */
private String wdr; private String wdr;
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date receiveDate;
/** /**
* 失效日期 - rqrq * 失效日期 - rqrq
*/ */
@ -212,4 +218,12 @@ public class WmsLabelAndPalletData {
public void setTaskNo(String taskNo) { public void setTaskNo(String taskNo) {
this.taskNo = taskNo; this.taskNo = taskNo;
} }
public Date getReceiveDate() {
return receiveDate;
}
public void setReceiveDate(Date receiveDate) {
this.receiveDate = receiveDate;
}
} }

8
src/main/java/com/gaotao/modules/handlingunit/entity/dto/HandlingUnitDto.java

@ -69,6 +69,14 @@ public class HandlingUnitDto {
private String palletId; private String palletId;
private String stationId; private String stationId;
private String stationArea; private String stationArea;
/**
* pallet.wcs_location立库点位字符串 "1..."- rqrq
*/
private String wcsLocation;
/**
* 立库楼层由wcs_location首字符换算- rqrq
*/
private String asrsFloor;
private String callingFlag; private String callingFlag;
private String engChgLevel; private String engChgLevel;
// 关联信息 // 关联信息

25
src/main/java/com/gaotao/modules/warehouse/service/impl/LabelQueryServiceImpl.java

@ -16,9 +16,11 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* 标签查询服务实现 * 标签查询服务实现
@ -50,8 +52,31 @@ public class LabelQueryServiceImpl implements LabelQueryService {
public PageUtils getHandlingUnitLabelListLocation(HandlingUnitDto dto) { public PageUtils getHandlingUnitLabelListLocation(HandlingUnitDto dto) {
IPage<HandlingUnitDto> page = labelQueryMapper.getHandlingUnitLabelListLocation( IPage<HandlingUnitDto> page = labelQueryMapper.getHandlingUnitLabelListLocation(
new Page<HandlingUnitDto>(dto.getPage(), dto.getSize()), dto); new Page<HandlingUnitDto>(dto.getPage(), dto.getSize()), dto);
fillAsrsFloor(page.getRecords());
return new PageUtils(page); return new PageUtils(page);
} }
/**
* @Description 根据wcsLocation生成独立立库楼层字段 - rqrq
* @param records 查询结果
* @author rqrq
*/
private void fillAsrsFloor(List<HandlingUnitDto> records) {
if (records == null || records.isEmpty()) {
return;
}
for (HandlingUnitDto item : records) {
if (item == null || !StringUtils.hasText(item.getWcsLocation())) {
continue;
}
// rqrq - 按需求只截取wcs_location第1个字符作为立库楼层
String floor = item.getWcsLocation().substring(0, 1);
if (!StringUtils.hasText(floor)) {
continue;
}
item.setAsrsFloor( floor );
}
}
@Override @Override
public PageUtils getHandlingUnitLabelAll(HandlingUnitDto dto) { public PageUtils getHandlingUnitLabelAll(HandlingUnitDto dto) {
IPage<HandlingUnitDto> page = labelQueryMapper.getHandlingUnitLabelAll( IPage<HandlingUnitDto> page = labelQueryMapper.getHandlingUnitLabelAll(

7
src/main/resources/mapper/automatedWarehouse/WcsIntegrationMapper.xml

@ -23,7 +23,7 @@
AND (c.calling_flag IS NULL OR c.calling_flag != 'Y') AND (c.calling_flag IS NULL OR c.calling_flag != 'Y')
AND c.wcs_location IS NOT NULL AND c.wcs_location IS NOT NULL
</when> </when>
<!-- 如果有物料编码,返回明细数据(关联handling_unit查出qty、wdr、batch_no、expired_date)- rqrq -->
<!-- 如果有物料编码,返回明细数据(关联handling_unit查出qty、wdr、batch_no、expired_date, b.receive_date- rqrq -->
<otherwise> <otherwise>
SELECT SELECT
b.site, b.site,
@ -32,7 +32,8 @@
b.qty, b.qty,
b.batch_no AS batchNo, b.batch_no AS batchNo,
b.wdr, b.wdr,
CONVERT(VARCHAR(10), b.expired_date, 120) AS expiredDate
CONVERT(VARCHAR(10), b.expired_date, 120) AS expiredDate,
b.receive_date
FROM pallet_detail a WITH (NOLOCK) FROM pallet_detail a WITH (NOLOCK)
INNER JOIN handling_unit b WITH (NOLOCK) ON a.site = b.site AND a.serial_no = b.unit_id INNER JOIN handling_unit b WITH (NOLOCK) ON a.site = b.site AND a.serial_no = b.unit_id
INNER JOIN pallet c WITH (NOLOCK) ON a.site = c.site AND a.pallet_id = c.pallet_id INNER JOIN pallet c WITH (NOLOCK) ON a.site = c.site AND a.pallet_id = c.pallet_id
@ -58,7 +59,7 @@
AND b.batch_no = #{batchNo} AND b.batch_no = #{batchNo}
</if> </if>
</where> </where>
ORDER BY a.pallet_id, a.part_no
ORDER BY b.receive_date, a.pallet_id, a.part_no
</otherwise> </otherwise>
</choose> </choose>
</select> </select>

1
src/main/resources/mapper/warehouse/LabelQueryMapper.xml

@ -111,6 +111,7 @@
b.position, b.position,
b.layer, b.layer,
p.calling_flag, p.calling_flag,
p.wcs_location AS wcsLocation,
h.count_flag AS countFlag, h.count_flag AS countFlag,
h.last_count_date AS lastCountDate, h.last_count_date AS lastCountDate,
h.eng_chg_level AS engChgLevel, h.eng_chg_level AS engChgLevel,

Loading…
Cancel
Save