常熟吴彦祖 2 weeks ago
parent
commit
724c905f93
  1. 7
      src/main/java/com/gaotao/modules/automatedWarehouse/entity/PalletDetailData.java
  2. 5
      src/main/java/com/gaotao/modules/automatedWarehouse/mapper/WcsIntegrationMapper.java
  3. 13
      src/main/java/com/gaotao/modules/automatedWarehouse/service/impl/WcsIntegrationServiceImpl.java
  4. 17
      src/main/resources/mapper/automatedWarehouse/WcsIntegrationMapper.xml

7
src/main/java/com/gaotao/modules/automatedWarehouse/entity/PalletDetailData.java

@ -1,9 +1,12 @@
package com.gaotao.modules.automatedWarehouse.entity; package com.gaotao.modules.automatedWarehouse.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import org.apache.ibatis.type.Alias; import org.apache.ibatis.type.Alias;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
@Data @Data
@Alias("PalletDetailData") @Alias("PalletDetailData")
@ -25,7 +28,9 @@ public class PalletDetailData extends PalletDetail{
private String manufactureDateStr; private String manufactureDateStr;
private BigDecimal realHeight; private BigDecimal realHeight;
private String reserveFlag; private String reserveFlag;
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date receiveDate;
/** /**
* 预约单据参考3工单号- rqrq * 预约单据参考3工单号- rqrq
*/ */

5
src/main/java/com/gaotao/modules/automatedWarehouse/mapper/WcsIntegrationMapper.java

@ -3,6 +3,7 @@ package com.gaotao.modules.automatedWarehouse.mapper;
import com.gaotao.modules.api.entity.TaskNote; import com.gaotao.modules.api.entity.TaskNote;
import com.gaotao.modules.automatedWarehouse.entity.*; import com.gaotao.modules.automatedWarehouse.entity.*;
import com.gaotao.modules.base.entity.PalletType; import com.gaotao.modules.base.entity.PalletType;
import com.gaotao.modules.handlingunit.entity.HandlingUnit;
import com.gaotao.modules.warehouse.entity.Pallet; import com.gaotao.modules.warehouse.entity.Pallet;
import com.gaotao.modules.warehouse.entity.PalletData; import com.gaotao.modules.warehouse.entity.PalletData;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@ -48,6 +49,10 @@ public interface WcsIntegrationMapper {
*/ */
List<Map<String, Object>> getPalletDetails(@Param("site") String site, @Param("palletId") String palletId, List<Map<String, Object>> getPalletDetails(@Param("site") String site, @Param("palletId") String palletId,
@Param("position") String position, @Param("layer") Integer layer); @Param("position") String position, @Param("layer") Integer layer);
List<PalletDetailData> getPalletDetailsPosition(@Param("site") String site,
@Param("palletId") String palletId,@Param("position") String position);
HandlingUnit getExpiredDateWithSerialNo(@Param("site") String site,
@Param("serialNo") String serialNo);
List<PalletDetailData> getPalletDetailsData(@Param("site") String site, @Param("palletId") String palletId); List<PalletDetailData> getPalletDetailsData(@Param("site") String site, @Param("palletId") String palletId);
/** /**

13
src/main/java/com/gaotao/modules/automatedWarehouse/service/impl/WcsIntegrationServiceImpl.java

@ -573,7 +573,6 @@ public class WcsIntegrationServiceImpl implements WcsIntegrationService {
!StringUtils.hasText(position) || layer == null || !StringUtils.hasText(serialNo)) { !StringUtils.hasText(position) || layer == null || !StringUtils.hasText(serialNo)) {
throw new Exception("参数不能为空"); throw new Exception("参数不能为空");
} }
Map<String, Object> palletData = wcsIntegrationMapper.getPalletInfo(site, palletId);
// 检查栈板是否正在被调用 - rqrq // 检查栈板是否正在被调用 - rqrq
com.gaotao.modules.warehouse.entity.Pallet pallet = wcsIntegrationMapper.getPalletByCode(site, palletId); com.gaotao.modules.warehouse.entity.Pallet pallet = wcsIntegrationMapper.getPalletByCode(site, palletId);
if (pallet != null && "Y".equals(pallet.getCallingFlag())) { if (pallet != null && "Y".equals(pallet.getCallingFlag())) {
@ -668,6 +667,7 @@ public class WcsIntegrationServiceImpl implements WcsIntegrationService {
String palletType = palletInfo.getPalletType(); String palletType = palletInfo.getPalletType();
Integer maxLayer = palletInfo.getMaxLayer() != null ? palletInfo.getMaxLayer() : 0; Integer maxLayer = palletInfo.getMaxLayer() != null ? palletInfo.getMaxLayer() : 0;
Integer wcsSoreType = palletInfo.getWcsSoreType() != null ? palletInfo.getWcsSoreType() : 0; Integer wcsSoreType = palletInfo.getWcsSoreType() != null ? palletInfo.getWcsSoreType() : 0;
Integer wcsBasePalletType = palletInfo.getWcsBasePalletType() != null ? palletInfo.getWcsBasePalletType() : 0;
if (layer > 1) { if (layer > 1) {
// 检查该位置的第1层到第layer-1层是否都有物料 - rqrq // 检查该位置的第1层到第layer-1层是否都有物料 - rqrq
List<Integer> existingLayers = wcsIntegrationMapper.getLayersByPosition(site, palletId, position); List<Integer> existingLayers = wcsIntegrationMapper.getLayersByPosition(site, palletId, position);
@ -686,6 +686,17 @@ public class WcsIntegrationServiceImpl implements WcsIntegrationService {
if (!existingDetails.isEmpty()) { if (!existingDetails.isEmpty()) {
throw new Exception("该位置第" + layer + "层已有物料,气胀轴分拣托盘每层只能放一个物料"); throw new Exception("该位置第" + layer + "层已有物料,气胀轴分拣托盘每层只能放一个物料");
} }
// if(wcsBasePalletType==2){
// //围框自动分拣,必须满足同一摞物料的接收日期要同一天 并且是同一个物料
// List<PalletDetailData> existingDetailsOther = wcsIntegrationMapper.getPalletDetailsPosition(site, palletId, position);
// if (!existingDetailsOther.isEmpty()) {
// PalletDetailData getFirst = existingDetailsOther.getFirst();
// HandlingUnit handlingUnit = wcsIntegrationMapper.getExpiredDateWithSerialNo(site,serialNo);
// if(!getFirst.getPartNo().equals(partNo)){
// throw new Exception("该位置第" + layer + "层已有物料,请勿重复扫描");
// }
// }
// }
} else if (wcsSoreType == 2) { } else if (wcsSoreType == 2) {
// wcsSoreType = 2抱箱自动分拣底4箱+上3箱等每层可以放多个东西 // wcsSoreType = 2抱箱自动分拣底4箱+上3箱等每层可以放多个东西
} else { } else {

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

@ -183,6 +183,23 @@
</if> </if>
ORDER BY a.position, a.layer, a.serial_no ORDER BY a.position, a.layer, a.serial_no
</select> </select>
<select id="getPalletDetailsPosition" resultType="PalletDetailData">
SELECT a.site, a.pallet_id as palletId, a.position, a.layer, a.serial_no as serialNo, a.part_no as partNo,
a.create_date as createDate, a.create_by as createBy,b.receive_date
FROM pallet_detail a
left join handling_unit b on a.site = b.site and a.serial_no = b.unit_id
WHERE a.site = #{site} AND a.pallet_id = #{palletId}
AND a.position = #{position}
</select>
<select id="getExpiredDateWithSerialNo" resultType="HandlingUnit">
SELECT site, unit_id,expired_date from handling_unit
WHERE site = #{site} AND unit_id = #{serialNo}
</select>
<!-- 注意:不能用NOLOCK,结果用于校验后组盘操作,脏读可能导致数据不一致 - rqrq --> <!-- 注意:不能用NOLOCK,结果用于校验后组盘操作,脏读可能导致数据不一致 - rqrq -->
<select id="getPalletDetailsData" resultType="PalletDetailData"> <select id="getPalletDetailsData" resultType="PalletDetailData">
SELECT a.site, a.pallet_id as palletId, a.position, a.layer, a.serial_no as serialNo, a.part_no as partNo, SELECT a.site, a.pallet_id as palletId, a.position, a.layer, a.serial_no as serialNo, a.part_no as partNo,

Loading…
Cancel
Save