-PDA5楼组装出库:4楼到5楼的柜体,如果是多个柜体合为一个原材料条码的,只生成一个生产明细,生产明细保存对应的原材料条码
-PDA5楼生产入库:生产入库逻辑完善
master
xins 2 months ago
parent 68bf18d502
commit 20bfc09eac

@ -3,10 +3,7 @@ package com.hw.mes.api;
import com.hw.common.core.constant.SecurityConstants;
import com.hw.common.core.constant.ServiceNameConstants;
import com.hw.common.core.domain.R;
import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.mes.api.domain.MesBaseMaterialInfo;
import com.hw.mes.api.domain.MesBaseProcessInfo;
import com.hw.mes.api.domain.MesBaseStationInfo;
import com.hw.mes.api.domain.*;
import com.hw.mes.api.domain.vo.MesBaseMaterialInfoVo;
import com.hw.mes.api.domain.vo.MesPdaProductPlanVo;
import com.hw.mes.api.domain.vo.MesSaleOrderTransferVo;
@ -148,4 +145,15 @@ public interface RemoteMesService {
@GetMapping("/barcode/getRawBarcodeByProductBarcode/{productBarcode}")
public R<MesBaseBarcodeInfo> getRawBarcodeByProductBarcode(@PathVariable("productBarcode") String productBarcode, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
/**
* ID
*
* @param barcodeId ID
* @param source
* @return
*/
@GetMapping("/barcode/selectMesBaseBindBarcodeList/{barcodeId}")
public R<List<MesBaseBindBarcode>> selectMesBaseBindBarcodeList(@PathVariable("barcodeId") Long barcodeId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}

@ -0,0 +1,88 @@
package com.hw.mes.api.domain;
import com.hw.common.core.annotation.Excel;
import com.hw.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* mes_base_bind_barcode
*
* @author Open Platform
* @date 2024-09-25
*/
public class MesBaseBindBarcode extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long bindBarcodeId;
/** 条码ID */
@Excel(name = "条码ID")
private Long barcodeId;
private String barcodeInfo;
private Long saleOrderId;
/** 绑定的条码内容 */
@Excel(name = "绑定的条码内容")
private String bindBarcode;
public void setBindBarcodeId(Long bindBarcodeId)
{
this.bindBarcodeId = bindBarcodeId;
}
public Long getBindBarcodeId()
{
return bindBarcodeId;
}
public void setBarcodeId(Long barcodeId)
{
this.barcodeId = barcodeId;
}
public Long getBarcodeId()
{
return barcodeId;
}
public String getBarcodeInfo() {
return barcodeInfo;
}
public void setBarcodeInfo(String barcodeInfo) {
this.barcodeInfo = barcodeInfo;
}
public Long getSaleOrderId() {
return saleOrderId;
}
public void setSaleOrderId(Long saleOrderId) {
this.saleOrderId = saleOrderId;
}
public void setBindBarcode(String bindBarcode)
{
this.bindBarcode = bindBarcode;
}
public String getBindBarcode()
{
return bindBarcode;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("bindBarcodeId", getBindBarcodeId())
.append("barcodeId", getBarcodeId())
.append("bindBarcode", getBindBarcode())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.toString();
}
}

@ -1,5 +1,6 @@
package com.hw.mes.api.domain.vo;
import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@ -24,4 +25,5 @@ public class MesPdaProductPlanVo {
//组装出库配对码对应的原材料条码
@NotBlank(message="raw material barcode cannot be empty")
private String rawMaterialBarcode;
}

@ -2,10 +2,7 @@ package com.hw.mes.api.factory;
import com.hw.common.core.domain.R;
import com.hw.mes.api.RemoteMesService;
import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.mes.api.domain.MesBaseMaterialInfo;
import com.hw.mes.api.domain.MesBaseProcessInfo;
import com.hw.mes.api.domain.MesBaseStationInfo;
import com.hw.mes.api.domain.*;
import com.hw.mes.api.domain.vo.MesBaseMaterialInfoVo;
import com.hw.mes.api.domain.vo.MesPdaProductPlanVo;
import com.hw.mes.api.domain.vo.MesSaleOrderTransferVo;
@ -88,6 +85,11 @@ public class RemoteMesFallbackFactory implements FallbackFactory<RemoteMesServic
public R<MesBaseBarcodeInfo> getRawBarcodeByProductBarcode(String productBarcode, String source) {
return R.fail("根据成品条码获取原材料条码信息失败:" + throwable.getMessage());
}
@Override
public R<List<MesBaseBindBarcode>> selectMesBaseBindBarcodeList(Long barcodeId, String source) {
return R.fail("根据原材料条码获取成品条码信息失败:" + throwable.getMessage());
}
};
}
}

@ -8,7 +8,7 @@ import com.hw.common.core.domain.R;
import com.hw.common.security.annotation.InnerAuth;
import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.mes.api.domain.MesBaseMaterialInfo;
import com.hw.mes.api.domain.MesBaseBindBarcode;
import com.hw.mes.domain.MesPurchaseOrder;
import com.hw.mes.service.IMesBaseMaterialInfoService;
import com.hw.mes.service.IMesPurchaseOrderService;
@ -385,4 +385,18 @@ public class MesBaseBarcodeInfoController extends BaseController
return success(mesBaseBarcodeInfoService.selectRawBarcodeInfoByProductBarcode(productBarcode));
}
/**
*
*/
@InnerAuth
@GetMapping(value="/selectMesBaseBindBarcodeList/{barcodeId}")
public R<List<MesBaseBindBarcode>> selectMesBaseBindBarcodeList(@PathVariable("barcodeId") Long barcodeId)
{
MesBaseBindBarcode queryBindBarcode = new MesBaseBindBarcode();
queryBindBarcode.setBarcodeId(barcodeId);
return R.ok(mesBaseBarcodeInfoService.selectMesBaseBindBarcodeList(queryBindBarcode));
}
}

@ -269,7 +269,7 @@ public class MesProductPlanController extends BaseController {
try {
MesProductPlanDetail mesProductPlanDetail = new MesProductPlanDetail();
mesProductPlanDetail.setMaterialBarcode(mesPdaProductPlanVo.getMaterialBarcode());
mesProductPlanDetail.setRawMaterialBarcode(mesPdaProductPlanVo.getRawMaterialBarcode());
// mesProductPlanDetail.setRawMaterialBarcode(mesPdaProductPlanVo.getRawMaterialBarcode());
mesProductPlanDetailService.startNextMesProductPlanDetail(mesProductPlanDetail, MesConstants.MES_START_TYPE_FIFTH_FLOOR_INSTALL);
return R.ok("start successfully");
} catch (Exception e) {
@ -287,7 +287,7 @@ public class MesProductPlanController extends BaseController {
public R<?> complete5thFloorInstall(@RequestBody MesPdaProductPlanVo mesPdaProductPlanVo) {
try {
MesProductPlanDetail mesProductPlanDetail = new MesProductPlanDetail();
mesProductPlanDetail.setRawMaterialBarcode(mesPdaProductPlanVo.getRawMaterialBarcode());
mesProductPlanDetail.setMaterialBarcode(mesPdaProductPlanVo.getMaterialBarcode());
mesProductPlanDetailService.completeMesProductPlanDetail(mesProductPlanDetail);
return R.ok("complete successfully");
} catch (Exception e) {

@ -1,88 +1,88 @@
package com.hw.mes.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.hw.common.core.annotation.Excel;
import com.hw.common.core.web.domain.BaseEntity;
/**
* mes_base_bind_barcode
*
* @author Open Platform
* @date 2024-09-25
*/
public class MesBaseBindBarcode extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long bindBarcodeId;
/** 条码ID */
@Excel(name = "条码ID")
private Long barcodeId;
private String barcodeInfo;
private Long saleOrderId;
/** 绑定的条码内容 */
@Excel(name = "绑定的条码内容")
private String bindBarcode;
public void setBindBarcodeId(Long bindBarcodeId)
{
this.bindBarcodeId = bindBarcodeId;
}
public Long getBindBarcodeId()
{
return bindBarcodeId;
}
public void setBarcodeId(Long barcodeId)
{
this.barcodeId = barcodeId;
}
public Long getBarcodeId()
{
return barcodeId;
}
public String getBarcodeInfo() {
return barcodeInfo;
}
public void setBarcodeInfo(String barcodeInfo) {
this.barcodeInfo = barcodeInfo;
}
public Long getSaleOrderId() {
return saleOrderId;
}
public void setSaleOrderId(Long saleOrderId) {
this.saleOrderId = saleOrderId;
}
public void setBindBarcode(String bindBarcode)
{
this.bindBarcode = bindBarcode;
}
public String getBindBarcode()
{
return bindBarcode;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("bindBarcodeId", getBindBarcodeId())
.append("barcodeId", getBarcodeId())
.append("bindBarcode", getBindBarcode())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.toString();
}
}
//package com.hw.mes.domain;
//
//import org.apache.commons.lang3.builder.ToStringBuilder;
//import org.apache.commons.lang3.builder.ToStringStyle;
//import com.hw.common.core.annotation.Excel;
//import com.hw.common.core.web.domain.BaseEntity;
//
///**
// * 绑定条码对象 mes_base_bind_barcode
// *
// * @author Open Platform
// * @date 2024-09-25
// */
//public class MesBaseBindBarcode extends BaseEntity
//{
// private static final long serialVersionUID = 1L;
//
// /** 主键 */
// private Long bindBarcodeId;
//
// /** 条码ID */
// @Excel(name = "条码ID")
// private Long barcodeId;
//
// private String barcodeInfo;
//
// private Long saleOrderId;
//
// /** 绑定的条码内容 */
// @Excel(name = "绑定的条码内容")
// private String bindBarcode;
//
// public void setBindBarcodeId(Long bindBarcodeId)
// {
// this.bindBarcodeId = bindBarcodeId;
// }
//
// public Long getBindBarcodeId()
// {
// return bindBarcodeId;
// }
// public void setBarcodeId(Long barcodeId)
// {
// this.barcodeId = barcodeId;
// }
//
// public Long getBarcodeId()
// {
// return barcodeId;
// }
//
// public String getBarcodeInfo() {
// return barcodeInfo;
// }
//
// public void setBarcodeInfo(String barcodeInfo) {
// this.barcodeInfo = barcodeInfo;
// }
//
// public Long getSaleOrderId() {
// return saleOrderId;
// }
//
// public void setSaleOrderId(Long saleOrderId) {
// this.saleOrderId = saleOrderId;
// }
//
// public void setBindBarcode(String bindBarcode)
// {
// this.bindBarcode = bindBarcode;
// }
//
// public String getBindBarcode()
// {
// return bindBarcode;
// }
//
// @Override
// public String toString() {
// return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
// .append("bindBarcodeId", getBindBarcodeId())
// .append("barcodeId", getBarcodeId())
// .append("bindBarcode", getBindBarcode())
// .append("createBy", getCreateBy())
// .append("createTime", getCreateTime())
// .toString();
// }
//}

@ -1,7 +1,7 @@
package com.hw.mes.mapper;
import java.util.List;
import com.hw.mes.domain.MesBaseBindBarcode;
import com.hw.mes.api.domain.MesBaseBindBarcode;
/**
* Mapper

@ -1,6 +1,7 @@
package com.hw.mes.service;
import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.mes.api.domain.MesBaseBindBarcode;
import com.hw.mes.domain.vo.MesBindBarcodeVo;
import org.springframework.transaction.annotation.Transactional;
@ -214,4 +215,13 @@ public interface IMesBaseBarcodeInfoService {
* @return
*/
public MesBaseBarcodeInfo selectRawBarcodeInfoByProductBarcode(String productBarcode);
/**
*
*
* @param mesBaseBindBarcode
* @return
*/
public List<MesBaseBindBarcode> selectMesBaseBindBarcodeList(MesBaseBindBarcode mesBaseBindBarcode);
}

@ -3,7 +3,6 @@ package com.hw.mes.service.impl;
import java.math.BigDecimal;
import java.util.*;
import com.alibaba.fastjson2.JSONObject;
import com.hw.common.core.constant.*;
import com.hw.common.core.domain.R;
import com.hw.common.core.exception.ServiceException;
@ -11,10 +10,7 @@ import com.hw.common.core.utils.DateUtils;
import com.hw.common.core.utils.StringUtils;
import com.hw.common.core.utils.uuid.Seq;
import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.mes.api.domain.MesBaseMaterialInfo;
import com.hw.mes.api.domain.MesOrderBind;
import com.hw.mes.api.domain.MesSaleOrderRelate;
import com.hw.mes.api.domain.*;
import com.hw.mes.config.MesConfig;
import com.hw.mes.domain.*;
import com.hw.mes.domain.vo.MesBindBarcodeVo;
@ -1510,6 +1506,19 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
}
/**
*
*
* @param mesBaseBindBarcode
* @return
*/
@Override
public List<MesBaseBindBarcode> selectMesBaseBindBarcodeList(MesBaseBindBarcode mesBaseBindBarcode) {
return mesBaseBindBarcodeMapper.selectMesBaseBindBarcodeList(mesBaseBindBarcode);
}
// public MesPurchaseOrder insertVirtualPurchaseOrder(Long materialId, String barcodeInfo, BigDecimal sumOrderAmount,
// List<MesPurchaseOrderRelate> mesPurchaseOrderRelates,String userName, Date currentDate) {
// MesPurchaseOrder virtualPurchaseOrder = new MesPurchaseOrder();

@ -7,6 +7,7 @@ import com.hw.common.core.utils.StringUtils;
import com.hw.common.core.utils.uuid.Seq;
import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.mes.api.domain.vo.MesPdaProductPlanVo;
import com.hw.mes.config.MesConfig;
import com.hw.mes.domain.*;
import com.hw.mes.domain.vo.MesProductPlanDetailVo;
@ -216,6 +217,111 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
return mesProductPlanDetailMapper.updateMesProductPlanDetail(mesProductPlanDetail);
}
// /**
// * 完成生产计划明细(5楼PDA生产入库)
// *
// * @param mesProductPlanDetail 生产计划明细
// * @return 结果
// */
// @Override
// @Transactional(rollbackFor = Exception.class)
// public int complete5thFloorProduceInstock(MesPdaProductPlanVo mesPdaProductPlanVo) {
// Long planId = null;
// MesBaseBarcodeInfo baseBarcodeInfo = mesPdaProductPlanVo.getMesBaseBarcodeInfo();
// if (baseBarcodeInfo.getSingleFlag().equals(MesConstants.MES_BARCODE_SINGLE_FLAG_INTERNAL)) {
//
// }else{
//
// }
//
//
// MesProductPlan dbProductPlan = mesProductPlanMapper.selectMesProductPlanByPlanId(planId);
// if (!dbProductPlan.getUserId().equals(SecurityUtils.getUserId())) {
// throw new ServiceException("此派工信息没有派工到您");
// }
//
// String planStatus = dbProductPlan.getPlanStatus();
// if (planStatus.equals(MesConstants.MES_PRODUCT_PLAN_STATUS_TO_DISPATCH)) {
// throw new ServiceException("还未派工,不能结束");
// } else if (planStatus.equals(MesConstants.MES_PRODUCT_PLAN_STATUS_FINISH)) {
// throw new ServiceException("此生产派工已结束");
// }
//
// String updatePlanDetailStatus = MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_FINISH;
//
// Date currentDate = new Date();
// String userName = SecurityUtils.getUsername();
// BigDecimal planAmount = null;
//// BigDecimal dispatchAmount = null;
// //获取计划数量
// //如果是按图纸生产(激光切割工序),则判断完成数量不能大于图纸的数量,
// //如果不是按图纸生产,则判断完成数量不能大于计划的数量
// String attachId = dbProductPlan.getAttachId();
// if (dbProductPlan.getProcessId().equals(mesConfig.getLaserProcessId())) {
// if (StringUtils.isNotEmpty(attachId)) {//如果是按图纸生产的
// String[] attachIdArr = attachId.split(",");
// planAmount = new BigDecimal(attachIdArr.length);
// } else {
// planAmount = BigDecimal.ONE;
// }
// } else {
// planAmount = dbProductPlan.getPlanAmount();
// }
//
// BigDecimal complementAmount = dbProductPlan.getCompleteAmount() == null ? BigDecimal.ZERO : dbProductPlan.getCompleteAmount();
//
// BigDecimal newComplementAmount = complementAmount.add(BigDecimal.ONE);
// if (newComplementAmount.compareTo(planAmount) > 0) {
// throw new ServiceException("完成数量超出派工数量");
// }
//
// if (newComplementAmount.compareTo(planAmount) == 0) {
// dbProductPlan.setPlanStatus(MesConstants.MES_PRODUCT_PLAN_STATUS_FINISH);
// dbProductPlan.setRealEndTime(currentDate);
// }
//
//
// dbProductPlan.setCompleteAmount(newComplementAmount);
// dbProductPlan.setUpdateTime(currentDate);
// dbProductPlan.setUpdateBy(userName);
// mesProductPlanMapper.updateMesProductPlan(dbProductPlan);
//
// }
//
//
// /**
// * 完成生产计划明细
// *
// * @param materialBarcode 物料条码
// * @param userName 用户名称
// * @param currentDate 当前时间
// * @return 结果
// */
//
// public Long complete5thFloorMesProductPlanDetail(String materialBarcode,String userName,Date currentDate) {
// MesProductPlanDetail dbProductPlanDetail = mesProductPlanDetailMapper.selectMesProductPlanDetailByMaterialBarcode(materialBarcode);
//
// if (dbProductPlanDetail == null) {
// throw new ServiceException("未找到生产明细");
// }
//
// String planDetailStatus = dbProductPlanDetail.getPlanDetailStatus();
// if (planDetailStatus.equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_TO_START)) {
// throw new ServiceException("此生产明细未开始");
// } else if (planDetailStatus.equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_FINISH)) {
// return dbProductPlanDetail.getPlanId();
// }
//
//
// dbProductPlanDetail.setUpdateTime(currentDate);
// dbProductPlanDetail.setUpdateBy(userName);
// dbProductPlanDetail.setPlanDetailStatus( MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_FINISH);
// dbProductPlanDetail.setRealEndTime(currentDate);
// mesProductPlanDetailMapper.updateMesProductPlanDetail(dbProductPlanDetail);
// return dbProductPlanDetail.getPlanId();
// }
/**
*
*
@ -226,7 +332,7 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
@Transactional(rollbackFor = Exception.class)
public int completeMesProductPlanDetail(MesProductPlanDetail mesProductPlanDetail) {
Long planDetailId = mesProductPlanDetail.getPlanDetailId();
MesProductPlanDetail dbProductPlanDetail = new MesProductPlanDetail();
MesProductPlanDetail dbProductPlanDetail = null;
if (planDetailId != null) {
dbProductPlanDetail = mesProductPlanDetailMapper.
selectMesProductPlanDetailByPlanDetailId(planDetailId);
@ -241,7 +347,7 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
if (planDetailStatus.equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_TO_START)) {
throw new ServiceException("此生产明细未开始");
} else if (planDetailStatus.equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_FINISH)) {
throw new ServiceException("此生产明细已结束");
return 1;
}
Long planId = dbProductPlanDetail.getPlanId();
@ -451,7 +557,7 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
//在拆分区拿柜体拆分时,需要打印配对码,然后跟柜体码绑定
//在从4楼到5楼接驳位时需要根据4楼的成品码重新打印原材料条码
MesBaseBarcodeInfo mesBaseBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo(
mesProductPlanDetail.getRawMaterialBarcode());
mesProductPlanDetail.getMaterialBarcode());
if (mesBaseBarcodeInfo == null) {
throw new ServiceException("无派工任务");
}

@ -405,6 +405,18 @@ public class WmsMobileController extends BaseController {
return toAjax(wmsRawOutstockService.assembleOutstock(wmsAssembleOutstockVo));
}
/**
*
*/
@Log(title = "组装返库", businessType = BusinessType.INSERT)
@PostMapping(("/assembleBack"))
public AjaxResult assembleBack(@Validated @RequestBody WmsAssembleOutstockVo wmsAssembleOutstockVo) {
if(!wmsAssembleOutstockVo.getMaterialBarcode().equals("")) {
throw new ServiceException("组装返库");
}
return toAjax(1);
}
/**
*

@ -14,6 +14,7 @@ import com.hw.common.core.utils.uuid.Seq;
import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.RemoteMesService;
import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.mes.api.domain.MesBaseBindBarcode;
import com.hw.mes.api.domain.vo.MesPdaProductPlanVo;
import com.hw.wms.config.WmsConfig;
import com.hw.wms.domain.*;
@ -304,19 +305,52 @@ public class WmsProductInstockServiceImpl implements IWmsProductInstockService {
String operationType = WmsConstants.WMS_OPERATION_TYPE_AUTO;
String executeStatus = WmsConstants.WMS_EXECUTE_STATUS_TOEXECUTE;
produceInstock(wmsProduceInstockVo, warehouseId, productType, operationType, executeStatus, 5L);
String materialBarcode = wmsProduceInstockVo.getMaterialBarcode();
R<MesBaseBarcodeInfo> baseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER);
if (baseBarcodeInfoR == null) {
throw new ServiceException("物料条码有误");
}
MesBaseBarcodeInfo baseBarcodeInfo = baseBarcodeInfoR.getData();
if (baseBarcodeInfo == null) {
throw new ServiceException("物料条码有误");
}
produceInstock(baseBarcodeInfo, warehouseId, productType, operationType, executeStatus, 5L);
// if (baseBarcodeInfo.getSingleFlag().equals(MesConstants.MES_BARCODE_SINGLE_FLAG_INTERNAL)) {
// R<List<MesBaseBindBarcode>> baseBindBarcodeListData = remoteMesService.selectMesBaseBindBarcodeList(baseBarcodeInfo.getBarcodeId(), SecurityConstants.INNER);
// if (baseBindBarcodeListData == null) {
// throw new RuntimeException("没有绑定的成品条码信息。");
// }
// List<MesBaseBindBarcode> baseBindBarcodeList = baseBindBarcodeListData.getData();
// if (baseBindBarcodeList == null || baseBindBarcodeList.isEmpty()) {
// throw new RuntimeException("没有绑定的成品条码信息!");
// }
//
// for (MesBaseBindBarcode baseBindBarcode : baseBindBarcodeList) {
// this.complete5thFloorInstall(baseBindBarcode.getBindBarcode());
// }
//
// } else {
// this.complete5thFloorInstall(materialBarcode);
// }
this.complete5thFloorInstall(materialBarcode);
return 1;
}
public void complete5thFloorInstall(String materialBarcode) {
/**
* 5PDA
*/
MesPdaProductPlanVo mesPdaProductPlanVo = new MesPdaProductPlanVo();
mesPdaProductPlanVo.setRawMaterialBarcode(wmsProduceInstockVo.getMaterialBarcode());
mesPdaProductPlanVo.setMaterialBarcode(materialBarcode);//扫描的柜体原材料条码信息
R<?> tdReturnMsg = remoteMesService.complete5thFloorInstall(mesPdaProductPlanVo, SecurityConstants.INNER);
if (tdReturnMsg.getCode() != Constants.SUCCESS) {//抛出异常,回滚事务
throw new RuntimeException(tdReturnMsg.getMsg());
}
return 1;
}
/**
@ -332,7 +366,17 @@ public class WmsProductInstockServiceImpl implements IWmsProductInstockService {
String productType = WmsConstants.PRODUCT_INSTOCK_STOCK_TYPE_PRODUCT;
String operationType = WmsConstants.WMS_OPERATION_TYPE_MANUAL;
String executeStatus = WmsConstants.WMS_EXECUTE_STATUS_FINISH;
return produceInstock(wmsProduceInstockVo, warehouseId, productType, operationType, executeStatus, 1L);
String materialBarcode = wmsProduceInstockVo.getMaterialBarcode();
R<MesBaseBarcodeInfo> baseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER);
if (baseBarcodeInfoR == null) {
throw new ServiceException("物料条码有误");
}
MesBaseBarcodeInfo baseBarcodeInfo = baseBarcodeInfoR.getData();
if (baseBarcodeInfo == null) {
throw new ServiceException("物料条码有误");
}
return produceInstock(baseBarcodeInfo, warehouseId, productType, operationType, executeStatus, 1L);
}
@ -349,30 +393,30 @@ public class WmsProductInstockServiceImpl implements IWmsProductInstockService {
String productType = WmsConstants.PRODUCT_INSTOCK_STOCK_TYPE_PRODUCT;
String operationType = WmsConstants.WMS_OPERATION_TYPE_MANUAL;
String executeStatus = WmsConstants.WMS_EXECUTE_STATUS_FINISH;
return produceInstock(wmsProduceInstockVo, warehouseId, productType, operationType, executeStatus, 4L);
String materialBarcode = wmsProduceInstockVo.getMaterialBarcode();
R<MesBaseBarcodeInfo> baseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER);
if (baseBarcodeInfoR == null) {
throw new ServiceException("物料条码有误");
}
MesBaseBarcodeInfo baseBarcodeInfo = baseBarcodeInfoR.getData();
if (baseBarcodeInfo == null) {
throw new ServiceException("物料条码有误");
}
return produceInstock(baseBarcodeInfo, warehouseId, productType, operationType, executeStatus, 4L);
}
/**
* 5
*
* @param wmsProduceInstockVo
* @param baseBarcodeInfo
* @param warehouseId
* @param productType
* @param operationType
* @param executeStatus
* @return
*/
public int produceInstock(WmsProduceInstockVo wmsProduceInstockVo, Long warehouseId, String productType, String operationType, String executeStatus, Long warehouseFloor) {
String materialBarcode = wmsProduceInstockVo.getMaterialBarcode();
R<MesBaseBarcodeInfo> baseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER);
if (baseBarcodeInfoR == null) {
throw new ServiceException("物料条码有误");
}
MesBaseBarcodeInfo baseBarcodeInfo = baseBarcodeInfoR.getData();
if (baseBarcodeInfo == null) {
throw new ServiceException("物料条码有误");
}
public int produceInstock(MesBaseBarcodeInfo baseBarcodeInfo, Long warehouseId, String productType, String operationType, String executeStatus, Long warehouseFloor) {
//半成品入库按原材料入库的柜体原料码进行入库
if (productType.equals(WmsConstants.PRODUCT_INSTOCK_STOCK_TYPE_SEMI)) {
@ -392,7 +436,7 @@ public class WmsProductInstockServiceImpl implements IWmsProductInstockService {
//如果执行状态不是已完成是agv入库则需要判断是否有入库记录避免重复提交如果执行状态是已完成人工入库则判断是否有此成品条码库存即可
if (!executeStatus.equals(WmsConstants.WMS_EXECUTE_STATUS_FINISH)) {
WmsProductInstock queryProductInstock = new WmsProductInstock();
queryProductInstock.setProductBatch(materialBarcode);//productbatch是索引查出来再过滤性能更快
queryProductInstock.setProductBatch(baseBarcodeInfo.getBarcodeInfo());//productbatch是索引查出来再过滤性能更快
List<WmsProductInstock> wmsProductInstocks = wmsProductInstockMapper.selectWmsProductInstockList(queryProductInstock);
if (wmsProductInstocks != null && !wmsProductInstocks.isEmpty()) {
List<WmsProductInstock> incompleteProductInstocks = wmsProductInstocks.stream().filter(
@ -415,7 +459,7 @@ public class WmsProductInstockServiceImpl implements IWmsProductInstockService {
wmsProductInstock.setPlanDetailCode(baseBarcodeInfo.getPlanDetailCode());
wmsProductInstock.setInstockType(WmsConstants.PRODUCT_INSTOCK_INSTOCK_TYPE_PRODUCT);
wmsProductInstock.setProductId(baseBarcodeInfo.getMaterialId());
wmsProductInstock.setProductBatch(materialBarcode);
wmsProductInstock.setProductBatch(baseBarcodeInfo.getBarcodeInfo());
wmsProductInstock.setInstockAmount(BigDecimal.ONE);
wmsProductInstock.setAuditStatus(WmsConstants.WMS_AUDIT_STATUS_PASS);
wmsProductInstock.setExecuteStatus(executeStatus);

@ -1032,32 +1032,21 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
WmsRawOutstock queryRawOutstock = new WmsRawOutstock();
queryRawOutstock.setMaterialBatch(assembleMaterialBarcode);
List<WmsRawOutstock> wmsRawOutstocks = wmsRawOutstockMapper.selectWmsRawOutstockList(queryRawOutstock);
if (wmsRawOutstocks != null && !wmsRawOutstocks.isEmpty()) {
throw new ServiceException("已经有此物料出库记录");
}
WmsRawStock queryRawStock = new WmsRawStock();
queryRawStock.setInstockBatch(assembleMaterialBarcode);
// queryRawStock.setCompleteFlag(WmsConstants.WMS_RAW_STOCK_COMPLETE_FLAG_NO);
List<WmsRawStock> wmsRawStocks = wmsRawStockMapper.selectWmsRawStockInList(queryRawStock);
//如果是对内生产的柜体,则判断
if (baseBarcodeInfo.getSingleFlag().equals(MesConstants.MES_BARCODE_SINGLE_FLAG_INTERNAL)) {
if (wmsRawOutstocks == null || wmsRawOutstocks.isEmpty()) {
this.assembleRawOutstock(wmsRawStocks, assembleMaterialBarcode, planCode, planDetailCode,
palletInfoCode, materialId, bindBarcodeInfo.getSaleOrderId());
}
} else {
if (wmsRawOutstocks != null && !wmsRawOutstocks.isEmpty()) {
throw new ServiceException("已经有此物料出库记录");
}
this.assembleRawOutstock(wmsRawStocks, assembleMaterialBarcode, planCode, planDetailCode,
palletInfoCode, materialId, bindBarcodeInfo.getSaleOrderId());
}
this.assembleRawOutstock(wmsRawStocks, assembleMaterialBarcode, planCode, planDetailCode,
palletInfoCode, materialId, bindBarcodeInfo.getSaleOrderId());
MesPdaProductPlanVo mesPdaProductPlanVo = new MesPdaProductPlanVo();
mesPdaProductPlanVo.setRawMaterialBarcode(assembleMaterialBarcode);//采购的柜体原材料条码或者4楼到5楼后生成的原材料条码
mesPdaProductPlanVo.setMaterialBarcode(bindBarcode);// 采购的bindbarcode就是采购的原材料条码而四楼到5楼的则是在4楼绑定的成品条码。原柜体的条码之前的原材料条码或成品条码start后在plandetail保存此码
// mesPdaProductPlanVo.setRawMaterialBarcode(assembleMaterialBarcode);//采购的柜体原材料条码或者4楼到5楼后生成的原材料条码
mesPdaProductPlanVo.setMaterialBarcode(assembleMaterialBarcode);// 采购的柜体原材料条码或者4楼到5楼后生成的原材料条码。start后在plandetail保存此码
R<?> tdReturnMsg = remoteMesService.start5thFloorInstall(mesPdaProductPlanVo, SecurityConstants.INNER);
if (tdReturnMsg.getCode() != Constants.SUCCESS) {//抛出异常,回滚事务
throw new ServiceException(tdReturnMsg.getMsg());

Loading…
Cancel
Save