一楼工序申请领料,成品入库和成品出库完善
成品出库记录,原材料出库记录和成品出库审核完善
master
xs 1 week ago
parent 22be9a39ba
commit c856cfc5e6

@ -9,6 +9,7 @@ import com.hw.common.core.web.page.TableDataInfo;
import com.hw.common.log.annotation.Log;
import com.hw.common.log.enums.BusinessType;
import com.hw.common.security.annotation.RequiresPermissions;
import com.hw.wms.config.WmsConfig;
import com.hw.wms.domain.*;
import com.hw.wms.domain.vo.*;
import com.hw.wms.service.*;
@ -58,6 +59,8 @@ public class WmsApiController extends BaseController {
@Autowired
private IWmsLocationBarcodeService wmsLocationBarcodeService;
@Autowired
private WmsConfig wmsConfig;
/**
*
@ -153,7 +156,9 @@ public class WmsApiController extends BaseController {
@Log(title = "成品入库记录", businessType = BusinessType.INSERT)
@PostMapping(("/firstFloorProduceInstock"))
public AjaxResult firstFloorProduceInstock(@Validated @RequestBody WmsProduceInstockVo wmsProduceInstockVo) {
return toAjax(wmsProductInstockService.firstFloorProduceInstock(wmsProduceInstockVo));
wmsProduceInstockVo.setWarehouseId(wmsConfig.getFirstFloorProductWarehouseId());
wmsProduceInstockVo.setWarehouseFloor(1L);
return toAjax(wmsProductInstockService.firstFourthFloorProduceInstock(wmsProduceInstockVo));
}
/**
@ -163,16 +168,30 @@ public class WmsApiController extends BaseController {
@Log(title = "成品入库记录", businessType = BusinessType.INSERT)
@PostMapping(("/fourthFloorProduceInstock"))
public AjaxResult fourthFloorProduceInstock(@Validated @RequestBody WmsProduceInstockVo wmsProduceInstockVo) {
return toAjax(wmsProductInstockService.fourthFloorProduceInstock(wmsProduceInstockVo));
wmsProduceInstockVo.setWarehouseId(wmsConfig.getFourthFloorProductWarehouseId());
wmsProduceInstockVo.setWarehouseFloor(4L);
return toAjax(wmsProductInstockService.firstFourthFloorProduceInstock(wmsProduceInstockVo));
}
/**
*
*
*/
@Log(title = "成品出库记录", businessType = BusinessType.INSERT)
@PostMapping(("/firstFloorProduceOutstock"))
public AjaxResult firstFloorProduceOutstock(@Validated @RequestBody WmsProduceInstockVo wmsProduceInstockVo) {
wmsProduceInstockVo.setWarehouseId(wmsConfig.getFirstFloorProductWarehouseId());
return toAjax(wmsProductOutstockService.firstFourthFloorProduceOutstock(wmsProduceInstockVo));
}
/**
*
*/
@Log(title = "成品出库记录", businessType = BusinessType.INSERT)
@PostMapping(("/fourthFloorProduceOutstock"))
public AjaxResult fourthFloorProduceOutstock(@Validated @RequestBody WmsProduceInstockVo wmsProduceInstockVo) {
return toAjax(wmsProductOutstockService.fourthFloorProduceOutstock(wmsProduceInstockVo));
wmsProduceInstockVo.setWarehouseId(wmsConfig.getFourthFloorProductWarehouseId());
return toAjax(wmsProductOutstockService.firstFourthFloorProduceOutstock(wmsProduceInstockVo));
}
/**

@ -332,7 +332,7 @@ public class WmsMobileController extends BaseController {
// WmsProductStock queryProductStock = new WmsProductStock();
// queryProductStock.setSaleorderCode(request.getParameter("salesorderCode"));
// queryProductStock.setStockType(WmsConstants.PRODUCT_STOCK_STOCK_TYPE_PRODUCT);
queryStockTotal.setWarehouseType(WmsConstants.WMS_WAREHOUSE_TYPE_AGV);
// queryStockTotal.setWarehouseType(WmsConstants.WMS_WAREHOUSE_TYPE_AGV);
List<WmsStockTotal> wmsStockTotals = wmsStockTotalService.selectWmsStockTotalList4ProductApply(queryStockTotal);
return getDataTable(wmsStockTotals);
}

@ -161,6 +161,9 @@ public class WmsProductOutstock extends BaseEntity {
private String unitCode;
private String executeIncompleteFlag;//执行未完成标识
/**
*
*/
@ -478,6 +481,14 @@ public class WmsProductOutstock extends BaseEntity {
this.materialSpec = materialSpec;
}
public String getExecuteIncompleteFlag() {
return executeIncompleteFlag;
}
public void setExecuteIncompleteFlag(String executeIncompleteFlag) {
this.executeIncompleteFlag = executeIncompleteFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -17,4 +17,8 @@ public class WmsProduceInstockVo {
@NotBlank(message="物料条码必须输入")
private String materialBarcode;
private Long warehouseId;
private Long warehouseFloor;
}

@ -63,11 +63,11 @@ public interface WmsProductOutstockDetailMapper
/**
*
* ()
*
* @param productBarcode
* @return
*/
public WmsProductOutstockDetail selectWmsProductOutstockDetailByProductBarcode(String productBarcode);
// public WmsProductOutstockDetail selectWmsProductOutstockDetailByProductBarcode(String productBarcode);
}

@ -82,22 +82,15 @@ public interface IWmsProductInstockService {
*/
public int fifthFloorProduceInstock(WmsProduceInstockVo wmsProduceInstockVo);
/**
* (Web1)
*
* @param wmsProduceInstockVo
* @return
*/
public int firstFloorProduceInstock(WmsProduceInstockVo wmsProduceInstockVo);
/**
* (Web4)
* (Web14)
*
* @param wmsProduceInstockVo
* @return
*/
public int fourthFloorProduceInstock(WmsProduceInstockVo wmsProduceInstockVo);
public int firstFourthFloorProduceInstock(WmsProduceInstockVo wmsProduceInstockVo);
/**
* ;,join material

@ -89,12 +89,12 @@ public interface IWmsProductOutstockService
/**
* (Web4)
* (Web14)
*
* @param wmsProduceInstockVo
* @return
*/
public int fourthFloorProduceOutstock(WmsProduceInstockVo wmsProduceInstockVo);
public int firstFourthFloorProduceOutstock(WmsProduceInstockVo wmsProduceInstockVo);
/**
* 使

@ -380,15 +380,15 @@ public class WmsProductInstockServiceImpl implements IWmsProductInstockService {
}
/**
* (Web1)
* (Web14)
*
* @param wmsProduceInstockVo
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int firstFloorProduceInstock(WmsProduceInstockVo wmsProduceInstockVo) {
Long warehouseId = wmsConfig.getFirstFloorProductWarehouseId();
public int firstFourthFloorProduceInstock(WmsProduceInstockVo wmsProduceInstockVo) {
Long warehouseId = wmsProduceInstockVo.getWarehouseId();
String productType = WmsConstants.PRODUCT_INSTOCK_STOCK_TYPE_PRODUCT;
String operationType = WmsConstants.WMS_OPERATION_TYPE_MANUAL;
String executeStatus = WmsConstants.WMS_EXECUTE_STATUS_FINISH;
@ -402,33 +402,7 @@ public class WmsProductInstockServiceImpl implements IWmsProductInstockService {
throw new ServiceException("物料条码有误");
}
return produceInstock(baseBarcodeInfo, warehouseId, productType, operationType, executeStatus, 1L);
}
/**
* (Web4)
*
* @param wmsProduceInstockVo
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int fourthFloorProduceInstock(WmsProduceInstockVo wmsProduceInstockVo) {
Long warehouseId = wmsConfig.getFourthFloorProductWarehouseId();
String productType = WmsConstants.PRODUCT_INSTOCK_STOCK_TYPE_PRODUCT;
String operationType = WmsConstants.WMS_OPERATION_TYPE_MANUAL;
String executeStatus = WmsConstants.WMS_EXECUTE_STATUS_FINISH;
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);
return produceInstock(baseBarcodeInfo, warehouseId, productType, operationType, executeStatus, wmsProduceInstockVo.getWarehouseFloor());
}
@ -483,6 +457,8 @@ public class WmsProductInstockServiceImpl implements IWmsProductInstockService {
wmsProductInstock.setOperationType(operationType);
wmsProductInstock.setPlanCode(baseBarcodeInfo.getPlanCode());
wmsProductInstock.setPlanDetailCode(baseBarcodeInfo.getPlanDetailCode());
wmsProductInstock.setSaleOrderId(baseBarcodeInfo.getSaleOrderId());
wmsProductInstock.setSaleorderCode(baseBarcodeInfo.getSaleorderCode());
wmsProductInstock.setInstockType(WmsConstants.PRODUCT_INSTOCK_INSTOCK_TYPE_PRODUCT);
wmsProductInstock.setProductId(baseBarcodeInfo.getMaterialId());
wmsProductInstock.setProductBatch(baseBarcodeInfo.getBarcodeInfo());

@ -89,6 +89,7 @@ public class WmsProductOutstockDetailServiceImpl implements IWmsProductOutstockD
public int insertWmsProductOutstockDetail(WmsProductOutstockDetail wmsProductOutstockDetail) {
String locationCode = wmsProductOutstockDetail.getLocationCode();
String productBarcode = wmsProductOutstockDetail.getProductBarcode();//成品条码和批次码相同
//在PDA成品出库需要选择出库的申请单然后输入库位码和物料条码
Long productOutstockId = wmsProductOutstockDetail.getProductOutstockId();
R<MesBaseBarcodeInfo> baseBarcodeInfoR = remoteMesService.getBarcode(productBarcode, SecurityConstants.INNER);
@ -109,6 +110,7 @@ public class WmsProductOutstockDetailServiceImpl implements IWmsProductOutstockD
throw new ServiceException("物料条码有误");
}
//一楼成品库和四楼成品库没有库位
if(StringUtils.isEmpty(locationCode) &&
(wmsConfig.getFirstFloorProductWarehouseId().equals(productOutstock.getWarehouseId()) ||
wmsConfig.getFourthFloorProductWarehouseId().equals(productOutstock.getWarehouseId()))){

@ -4,6 +4,7 @@ import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import com.hw.common.core.constant.MesConstants;
import com.hw.common.core.constant.SecurityConstants;
import com.hw.common.core.constant.WmsConstants;
import com.hw.common.core.domain.R;
@ -22,6 +23,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.stream.Collectors;
import com.hw.common.core.utils.StringUtils;
import org.springframework.transaction.annotation.Transactional;
@ -262,12 +264,22 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService
*/
@Override
public int finalConfirmProductOutstock(WmsProductOutstockConfirmVo wmsProductOutstockConfirmVo) {
WmsProductOutstockDetail productOutstockDetail = wmsProductOutstockDetailMapper.
selectWmsProductOutstockDetailByProductBarcode(wmsProductOutstockConfirmVo.getMaterialBarcode());
if (productOutstockDetail == null) {
WmsProductOutstockDetail queryProductOutstockDetail = new WmsProductOutstockDetail();
queryProductOutstockDetail.setProductBarcode(wmsProductOutstockConfirmVo.getMaterialBarcode());
List<WmsProductOutstockDetail> wmsProductOutstockDetailList = wmsProductOutstockDetailMapper.selectWmsProductOutstockDetailList(queryProductOutstockDetail);
if (wmsProductOutstockDetailList == null || wmsProductOutstockDetailList.isEmpty()) {
throw new ServiceException("没有此成品出库信息");
}
List<WmsProductOutstockDetail> unConfirmedProductOutstockDetailList = wmsProductOutstockDetailList.stream().
filter(wpod ->!wpod.getExecuteStatus().equals(WmsConstants.WMS_EXECUTE_STATUS_CONFIRM)).collect(Collectors.toList());
if(unConfirmedProductOutstockDetailList==null || unConfirmedProductOutstockDetailList.isEmpty()){
throw new ServiceException("没有待确认成品出库信息");
}
WmsProductOutstockDetail productOutstockDetail = unConfirmedProductOutstockDetailList.get(0);
String executeStatus = productOutstockDetail.getExecuteStatus();
if (executeStatus.equals(WmsConstants.WMS_EXECUTE_STATUS_CONFIRM)) {
throw new ServiceException("此成品出库已经确认,无需再次确认");
@ -300,9 +312,9 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int fourthFloorProduceOutstock(WmsProduceInstockVo wmsProduceInstockVo) {
public int firstFourthFloorProduceOutstock(WmsProduceInstockVo wmsProduceInstockVo) {
//对内生产可直接出库,外部销售需要申请后才能出库(外部销售在手机端操作出库)
Long warehouseId = wmsConfig.getFourthFloorProductWarehouseId();
Long warehouseId = wmsProduceInstockVo.getWarehouseId();
String materialBarcode = wmsProduceInstockVo.getMaterialBarcode();
WmsProductStock productStock = wmsProductStockMapper.selectProductStockByBatch(materialBarcode);
@ -312,23 +324,137 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService
throw new ServiceException("没有库存信息");
}
WmsProductOutstock wmsProductOutstock = new WmsProductOutstock();
R<MesBaseBarcodeInfo> mesBaseBarcodeInfoData = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER);
if (mesBaseBarcodeInfoData == null) {
throw new ServiceException("物料条码有误");
}
MesBaseBarcodeInfo mesBaseBarcodeInfo = mesBaseBarcodeInfoData.getData();
if (mesBaseBarcodeInfo == null) {
throw new ServiceException("物料条码有误!");
}
Long materialId = mesBaseBarcodeInfo.getMaterialId();
Long saleOrderId = mesBaseBarcodeInfo.getSaleOrderId();
String saleorderCode = mesBaseBarcodeInfo.getSaleorderCode();
String planCode = mesBaseBarcodeInfo.getPlanCode();
String planDetailCode = mesBaseBarcodeInfo.getPlanDetailCode();
WmsBaseWarehouse warehouse = wmsBaseWarehouseMapper.selectWmsBaseWarehouseByWarehouseId(warehouseId);
String outRequirement = warehouse.getOutRequirement();
String userName = SecurityUtils.getUsername();
Date currentDate = new Date();
wmsProductOutstock.setWarehouseId(warehouseId);
wmsProductOutstock.setProductType(WmsConstants.WMS_PRODUCT_OUTSTOCK_PRODUCT_TYPE_PRODUCT);
wmsProductOutstock.setOperationType(WmsConstants.WMS_OPERATION_TYPE_MANUAL);
wmsProductOutstock.setOutstockType(WmsConstants.WMS_PRODUCT_OUTSTOCK_TYPE_SALE);
wmsProductOutstock.setAuditStatus(WmsConstants.WMS_AUDIT_STATUS_PASS);
wmsProductOutstock.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_FINISH);
wmsProductOutstock.setProductBatch(materialBarcode);
wmsProductOutstock.setApplyBy(userName);
wmsProductOutstock.setApplyDate(currentDate);
wmsProductOutstock.setTaskCode(Seq.getId(Seq.productOutstockSeqType, Seq.productOutstockCode));
Long productOutstockId=null;
//如果是直接出库
if (outRequirement.equals(WmsConstants.WMS_WAREHOUSE_OUT_REQUIREMENT_DIRECT)) {
WmsProductOutstock wmsProductOutstock = new WmsProductOutstock();
wmsProductOutstock.setWarehouseId(warehouseId);
wmsProductOutstock.setProductType(WmsConstants.WMS_PRODUCT_OUTSTOCK_PRODUCT_TYPE_PRODUCT);
wmsProductOutstock.setOperationType(WmsConstants.WMS_OPERATION_TYPE_MANUAL);
wmsProductOutstock.setOutstockType(WmsConstants.WMS_PRODUCT_OUTSTOCK_TYPE_SALE);
wmsProductOutstock.setAuditStatus(WmsConstants.WMS_AUDIT_STATUS_PASS);
wmsProductOutstock.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_FINISH);
wmsProductOutstock.setProductId(materialId);
wmsProductOutstock.setPlanCode(planCode);
wmsProductOutstock.setPlanDetailCode(planDetailCode);
wmsProductOutstock.setSaleOrderId(saleOrderId);
wmsProductOutstock.setSaleorderCode(saleorderCode);
wmsProductOutstock.setProductBatch(materialBarcode);
wmsProductOutstock.setApplyBy(userName);
wmsProductOutstock.setApplyDate(currentDate);
wmsProductOutstock.setTaskCode(Seq.getId(Seq.productOutstockSeqType, Seq.productOutstockCode));
wmsProductOutstockMapper.insertWmsProductOutstock(wmsProductOutstock);
productOutstockId = wmsProductOutstock.getProductOutstockId();
wmsProductStockMapper.deleteWmsProductStockByProductStockId(productStock.getProductStockId());
} else {
WmsProductOutstock queryProductOutstock = new WmsProductOutstock();
queryProductOutstock.setWarehouseId(warehouseId);
queryProductOutstock.setExecuteIncompleteFlag("1");
queryProductOutstock.setProductType(WmsConstants.PRODUCT_INSTOCK_STOCK_TYPE_PRODUCT);
queryProductOutstock.setProductId(materialId);
List<WmsProductOutstock> wmsProductOutstocks = wmsProductOutstockMapper.selectWmsProductOutstockList(queryProductOutstock);
if (wmsProductOutstocks == null || wmsProductOutstocks.isEmpty()) {
throw new ServiceException("请先从PDA执行成品出库申请");
}
if (saleOrderId == null || saleOrderId.equals((0L))) {
throw new ServiceException("此成品为安全库存,不能出库");
}
List<WmsProductOutstock> saleProductOutstocks = wmsProductOutstocks.stream().filter(wmsProductOutstock ->
wmsProductOutstock.getSaleOrderId() != null && wmsProductOutstock.getSaleOrderId().equals(saleOrderId)
).collect(Collectors.toList());
if (saleProductOutstocks == null || saleProductOutstocks.isEmpty()) {
throw new ServiceException("没有此销售订单[" + saleorderCode + "]的成品出库申请");
}
List<WmsProductOutstock> auditPassProductOutstocks = saleProductOutstocks.stream().filter(wmsProductOutstock ->
wmsProductOutstock.getAuditStatus().equals(WmsConstants.WMS_AUDIT_STATUS_PASS)
).collect(Collectors.toList());
if (auditPassProductOutstocks == null || auditPassProductOutstocks.isEmpty()) {
throw new ServiceException("此销售订单[" + saleorderCode + "]的成品出库申请未审核通过");
}
WmsProductOutstock productOutstock = saleProductOutstocks.get(0);
/**判断已出库数量和申请的数量*/
BigDecimal applyQty = productOutstock.getApplyQty() == null ? BigDecimal.ZERO : productOutstock.getApplyQty();
BigDecimal outstockQty = productOutstock.getOutstockQty() == null ? BigDecimal.ZERO : productOutstock.getOutstockQty();
BigDecimal currentOutstockQty = outstockQty.add(BigDecimal.ONE);
if (applyQty.compareTo(currentOutstockQty) < 0) {
throw new ServiceException(String.format("出库申请数量为%1$s不能再出库", applyQty));
}
//更新出库记录
if (applyQty.compareTo(currentOutstockQty) == 0) {
productOutstock.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_FINISH);
productOutstock.setEndTime(currentDate);
} else if (applyQty.compareTo(currentOutstockQty) > 0) {
productOutstock.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_EXECUTING);
}
productOutstock.setOutstockQty(currentOutstockQty);
if (productOutstock.getBeginTime() == null) {
productOutstock.setBeginTime(currentDate);
}
productOutstock.setUpdateDate(currentDate);
productOutstock.setUpdateBy(userName);
wmsProductOutstockMapper.updateWmsProductOutstock(productOutstock);
wmsProductStockMapper.deleteWmsProductStockByProductStockId(productStock.getProductStockId());
productOutstockId = productOutstock.getProductOutstockId();
}
wmsProductOutstockMapper.insertWmsProductOutstock(wmsProductOutstock);
return wmsProductStockMapper.deleteWmsProductStockByProductStockId(productStock.getProductStockId());
//插入出库记录明细
WmsProductOutstockDetail wmsProductOutstockDetail = new WmsProductOutstockDetail();
wmsProductOutstockDetail.setProductOutstockId(productOutstockId);
wmsProductOutstockDetail.setLocationCode("virtual");
wmsProductOutstockDetail.setWarehouseId(warehouseId);
wmsProductOutstockDetail.setProductBarcode(materialBarcode);
wmsProductOutstockDetail.setProductBatch(mesBaseBarcodeInfo.getBatchCode());
wmsProductOutstockDetail.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_FINISH);
wmsProductOutstockDetail.setProductId(materialId);
wmsProductOutstockDetail.setPlanAmount(BigDecimal.ONE);
wmsProductOutstockDetail.setOutstockAmount(BigDecimal.ONE);
wmsProductOutstockDetail.setBeginTime(currentDate);
wmsProductOutstockDetail.setEndTime(currentDate);
wmsProductOutstockDetail.setWarehouseId(productStock.getWarehouseId());
wmsProductOutstockDetail.setPlanAmount(BigDecimal.ONE);
wmsProductOutstockDetail.setOutstockAmount(BigDecimal.ONE);
wmsProductOutstockDetail.setUpdateDate(currentDate);
wmsProductOutstockDetail.setUpdateBy(userName);
wmsProductOutstockDetailMapper.insertWmsProductOutstockDetail(wmsProductOutstockDetail);
return 1;
}

@ -85,7 +85,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
public WmsRawOutstock selectWmsRawOutstockByRawOutstockId(Long rawOutstockId) {
WmsRawOutstock wmsRawOutstock = wmsRawOutstockMapper.selectWmsRawOutstockJoinMaterialById(rawOutstockId);
WmsRawOutstockDetail queryRawOutstockDetail = new WmsRawOutstockDetail();
queryRawOutstockDetail.setRawOutstockId(wmsRawOutstock.getRawOutstockId());
queryRawOutstockDetail.setRawOutstockId(rawOutstockId);
List<WmsRawOutstockDetail> wmsRawOutstockDetailList = wmsRawOutstockDetailMapper.selectWmsRawOutstockDetailList(queryRawOutstockDetail);
wmsRawOutstock.setWmsRawOutstockDetailList(wmsRawOutstockDetailList);
// if(wmsRawOutstockDetailList!=null && !wmsRawOutstockDetailList.isEmpty()){

@ -157,7 +157,7 @@ public class WmsStockTotalServiceImpl implements IWmsStockTotalService {
String materialClassfication = wmsStockTotal.getMaterialClassfication();
Long warehouseId = wmsStockTotal.getWarehouseId();
if(materialClassfication.equals(MesConstants.MES_MATERIAL_CLASSFICATION_VIRTUAL)){
if(StringUtils.isNotEmpty(materialClassfication) && materialClassfication.equals(MesConstants.MES_MATERIAL_CLASSFICATION_VIRTUAL)){
//五楼原料周转区仓库ID
if (warehouseId.equals(wmsConfig.getFifthCabinetWarehouseId())) {
wmsStockTotal.setMaterialId(wmsStockTotal.getProductId());

@ -110,6 +110,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="locationCode != null">location_code,</if>
<if test="productType != null and productType != ''">product_type,</if>
<if test="operationType != null and operationType != ''">operation_type,</if>
<if test="saleorderCode != null and saleorderCode != ''">saleorder_code,</if>
<if test="saleOrderId != null">sale_order_id,</if>
<if test="planCode != null and planCode != ''">plan_code,</if>
<if test="planDetailCode != null">plan_detail_code,</if>
<if test="instockType != null and instockType != ''">instock_type,</if>
@ -138,6 +140,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="locationCode != null">#{locationCode},</if>
<if test="productType != null and productType != ''">#{productType},</if>
<if test="operationType != null and operationType != ''">#{operationType},</if>
<if test="saleorderCode != null and saleorderCode != ''">#{saleorderCode},</if>
<if test="saleOrderId != null">#{saleOrderId},</if>
<if test="planCode != null and planCode != ''">#{planCode},</if>
<if test="planDetailCode != null">#{planDetailCode},</if>
<if test="instockType != null and instockType != ''">#{instockType},</if>

@ -125,9 +125,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectWmsProductOutstockDetailByProductBarcode" parameterType="String" resultMap="WmsProductOutstockDetailResult">
<include refid="selectWmsProductOutstockDetailVo"/>
where product_barcode = #{productBarcode} limit 1
</select>
<!-- <select id="selectWmsProductOutstockDetailByProductBarcode" parameterType="String" resultMap="WmsProductOutstockDetailResult">-->
<!-- <include refid="selectWmsProductOutstockDetailVo"/>-->
<!-- where product_barcode = #{productBarcode} limit 1-->
<!-- </select>-->
</mapper>

@ -76,6 +76,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
<if test="taskCode != null and taskCode != ''"> and task_code = #{taskCode}</if>
<if test="warehouseId != null "> and warehouse_id = #{warehouseId}</if>
<if test="productId != null "> and product_id = #{productId}</if>
<if test="locationCode != null and locationCode != ''"> and location_code = #{locationCode}</if>
<if test="productBatch != null and productBatch != ''"> and product_batch = #{productBatch}</if>
<if test="productType != null and productType != ''"> and product_type = #{productType}</if>
@ -94,6 +95,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateDate != null "> and update_date = #{updateDate}</if>
<if test="beginTime != null "> and begin_time = #{beginTime}</if>
<if test="endTime != null "> and end_time = #{endTime}</if>
<if test="executeIncompleteFlag != null and executeIncompleteFlag != ''"> and execute_status in ('0','1')</if>
</where>
</select>
@ -357,6 +360,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="auditStatus != null and auditStatus != ''"> and wro.audit_status = #{auditStatus}</if>
<if test="applyBy != null and applyBy != ''"> and wro.apply_by like concat('%', #{applyBy}, '%')</if>
</where>
order by wro.product_outstock_id desc
</select>
<select id="selectGetProductOutstockAuditByProductOutstockId" parameterType="Long" resultMap="WmsProductOutstockResult">

@ -262,7 +262,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectWmsRawOutstockJoinList" parameterType="WmsRawOutstock" resultMap="WmsRawOutstockResult">
select wro.raw_outstock_id, wro.task_code, wro.warehouse_id, wro.location_code, wro.order_id, wro.plan_code, wro.plan_detail_code, wro.station_id,wro.material_batch,
wro.material_id, wro.operation_type, wro.task_type, wro.apply_reason, wro.audit_reason, wro.audit_status, wro.execute_status, wro.apply_by, wro.apply_date,
wro.audit_by, wro.audit_date, wro.update_by, wro.update_date, wro.begin_time, wro.end_time,wbw.warehouse_name
wro.audit_by, wro.audit_date, wro.update_by, wro.update_date, wro.begin_time, wro.end_time,wro.outstock_amount,wro.real_outstock_amount,wbw.warehouse_name
from wms_raw_outstock wro left join wms_base_warehouse wbw on wro.warehouse_id = wbw.warehouse_id
<where>
<if test="taskCode != null and taskCode != ''"> and wro.task_code like concat('%', #{taskCode}, '%')</if>
@ -271,6 +271,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="planDetailCode != null "> and wro.plan_detail_code like concat('%', #{planDetailCode}, '%')</if>
<if test="applyReason != null and applyReason != ''"> and wro.apply_reason like concat('%', #{applyReason}, '%')</if>
<if test="auditStatus != null and auditStatus != ''"> and wro.audit_status = #{auditStatus}</if>
<if test="executeStatus != null and executeStatus != ''"> and wro.execute_status = #{executeStatus}</if>
<if test="taskType != null and taskType != ''"> and wro.task_type = #{taskType}</if>
<if test="applyBy != null and applyBy != ''"> and wro.apply_by like concat('%', #{applyBy}, '%')</if>
</where>

@ -90,6 +90,15 @@ export function firstFloorProduceInstock(data) {
})
}
// 一楼成品出库
export function firstFloorProduceOutstock(data) {
return request({
url: '/wms/api/firstFloorProduceOutstock',
method: 'post',
data: data
})
}
// 四楼成品入库
export function fourthFloorProduceInstock(data) {
return request({

@ -245,25 +245,23 @@
领料
</el-button>
<el-button
v-if="!$route.query && scope.row.planDetailStatus === PLAN_DETAIL_STATUS.STARTED"
v-if="scope.row.planDetailStatus === PLAN_DETAIL_STATUS.STARTED"
type="text"
@click="handleMaterialConfirmForm(scope)"
>
扫描
</el-button>
<el-button
size="small"
type="text"
@click="handleApplyRawReturn(scope.row)"
v-if="!$route.query && scope.row.planDetailStatus !== PLAN_DETAIL_STATUS.TO_START"
v-if="scope.row.planDetailStatus !== PLAN_DETAIL_STATUS.TO_START"
>
退库
</el-button>
<el-button
type="text"
@click="print(scope.row)"
v-if="(scope.row.planDetailStatus === PLAN_DETAIL_STATUS.FINISHED || scope.row.planDetailStatus === PLAN_DETAIL_STATUS.ABNORMAL_FINISHED)
&& finalProcessFlag ==='1' && !$route.query "
v-if="finalProcessFlag ==='1'"
>
条码
</el-button>
@ -330,7 +328,8 @@
<div class="bottom">
<el-row>
<el-button type="success" v-if="!$route.query" @click="handleProductInstock"></el-button>
<el-button type="success" v-if="finalProcessFlag ==='1'" @click="handleProductInstock"></el-button>
<el-button type="warning" v-if="finalProcessFlag ==='1'" @click="handleProductOutstock"></el-button>
<el-button type="danger" @click="logout">退</el-button>
</el-row>
</div>
@ -352,7 +351,7 @@
<el-dialog
:visible.sync="productInstockVisible"
title="成品入库"
:title="productInstockTitle"
width="40%">
<el-form ref="productInstockForm" :model="productInstockForm" :rules="productInstockRules" label-width="80px">
<el-form-item label="成品条码" prop="materialBarcode">
@ -468,6 +467,7 @@ import {
startProductPlanDetail,
completeProductPlanDetail,
firstFloorProduceInstock,
firstFloorProduceOutstock,
scanMaterial2Confirm,
selectMaterialInstallationCircumstance,
productPlanDetailPause,productPlanDetailContinue
@ -535,7 +535,14 @@ export default {
tableData2: [],
tableData3: [],
submitLoading:false,
productInstockType: null,//
PRODUCT_INSTOCK_TYPE: {
INSTOCK: "1",//
OUTSTOCK: "2",//
},
productInstockVisible: false,
productInstockTitle: '',
productInstockForm: {
materialBarcode: null
},
@ -593,7 +600,7 @@ export default {
}
},
mounted() {
if(!this.$route.query){
if(this.finalProcessFlag === '1'){
this.firstConnectSerial();
}
@ -870,31 +877,56 @@ export default {
/** 成品入库按钮操作 */
handleProductInstock() {
this.productInstockTitle = "成品入库";
this.productInstockType = this.PRODUCT_INSTOCK_TYPE.INSTOCK;
this.handleProductStock();
},
/** 成品出库按钮操作 */
handleProductOutstock() {
this.productInstockTitle = "成品出库";
this.productInstockType = this.PRODUCT_INSTOCK_TYPE.OUTSTOCK;
this.handleProductStock();
},
handleProductStock() {
this.resetProductInstock();
this.productInstockVisible = true;
if (!this.checkSerialConnected()) {
this.$confirm('请连接条码枪', '提示', {
confirmButtonText: '连接',
showClose: true,
// beforeClose:async(action,instance,done)=>{
// if(action==='confirm'){
// }else{
// this.connectSerialPort();
// }
//
// },
showCancelButton: true,
type: 'warning'
}).then(() => {
console.log("dddd")
this.connectSerial(this.setSerialData);
}).catch(() => {
});
}
},
submitProductInstock() {
this.$refs["productInstockForm"].validate(valid => {
if (valid) {
firstFloorProduceInstock(this.productInstockForm).then(response => {
this.$modal.msgSuccess("入库成功");
this.cancelProductInstock();
});
if (this.productInstockType === this.PRODUCT_INSTOCK_TYPE.INSTOCK) {
firstFloorProduceInstock(this.productInstockForm).then(response => {
this.$modal.msgSuccess("入库成功");
this.cancelProductInstock();
});
} else if (this.productInstockType === this.PRODUCT_INSTOCK_TYPE.OUTSTOCK) {
firstFloorProduceOutstock(this.productInstockForm).then(response => {
this.$modal.msgSuccess("出库成功");
this.cancelProductInstock();
});
}
}
});
},

@ -19,7 +19,7 @@
:data="form.wmsRawOutstockDetailList"
:header-cell-style="{textAlign:'center'}"
max-height="19.13vw"
style="width: 100%;"
style="width: 100%;overflow-x: auto"
>
<el-table-column
label="物料编号"

@ -11,22 +11,6 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item label="生产计划" prop="planCode">
<el-input
v-model="queryParams.planCode"
placeholder="请输入生产计划编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="生产计划明细" prop="planDetailCode">
<el-input
v-model="queryParams.planDetailCode"
placeholder="请输入生产计划明细编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="销售订单" prop="saleorderCode">
<el-input
v-model="queryParams.saleorderCode"
@ -144,8 +128,6 @@
<dict-tag :options="dict.type.wms_product_outstock_task_type" :value="scope.row.outstockType"/>
</template>
</el-table-column>
<el-table-column label="生产计划" align="center" prop="planCode" />
<el-table-column label="生产计划明细" align="center" prop="planDetailCode" />
<!-- <el-table-column label="销售订单ID主键" align="center" prop="saleOrderId" />-->
<el-table-column label="销售订单" align="center" prop="saleorderCode" />
<!-- <el-table-column label="项目号" align="center" prop="projectNo" />-->

@ -74,6 +74,21 @@
/>
</el-select>
</el-form-item>
<el-form-item label="执行状态" prop="executeStatus">
<el-select
v-model="queryParams.executeStatus"
placeholder="请选择执行状态"
clearable
style="width: 240px"
>
<el-option
v-for="dict in dict.type.wms_execute_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
@ -94,6 +109,8 @@
<dict-tag :options="dict.type.wms_raw_outstock_task_type" :value="scope.row.taskType"/>
</template>
</el-table-column>
<el-table-column label="申请数量" align="center" prop="outstockAmount" />
<el-table-column label="出库数量" align="center" prop="realOutstockAmount" />
<el-table-column label="申请人" align="center" prop="applyBy" />
<el-table-column label="申请原因" align="center" prop="applyReason" />
<el-table-column label="申请时间" align="center" prop="applyDate" width="180">
@ -103,6 +120,11 @@
<dict-tag :options="dict.type.wms_audit_status" :value="scope.row.auditStatus"/>
</template>
</el-table-column>
<el-table-column label="执行状态" align="center" prop="executeStatus" >
<template slot-scope="scope">
<dict-tag :options="dict.type.wms_execute_status" :value="scope.row.executeStatus"/>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button

@ -78,9 +78,6 @@
<el-table-column label="申请人" align="center" prop="applyBy" />
<el-table-column label="申请原因" align="center" prop="applyReason" />
<el-table-column label="申请时间" align="center" prop="applyDate" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.applyDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="审核状态" align="center" prop="auditStatus" >
<template slot-scope="scope">

Loading…
Cancel
Save