车间生产:
四楼激光切割:板材入库和板材领料后提示最新库存
五楼自检工序:在生成成品条码前判断有没有半成品出库
master
xs 4 weeks ago
parent bf6f2b2359
commit 57cb7848e0

@ -194,6 +194,8 @@ public class MesBaseBarcodeInfo extends BaseEntity
private Long orderBindId; private Long orderBindId;
private Long materialBomId;
public String getLocationCode() { public String getLocationCode() {
return locationCode; return locationCode;
@ -619,6 +621,14 @@ public class MesBaseBarcodeInfo extends BaseEntity
this.orderBindId = orderBindId; this.orderBindId = orderBindId;
} }
public Long getMaterialBomId() {
return materialBomId;
}
public void setMaterialBomId(Long materialBomId) {
this.materialBomId = materialBomId;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -349,7 +349,8 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
Long saleOrderId = productPlan.getSaleOrderId(); Long saleOrderId = productPlan.getSaleOrderId();
String saleOrderCode = productPlan.getSaleorderCode(); String saleOrderCode = productPlan.getSaleorderCode();
Long materialId = productPlan.getMaterialId();;//在生产计划的materialid是根据saletype保存如果是外部销售则保存productorder中的materialid如果是内部生产则保存prpductorder中的producematerialid Long materialId = productPlan.getMaterialId();
;//在生产计划的materialid是根据saletype保存如果是外部销售则保存productorder中的materialid如果是内部生产则保存prpductorder中的producematerialid
//五楼自检工序根据原材料条码生成成品条码 //五楼自检工序根据原材料条码生成成品条码
if (StringUtils.isNotEmpty(mesBaseBarcodeInfo.getSingleFlag()) && if (StringUtils.isNotEmpty(mesBaseBarcodeInfo.getSingleFlag()) &&
@ -369,6 +370,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
barcode = Seq.getId(Seq.mesPurchaseVirtualProductBarcodeSeqType, Seq.mesPurchaseVirtualProductBarcodeCode); barcode = Seq.getId(Seq.mesPurchaseVirtualProductBarcodeSeqType, Seq.mesPurchaseVirtualProductBarcodeCode);
} else if (rawMaterialBarcode.contains(Seq.mesInternalVirtualBarcodeCode)) {//内部生产合并虚拟条码 } else if (rawMaterialBarcode.contains(Seq.mesInternalVirtualBarcodeCode)) {//内部生产合并虚拟条码
barcode = Seq.getId(Seq.mesInternalVirtualProductBarcodeSeqType, Seq.mesInternalVirtualProductBarcodeCode); barcode = Seq.getId(Seq.mesInternalVirtualProductBarcodeSeqType, Seq.mesInternalVirtualProductBarcodeCode);
materialId = rawBarcode.getMaterialId();
} }
MesBaseBarcodeInfo productBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByProductBarcode(rawMaterialBarcode); MesBaseBarcodeInfo productBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByProductBarcode(rawMaterialBarcode);
@ -719,7 +721,9 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
PrintContentVo printMaterialSpec = new PrintContentVo(); PrintContentVo printMaterialSpec = new PrintContentVo();
printMaterialSpec.setKey(PrintContentVo.RAW_MATERIAL_LABEL_KEY_MATERIAL_SPEC); printMaterialSpec.setKey(PrintContentVo.RAW_MATERIAL_LABEL_KEY_MATERIAL_SPEC);
if(StringUtils.isNotEmpty(mesBaseBarcodeInfo.getBarcodeSpec())) {
printMaterialSpec.setValue(mesBaseBarcodeInfo.getBarcodeSpec().replaceAll("[\\x00-\\x1F\\x7F-\\x9F]", "")); printMaterialSpec.setValue(mesBaseBarcodeInfo.getBarcodeSpec().replaceAll("[\\x00-\\x1F\\x7F-\\x9F]", ""));
}
printMaterialSpec.setType(PrintContentVo.TYPE_TEXT); printMaterialSpec.setType(PrintContentVo.TYPE_TEXT);
PrintContentVo printQty = new PrintContentVo(); PrintContentVo printQty = new PrintContentVo();
@ -1066,6 +1070,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
MesMaterialBom childMaterialBom = childMaterialBomList.get(0); MesMaterialBom childMaterialBom = childMaterialBomList.get(0);
MesMaterialBom parentBom = mesMaterialBomMapper.selectMesMaterialBomByMaterialBomId(childMaterialBom.getParentId()); MesMaterialBom parentBom = mesMaterialBomMapper.selectMesMaterialBomByMaterialBomId(childMaterialBom.getParentId());
//四楼到五楼,主要是多个成品合并到一个托盘后生成原材料条码需要保存以下信息,一个成品的保不保存无所谓
MesSaleOrderRelate saleOrderRelate = new MesSaleOrderRelate(); MesSaleOrderRelate saleOrderRelate = new MesSaleOrderRelate();
saleOrderRelate.setBarcodeInfo(barcodeInfo); saleOrderRelate.setBarcodeInfo(barcodeInfo);
saleOrderRelate.setSaleOrderId(mesBaseBarcodeInfo.getSaleOrderId()); saleOrderRelate.setSaleOrderId(mesBaseBarcodeInfo.getSaleOrderId());
@ -1082,10 +1087,9 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
saleOrderRelate.setRelateSaleOrderAmount(BigDecimal.ONE); saleOrderRelate.setRelateSaleOrderAmount(BigDecimal.ONE);
toInsertedSaleOrderRelateList.add(saleOrderRelate); toInsertedSaleOrderRelateList.add(saleOrderRelate);
}
} }
}
if (allErrorMsgBuilder.length() > 0) { if (allErrorMsgBuilder.length() > 0) {
throw new ServiceException(allErrorMsgBuilder.toString()); throw new ServiceException(allErrorMsgBuilder.toString());

@ -119,6 +119,17 @@ public class MesProductOrderServiceImpl implements IMesProductOrderService {
if (mesProductOrder.getProduceMaterialId() == null) { if (mesProductOrder.getProduceMaterialId() == null) {
throw new ServiceException("请选择生产物料"); throw new ServiceException("请选择生产物料");
} }
//校验此生产物料是否在销售订单成品物料的生产bom中
MesMaterialBom queryMaterialBom = new MesMaterialBom();
queryMaterialBom.setMaterialId(mesProductOrder.getProduceMaterialId());
queryMaterialBom.setParentId(mesProductOrder.getMaterialBomId());
queryMaterialBom.setActiveFlag(MesConstants.MES_MATERIAL_BOM_ACTIVE_FLAG_NORMAL);
List<MesMaterialBom> mesMaterialBoms = mesMaterialBomMapper.selectMesMaterialBomList(queryMaterialBom);
if (mesMaterialBoms == null || mesMaterialBoms.isEmpty()) {
throw new ServiceException("所选择生产物料不在选择的成品bom中");
}
} }
} }
@ -180,6 +191,7 @@ public class MesProductOrderServiceImpl implements IMesProductOrderService {
/** /**
* *
*
* @param mesProductOrder * @param mesProductOrder
*/ */
private void checkPreTime(MesProductOrder mesProductOrder) { private void checkPreTime(MesProductOrder mesProductOrder) {
@ -371,7 +383,6 @@ public class MesProductOrderServiceImpl implements IMesProductOrderService {
} }
/** /**
* BOM * BOM
* *

@ -347,6 +347,7 @@
<where> <where>
mpo.order_status not in ('9') mpo.order_status not in ('9')
<if test="orderCode != null and orderCode != ''">and mpo.order_code like concat('%', #{orderCode},'%')</if> <if test="orderCode != null and orderCode != ''">and mpo.order_code like concat('%', #{orderCode},'%')</if>
<if test="saleType != null and saleType != ''">and mpo.sale_type = #{saleType}</if>
<if test="preOrderCode != null and preOrderCode != ''">and mpo.pre_order_code like concat('%', #{preOrderCode},'%')</if> <if test="preOrderCode != null and preOrderCode != ''">and mpo.pre_order_code like concat('%', #{preOrderCode},'%')</if>
<if test="saleorderCode != null and saleorderCode != ''">and mpo.saleorder_code like concat('%', #{saleorderCode},'%')</if> <if test="saleorderCode != null and saleorderCode != ''">and mpo.saleorder_code like concat('%', #{saleorderCode},'%')</if>
<if test="materialCode != null and materialCode != ''">and bmi.material_code like concat('%', #{materialCode},'%')</if> <if test="materialCode != null and materialCode != ''">and bmi.material_code like concat('%', #{materialCode},'%')</if>

@ -359,7 +359,7 @@
<if test="planStatus != null and planStatus != ''">and mpp.plan_status = #{planStatus}</if> <if test="planStatus != null and planStatus != ''">and mpp.plan_status = #{planStatus}</if>
<if test="incompleteFlag != null and incompleteFlag != ''">and mpp.plan_status in ('1','2')</if> <if test="incompleteFlag != null and incompleteFlag != ''">and mpp.plan_status in ('1','2')</if>
</where> </where>
order by mpp.plan_begin_time order by mpp.plan_id desc
</select> </select>

@ -49,6 +49,9 @@ public class WmsApiController extends BaseController {
@Autowired @Autowired
private IWmsProductOutstockService wmsProductOutstockService; private IWmsProductOutstockService wmsProductOutstockService;
@Autowired
private IWmsTransferService wmsTransferService;
@Autowired @Autowired
private IWmsErpScheduledTaskService wmsErpScheduledTaskService; private IWmsErpScheduledTaskService wmsErpScheduledTaskService;
@ -103,7 +106,6 @@ public class WmsApiController extends BaseController {
} }
/** /**
* *
*/ */
@ -111,7 +113,7 @@ public class WmsApiController extends BaseController {
@Log(title = "原材料入库记录", businessType = BusinessType.INSERT) @Log(title = "原材料入库记录", businessType = BusinessType.INSERT)
@PostMapping(("/addRawInstock")) @PostMapping(("/addRawInstock"))
public AjaxResult addRawInstock(@Validated @RequestBody WmsRawInstockVo wmsRawInstockVo) { public AjaxResult addRawInstock(@Validated @RequestBody WmsRawInstockVo wmsRawInstockVo) {
return toAjax(wmsRawInstockService.insertWmsRawInstock(wmsRawInstockVo)); return success(wmsRawInstockService.insertWmsRawInstock(wmsRawInstockVo));
} }
/** /**
@ -130,7 +132,7 @@ public class WmsApiController extends BaseController {
@Log(title = "原材料出库记录", businessType = BusinessType.CONFIRM) @Log(title = "原材料出库记录", businessType = BusinessType.CONFIRM)
@PostMapping(("/directRawOutstock")) @PostMapping(("/directRawOutstock"))
public AjaxResult directRawOutstock(@RequestBody WmsRawOutstock wmsRawOutstock) { public AjaxResult directRawOutstock(@RequestBody WmsRawOutstock wmsRawOutstock) {
return toAjax(wmsRawOutstockService.directRawOutstock(wmsRawOutstock)); return success(wmsRawOutstockService.directRawOutstock(wmsRawOutstock));
} }
@ -218,10 +220,9 @@ public class WmsApiController extends BaseController {
} }
/** /**
* ERP * ERP
*
* @return * @return
*/ */
@PostMapping(("/synchronizeInventoryInformationToERP")) @PostMapping(("/synchronizeInventoryInformationToERP"))
@ -231,6 +232,7 @@ public class WmsApiController extends BaseController {
/** /**
* ERP * ERP
*
* @return * @return
*/ */
@PostMapping(("/synchronizeRawMaterialDeliveryInformationToERP")) @PostMapping(("/synchronizeRawMaterialDeliveryInformationToERP"))
@ -240,6 +242,7 @@ public class WmsApiController extends BaseController {
/** /**
* ERP * ERP
*
* @param days days * @param days days
* @return * @return
*/ */
@ -250,6 +253,7 @@ public class WmsApiController extends BaseController {
/** /**
* ERP * ERP
*
* @param days days * @param days days
* @return * @return
*/ */
@ -268,4 +272,13 @@ public class WmsApiController extends BaseController {
return toAjax(wmsRawInstockService.continueRawInstock(wmsRawInstockContinueVo)); return toAjax(wmsRawInstockService.continueRawInstock(wmsRawInstockContinueVo));
} }
/**
*
*/
@GetMapping(("/checkSemiOutstock"))
public AjaxResult checkSemiOutstock(WmsTransfer wmsTransfer) {
return success(wmsTransferService.checkSemiOutstock(wmsTransfer));
}
} }

@ -101,7 +101,8 @@ public class WmsMobileController extends BaseController {
@Log(title = "原材料入库记录", businessType = BusinessType.INSERT) @Log(title = "原材料入库记录", businessType = BusinessType.INSERT)
@PostMapping(("/addRawInstock")) @PostMapping(("/addRawInstock"))
public AjaxResult addRawInstock(@Validated @RequestBody WmsRawInstockVo wmsRawInstockVo) { public AjaxResult addRawInstock(@Validated @RequestBody WmsRawInstockVo wmsRawInstockVo) {
return toAjax(wmsRawInstockService.insertWmsRawInstock(wmsRawInstockVo)); wmsRawInstockService.insertWmsRawInstock(wmsRawInstockVo);
return toAjax(1);
} }

@ -1,5 +1,6 @@
package com.hw.wms.service; package com.hw.wms.service;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
import com.hw.wms.domain.WmsRawInstock; import com.hw.wms.domain.WmsRawInstock;
import com.hw.wms.domain.vo.WmsRawBackVo; import com.hw.wms.domain.vo.WmsRawBackVo;
@ -72,7 +73,7 @@ public interface IWmsRawInstockService
* @param wmsRawInstockVo * @param wmsRawInstockVo
* @return * @return
*/ */
public int insertWmsRawInstock(WmsRawInstockVo wmsRawInstockVo); public BigDecimal insertWmsRawInstock(WmsRawInstockVo wmsRawInstockVo);
/** /**

@ -1,5 +1,6 @@
package com.hw.wms.service; package com.hw.wms.service;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
@ -139,7 +140,7 @@ public interface IWmsRawOutstockService
* @param wmsRawOutstock * @param wmsRawOutstock
* @return * @return
*/ */
public int directRawOutstock(WmsRawOutstock wmsRawOutstock); public BigDecimal directRawOutstock(WmsRawOutstock wmsRawOutstock);
/** /**
* wcswcsagv * wcswcsagv

@ -94,4 +94,12 @@ public interface IWmsTransferService
* @return * @return
*/ */
public int transferInstock(WmsTransferDetail wmsTransferDetail); public int transferInstock(WmsTransferDetail wmsTransferDetail);
/**
*
*
* @param wmsTransfer
* @return
*/
public int checkSemiOutstock(WmsTransfer wmsTransfer);
} }

@ -146,7 +146,7 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
*/ */
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public int insertWmsRawInstock(WmsRawInstockVo wmsRawInstockVo) { public BigDecimal insertWmsRawInstock(WmsRawInstockVo wmsRawInstockVo) {
String materialBarcode = wmsRawInstockVo.getMaterialBarcode(); String materialBarcode = wmsRawInstockVo.getMaterialBarcode();
R<MesBaseBarcodeInfo> baseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER); R<MesBaseBarcodeInfo> baseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER);
if (baseBarcodeInfoR == null) { if (baseBarcodeInfoR == null) {
@ -206,9 +206,7 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
int rows = wmsRawInstockMapper.insertWmsRawInstock(wmsRawInstock); int rows = wmsRawInstockMapper.insertWmsRawInstock(wmsRawInstock);
//更新库位库存 //更新库位库存
updateRawStock(wmsRawInstock, wmsRawInstockVo, baseLocation, baseBarcodeInfo, userName, currentDate); return updateRawStock(wmsRawInstock, wmsRawInstockVo, baseLocation, baseBarcodeInfo, userName, currentDate);
return rows;
} }
@ -221,7 +219,7 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
* @param userName * @param userName
* @param currentDate * @param currentDate
*/ */
public void updateRawStock(WmsRawInstock wmsRawInstock, WmsRawInstockVo wmsRawInstockVo, WmsBaseLocation baseLocation public BigDecimal updateRawStock(WmsRawInstock wmsRawInstock, WmsRawInstockVo wmsRawInstockVo, WmsBaseLocation baseLocation
, MesBaseBarcodeInfo baseBarcodeInfo, String userName, Date currentDate) { , MesBaseBarcodeInfo baseBarcodeInfo, String userName, Date currentDate) {
String barcode = baseBarcodeInfo.getBarcodeInfo(); String barcode = baseBarcodeInfo.getBarcodeInfo();
String locationCode = wmsRawInstock.getLocationCode(); String locationCode = wmsRawInstock.getLocationCode();
@ -239,12 +237,14 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
String batchFlag = baseBarcodeInfo.getBatchFlag(); String batchFlag = baseBarcodeInfo.getBatchFlag();
//如果是同一库位入同一批次,则更新数量 //如果是同一库位入同一批次,则更新数量
WmsRawStock wmsRawStock = wmsRawStockMapper.selectRawStockByBarcode(barcode); WmsRawStock wmsRawStock = wmsRawStockMapper.selectRawStockByBarcode(barcode);
BigDecimal newTotalAmount = BigDecimal.ZERO;
if (wmsRawStock != null) { if (wmsRawStock != null) {
// wmsRawStock.setQualityStatus(wmsRawInstockVo.getQualityStatus()); // wmsRawStock.setQualityStatus(wmsRawInstockVo.getQualityStatus());
if (!batchFlag.equals(MesConstants.IS_BATCH)) { if (!batchFlag.equals(MesConstants.IS_BATCH)) {
throw new ServiceException("此物料条码已经入库"); throw new ServiceException("此物料条码已经入库");
} }
wmsRawStock.setTotalAmount(wmsRawStock.getTotalAmount().add(wmsRawInstockVo.getInstockAmount())); newTotalAmount = wmsRawStock.getTotalAmount().add(wmsRawInstockVo.getInstockAmount());
wmsRawStock.setTotalAmount(newTotalAmount);
wmsRawStock.setUpdateBy(userName); wmsRawStock.setUpdateBy(userName);
wmsRawStock.setUpdateDate(currentDate); wmsRawStock.setUpdateDate(currentDate);
wmsRawStockMapper.updateWmsRawStock(wmsRawStock); wmsRawStockMapper.updateWmsRawStock(wmsRawStock);
@ -258,7 +258,8 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
wmsRawStock.setWarehouseFloor(baseLocation.getWarehouseFloor()); wmsRawStock.setWarehouseFloor(baseLocation.getWarehouseFloor());
// wmsRawStock.setLastOutstockTime(baseBarcodeInfo.getLastOutstockDate()); // wmsRawStock.setLastOutstockTime(baseBarcodeInfo.getLastOutstockDate());
// wmsRawStock.setQualityStatus(wmsRawInstockVo.getQualityStatus()); // wmsRawStock.setQualityStatus(wmsRawInstockVo.getQualityStatus());
wmsRawStock.setTotalAmount(wmsRawInstockVo.getInstockAmount()); newTotalAmount = wmsRawInstockVo.getInstockAmount();
wmsRawStock.setTotalAmount(newTotalAmount);
wmsRawStock.setSaleOrderId(baseBarcodeInfo.getSaleOrderId()); wmsRawStock.setSaleOrderId(baseBarcodeInfo.getSaleOrderId());
wmsRawStock.setSafeFlag(baseBarcodeInfo.getSafeFlag()); wmsRawStock.setSafeFlag(baseBarcodeInfo.getSafeFlag());
wmsRawStock.setInstockDate(baseBarcodeInfo.getAcceptedDate()); wmsRawStock.setInstockDate(baseBarcodeInfo.getAcceptedDate());
@ -267,6 +268,8 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
wmsRawStock.setCreateDate(currentDate); wmsRawStock.setCreateDate(currentDate);
wmsRawStockMapper.insertWmsRawStock(wmsRawStock); wmsRawStockMapper.insertWmsRawStock(wmsRawStock);
} }
return newTotalAmount;
} }
@ -386,12 +389,12 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
} }
MesBaseBarcodeInfo baseBarcodeInfo = baseBarcodeInfoR.getData(); MesBaseBarcodeInfo baseBarcodeInfo = baseBarcodeInfoR.getData();
if (baseBarcodeInfo == null) { if (baseBarcodeInfo == null) {
throw new ServiceException("物料条码有误"); throw new ServiceException("物料条码有误");
} }
if (StringUtils.isEmpty(baseBarcodeInfo.getProductBarcode())) { // if (StringUtils.isEmpty(baseBarcodeInfo.getProductBarcode())) {
throw new ServiceException("此物料条码信息有误"); // throw new ServiceException("此物料条码信息有误");
} // }
String wcsAgvContinueUrl = wmsConfig.getWcsAgvContinueUrl(); String wcsAgvContinueUrl = wmsConfig.getWcsAgvContinueUrl();
RestTemplate restTemplate = new RestTemplate(); RestTemplate restTemplate = new RestTemplate();

@ -1199,7 +1199,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
*/ */
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public int directRawOutstock(WmsRawOutstock wmsRawOutstock) { public BigDecimal directRawOutstock(WmsRawOutstock wmsRawOutstock) {
//出库要求 0申请出库1申请审核出库2直接出库 //出库要求 0申请出库1申请审核出库2直接出库
String materialBarcode = wmsRawOutstock.getMaterialBarcode(); String materialBarcode = wmsRawOutstock.getMaterialBarcode();
String locationCode = wmsRawOutstock.getLocationCode(); String locationCode = wmsRawOutstock.getLocationCode();
@ -1237,13 +1237,12 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
this.insertRawOutstockDetail(wmsRawOutstock, locationCode, materialBarcode, batchCode, this.insertRawOutstockDetail(wmsRawOutstock, locationCode, materialBarcode, batchCode,
userName, currentDate); userName, currentDate);
directOutstockUpdateRawStock(locationCode, materialBarcode, outstockAmount, userName, currentDate); return directOutstockUpdateRawStock(locationCode, materialBarcode, outstockAmount, userName, currentDate);
return 1;
} }
public void directOutstockUpdateRawStock(String locationCode, String materialBarcode, BigDecimal outstockAmount, public BigDecimal directOutstockUpdateRawStock(String locationCode, String materialBarcode, BigDecimal outstockAmount,
String userName, Date currentDate) { String userName, Date currentDate) {
WmsRawStock wmsRawStock = wmsRawStockMapper.selectRawStockByBarcode(materialBarcode); WmsRawStock wmsRawStock = wmsRawStockMapper.selectRawStockByBarcode(materialBarcode);
if (wmsRawStock == null) { if (wmsRawStock == null) {
@ -1266,6 +1265,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
wmsRawStockMapper.updateWmsRawStock(wmsRawStock); wmsRawStockMapper.updateWmsRawStock(wmsRawStock);
} }
return updatedTotalAmount;
} }
} }

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

@ -425,5 +425,19 @@ public class WmsTransferServiceImpl implements IWmsTransferService {
} }
/**
*
*
* @param wmsTransfer
* @return
*/
@Override
public int checkSemiOutstock(WmsTransfer wmsTransfer) {
List<WmsTransfer> wmsTransfers = wmsTransferMapper.selectWmsTransferList(wmsTransfer);
if(wmsTransfers==null || wmsTransfers.isEmpty()){
throw new ServiceException("此物料还未从半成品库出库,不能生成成品条码");
}
return 1;
}
} }

@ -64,3 +64,12 @@ export function addInternalBarcode(data) {
data: data data: data
}) })
} }
//根据原材料条码判断是否有半成品出库
export function checkSemiOutstock(query) {
return request({
url: '/wms/api/checkSemiOutstock',
method: 'get',
params: query
})
}

@ -50,3 +50,18 @@ export function delMaterialBom(materialBomId) {
method: 'delete' method: 'delete'
}) })
} }
// bom状态修改
export function changeBomStatus(materialBomId, activeFlag) {
const data = {
materialBomId,
activeFlag
}
return request({
url: '/mes/materialBom',
method: 'put',
data: data
})
}

@ -95,7 +95,7 @@
>配对码 >配对码
</el-button> </el-button>
<el-button <!--el-button
size="mini" size="mini"
type="text" type="text"
plain plain
@ -103,7 +103,7 @@
@click="regenerateBarcode(scope.row)" @click="regenerateBarcode(scope.row)"
v-if="scope.row.printFlag ==='1' && scope.row.barcodeType !== BARCODE_TYPE.BIND_BARCODE" v-if="scope.row.printFlag ==='1' && scope.row.barcodeType !== BARCODE_TYPE.BIND_BARCODE"
>重新生成 >重新生成
</el-button> </el-button-->
&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;
<el-button <el-button
size="mini" size="mini"
@ -217,7 +217,8 @@
<el-dialog :title="internalTitle" :visible.sync="internalOpen" width="500px" append-to-body> <el-dialog :title="internalTitle" :visible.sync="internalOpen" width="500px" append-to-body>
<el-form ref="internalForm" :model="internalForm" :rules="internalRules" label-width="100px"> <el-form ref="internalForm" :model="internalForm" :rules="internalRules" label-width="100px">
<el-form-item label="成品条码" prop="productBarcode"> <el-form-item label="成品条码" prop="productBarcode">
<el-input type="textarea" v-model="internalForm.productBarcode" placeholder="请输入或扫描成品条码,多个以,隔开" class="input-with-select"> <el-input type="textarea" v-model="internalForm.productBarcode" placeholder="请输入或扫描成品条码,多个以,隔开"
class="input-with-select">
<el-button slot="append" icon="el-icon-full-screen"></el-button> <el-button slot="append" icon="el-icon-full-screen"></el-button>
</el-input> </el-input>
</el-form-item> </el-form-item>
@ -275,8 +276,10 @@ import {
printProductBarcodes, printProductBarcodes,
printBindBarcodes, printBindBarcodes,
selectProductBarcodeInfoByBarcodeInfo, selectProductBarcodeInfoByBarcodeInfo,
addInternalBarcode, regenerateBarcode addInternalBarcode, regenerateBarcode,
checkSemiOutstock
} from "@/api/board/barcode"; } from "@/api/board/barcode";
import {getMaterialInfoByMaterialId} from "@/api/board";
export default { export default {
name: "Barcode", name: "Barcode",
@ -512,6 +515,7 @@ export default {
planDetailCode: this.defineData.planDetailCode, planDetailCode: this.defineData.planDetailCode,
saleOrderId: this.defineData.saleOrderId, saleOrderId: this.defineData.saleOrderId,
saleorderCode: this.defineData.saleorderCode, saleorderCode: this.defineData.saleorderCode,
materialBomId: this.defineData.materialBomId,
batchFlag: '0', batchFlag: '0',
amount: 1, amount: 1,
} }
@ -712,9 +716,24 @@ export default {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
this.submitLoading = true; this.submitLoading = true;
if(this.defineData.barcodeType && this.defineData.barcodeType == this.BARCODE_TYPE_PARAM.SPLIT_BIND_BARCODE){ if (this.defineData.barcodeType && this.defineData.barcodeType === this.BARCODE_TYPE_PARAM.PRODUCT) {
checkSemiOutstock({productBatch: this.form.productBarcode}).then(e => {
this.addProductBarcode();
}).finally(e => {
this.submitLoading = false;
});
} else {
if (this.defineData.barcodeType && this.defineData.barcodeType === this.BARCODE_TYPE_PARAM.SPLIT_BIND_BARCODE) {
this.form.barcodeAmount = 1; this.form.barcodeAmount = 1;
} }
this.addProductBarcode();
}
}
});
},
addProductBarcode() {
addProductBarcode(this.form).then(response => { addProductBarcode(this.form).then(response => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.addProductBarcodeOpen = false; this.addProductBarcodeOpen = false;
@ -722,8 +741,6 @@ export default {
}).finally(e => { }).finally(e => {
this.submitLoading = false; this.submitLoading = false;
}); });
}
});
}, },
// //
@ -871,8 +888,6 @@ export default {
}, },
} }
}; };
</script> </script>

@ -1078,7 +1078,7 @@ export default {
this.submitLoading = true; this.submitLoading = true;
if (this.stockType === this.STOCK_TYPE.INSTOCK) {// if (this.stockType === this.STOCK_TYPE.INSTOCK) {//
addRawInstock(this.wmsForm).then(response => { addRawInstock(this.wmsForm).then(response => {
this.$modal.msgSuccess("板材入库成功"); this.$modal.msgSuccess("板材入库成功,当前库存为:"+response.data);
this.cancel(); this.cancel();
}).finally(e => { }).finally(e => {
this.submitLoading = false; this.submitLoading = false;
@ -1159,15 +1159,11 @@ export default {
} }
}); });
}, },
directRawOutstock() { directRawOutstock() {
directRawOutstock(this.wmsForm).then(response => { directRawOutstock(this.wmsForm).then(response => {
this.$modal.msgSuccess("板材领取成功"); this.$modal.msgSuccess("板材领取成功,当前库存:"+response.data);
this.cancel(); this.cancel();
}).finally(e => { }).finally(e => {
this.submitLoading = false; this.submitLoading = false;

@ -84,16 +84,6 @@
>展开/折叠 >展开/折叠
</el-button> </el-button>
</el-col> </el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-upload2"
size="mini"
@click="handleImport"
>BOM导入
</el-button>
</el-col>
<!--right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar--> <!--right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar-->
</el-row> </el-row>
@ -135,6 +125,17 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="备注" align="center" prop="remark" v-if="columns[10].visible"/> <el-table-column label="备注" align="center" prop="remark" v-if="columns[10].visible"/>
<el-table-column label="状态" align="center" width="100">
<template slot-scope="scope">
<el-switch
v-model="scope.row.activeFlag"
active-value="1"
inactive-value="0"
@change="handleStatusChange(scope.row)"
></el-switch>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -284,7 +285,8 @@ import {
getMaterialBom, getMaterialBom,
delMaterialBom, delMaterialBom,
addMaterialBom, addMaterialBom,
updateMaterialBom updateMaterialBom,
changeBomStatus
} from "@/api/mes/materialBom"; } from "@/api/mes/materialBom";
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import "@riophae/vue-treeselect/dist/vue-treeselect.css";
@ -662,7 +664,20 @@ export default {
this.$modal.msgError("该物料BOM已被生产工单选择无法删除"); this.$modal.msgError("该物料BOM已被生产工单选择无法删除");
return; return;
}); });
} },
//
handleStatusChange(row) {
let text = row.status === "0" ? "启用" : "停用";
this.$modal.confirm('确认要"' + text + '""' + row.materialName + '"bom吗').then(function() {
return changeBomStatus(row.materialBomId, row.activeFlag);
}).then(() => {
this.$modal.msgSuccess(text + "成功");
}).catch(function() {
row.activeFlag = row.activeFlag === "0" ? "1" : "0";
});
},
} }
}; };
</script> </script>

@ -139,7 +139,8 @@ export default {
activeFlag: '1', activeFlag: '1',
deletedFlag: null, deletedFlag: null,
approveDate: null, approveDate: null,
erpModifyDate: null erpModifyDate: null,
materialClassfication:'1'
}, },
}; };
}, },

@ -9,6 +9,17 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="销售类型" prop="saleType">
<el-select v-model="queryParams.saleType" placeholder="请选择销售类型" clearable>
<el-option
v-for="dict in dict.type.mes_sale_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="销售订单编号" prop="saleorderCode"> <el-form-item label="销售订单编号" prop="saleorderCode">
<el-input <el-input
v-model="queryParams.saleorderCode" v-model="queryParams.saleorderCode"
@ -17,6 +28,8 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="成品编号" prop="materialCode"> <el-form-item label="成品编号" prop="materialCode">
<el-input <el-input
v-model="queryParams.materialCode" v-model="queryParams.materialCode"
@ -457,12 +470,12 @@
</el-radio> </el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="成品名称" prop="materialName"> <el-form-item label="成品名称" prop="materialName" v-if="form.saleType !== MES_SALE_TYPE.MES_SALE_TYPE_PACKING">
<el-input v-model="form.materialName" placeholder="请点击右侧检索物料" readonly> <el-input v-model="form.materialName" placeholder="请点击右侧检索物料" readonly>
<el-button slot="append" icon="el-icon-search" @click="handleMaterialAdd"></el-button> <el-button slot="append" icon="el-icon-search" @click="handleMaterialAdd"></el-button>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="成品BOM" prop="materialBomId"> <el-form-item label="成品BOM" prop="materialBomId" v-if="form.saleType !== MES_SALE_TYPE.MES_SALE_TYPE_PACKING">
<el-select v-model="form.materialBomId" placeholder="请选择物料BOM"> <el-select v-model="form.materialBomId" placeholder="请选择物料BOM">
<el-option <el-option
v-for="item in materialBomList" v-for="item in materialBomList"
@ -478,7 +491,7 @@
<el-button slot="append" icon="el-icon-search" @click="handleProduceMaterialAdd"></el-button> <el-button slot="append" icon="el-icon-search" @click="handleProduceMaterialAdd"></el-button>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="工艺路线" prop="dispatchId"> <el-form-item label="工艺路线" prop="dispatchId" v-if="form.saleType !== MES_SALE_TYPE.MES_SALE_TYPE_PACKING">
<el-select v-model="form.dispatchId" filterable placeholder="请选择工艺路线" clearable> <el-select v-model="form.dispatchId" filterable placeholder="请选择工艺路线" clearable>
<el-option <el-option
v-for="item in routeList" v-for="item in routeList"
@ -488,6 +501,16 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="柜体渠道" prop="cabinetChannel" v-if="form.dispatchId===4">
<el-radio-group v-model="form.cabinetChannel">
<el-radio
v-for="dict in dict.type.mes_product_order_canbinet_channel"
:key="dict.value"
:label="dict.value"
>{{ dict.label }}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="计划数量" prop="planAmount"> <el-form-item label="计划数量" prop="planAmount">
<el-input-number v-model="form.planAmount" placeholder="请输入计划数量"/> <el-input-number v-model="form.planAmount" placeholder="请输入计划数量"/>
</el-form-item> </el-form-item>
@ -645,6 +668,7 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
orderCode: null, orderCode: null,
saleType:null,
saleOrderId: null, saleOrderId: null,
saleorderCode: null, saleorderCode: null,
saleorderLinenumber: null, saleorderLinenumber: null,
@ -928,6 +952,7 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
orderCode: null, orderCode: null,
saleType:null,
saleOrderId: null, saleOrderId: null,
saleorderCode: null, saleorderCode: null,
saleorderLinenumber: null, saleorderLinenumber: null,

Loading…
Cancel
Save