MES
原材料条码:合并采购订单新增和编辑完善
master
xs 3 weeks ago
parent e007884249
commit 6c41a9d11f

@ -7,6 +7,7 @@ import com.hw.common.core.domain.R;
import com.hw.common.core.exception.ServiceException;
import com.hw.common.core.utils.DateUtils;
import com.hw.common.core.utils.StringUtils;
import com.hw.common.core.utils.ip.IpUtils;
import com.hw.common.core.utils.uuid.Seq;
import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.domain.*;
@ -663,7 +664,9 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
try {
redisTemplate.opsForList().rightPush("print_10.10.3.119", printContentJson.toString());
String hostIp = IpUtils.getIpAddr();
String printKey = "print_" + hostIp;
redisTemplate.opsForList().rightPush(printKey, printContentJson.toString());
// redisTemplate.convertAndSend("print_10.10.3.119", printContentJson.toString());
} catch (Exception e) {
throw new ServiceException("打印失败:" + e.getMessage());
@ -1383,7 +1386,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
Long materialId = this.insertNewVirtualMaterial(barcodeInfo, userName, currentDate);
//创建虚拟销售订单,保存对应的销售订单列表
MesSaleOrder virtualSaleOrder = this.insertNewVirtualSaleOrder(materialId, barcodeInfo, mesSaleOrderRelateList, userName, currentDate);
MesSaleOrder virtualSaleOrder = this.insertNewVirtualSaleOrder(materialId, barcodeInfo, mesBaseBarcodeInfo.getSaleorderCode(), mesSaleOrderRelateList, userName, currentDate);
//创建虚拟bom并合并销售订单的bom信息
this.insertVirtualMaterialBom(materialId, barcodeInfo, toUpdatedMaterialBoms, userName, currentDate);
@ -1397,7 +1400,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
toInsertedBarcodeInfo.setPurchaseOrderId(-1L);
toInsertedBarcodeInfo.setMaterialId(materialId);
toInsertedBarcodeInfo.setSaleOrderId(virtualSaleOrder.getSaleOrderId());
toInsertedBarcodeInfo.setSaleorderCode(virtualSaleOrder.getSaleorderCode());
toInsertedBarcodeInfo.setSaleorderCode(mesBaseBarcodeInfo.getSaleorderCode());
toInsertedBarcodeInfo.setSafeFlag(MesConstants.MES_ORDER_BIND_SAFE_FLAG_NO);
toInsertedBarcodeInfo.setSingleFlag(MesConstants.MES_BARCODE_SINGLE_FLAG_MERGE);
// toInsertedBarcodeInfo.setBarcodeSpec(materialCodes.toString());
@ -1439,7 +1442,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
}
public MesSaleOrder insertNewVirtualSaleOrder(Long materialId, String barcodeInfo,
public MesSaleOrder insertNewVirtualSaleOrder(Long materialId, String barcodeInfo, String saleOrderCode,
List<MesSaleOrderRelate> mesSaleOrderRelates, String userName, Date currentDate) {
@ -1453,7 +1456,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
mesSaleOrder.setMaterialCode(barcodeInfo);
mesSaleOrder.setMaterialName(barcodeInfo);
mesSaleOrder.setOrderAmount(BigDecimal.ONE);
mesSaleOrder.setSaleorderCode(Seq.getId(Seq.mesVirtualSaleOrderSeqType, Seq.mesVirtualSaleOrderCode));
mesSaleOrder.setSaleorderCode(saleOrderCode);
mesSaleOrder.setIsRelease(MesConstants.MES_SALE_ORDER_IS_RELEASE_TO_PUBLISH);
// mesSaleOrder.setPlanDeliveryDate();
mesSaleOrder.setSaleOrderClassfication(MesConstants.MES_SALE_ORDER_CLASSFICATION_VIRTUAL);
@ -1623,6 +1626,24 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
throw new ServiceException(errorMsgBuilder.toString());
}
// 判断是否要更新虚拟订单的销售订单号
if (dbMesSaleOrderRelateList != null && !dbMesSaleOrderRelateList.isEmpty()
&& mesSaleOrderRelateList != null && !mesSaleOrderRelateList.isEmpty()) {
MesSaleOrderRelate toDeletedMesSaleOrderRelate = dbMesSaleOrderRelateList.get(0);
String oldSaleOrderCode = toDeletedMesSaleOrderRelate.getRelateSaleOrderCode();
MesSaleOrderRelate toInsertedMesSaleOrder = mesSaleOrderRelateList.get(0);
String newSaleOrderCode = toInsertedMesSaleOrder.getRelateSaleOrderCode();
if (!oldSaleOrderCode.equals(newSaleOrderCode)) {
MesSaleOrder virtualSaleOrder = mesSaleOrderMapper.selectMesSaleOrderBySaleOrderId(toDeletedMesSaleOrderRelate.getSaleOrderId());
virtualSaleOrder.setSaleorderCode(newSaleOrderCode);
virtualSaleOrder.setUpdateTime(currentDate);
virtualSaleOrder.setUpdateBy(userName);
mesSaleOrderMapper.updateMesSaleOrder(virtualSaleOrder);
}
}
//生成条码
mesBaseBarcodeInfo.setUpdateBy(userName);

@ -372,7 +372,7 @@ public class MesProductOrderServiceImpl implements IMesProductOrderService {
productOrder.setProductOrderId(mesProductOrder.getProductOrderId());
productOrder.setOrderStatus(MesConstants.PUBLISHED);
productOrder.setReleaseTime(DateUtils.getNowDate());
return this.updateMesProductOrder(productOrder);
return mesProductOrderMapper.updateMesProductOrder(productOrder);
}
/**

@ -24,7 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectMesSaleOrderRelateVo">
select sale_order_relate_id, sale_order_id,barcode_info, order_bind_id,relate_sale_order_id,material_id, relate_sale_order_amount from mes_sale_order_relate
select sale_order_relate_id, sale_order_id,barcode_info, order_bind_id,relate_sale_order_id,relate_sale_order_code,material_id, relate_sale_order_amount from mes_sale_order_relate
</sql>
<select id="selectMesSaleOrderRelateList" parameterType="MesSaleOrderRelate" resultMap="MesSaleOrderRelateResult">

@ -1127,7 +1127,7 @@ export default {
if (filterSaleOrderIdMaterialRelateList != null && filterSaleOrderIdMaterialRelateList.length > 0) {
let errorMsg = "选择的信息跟已经选择的销售订单号明细相同.";
for (let ssoid of filterSaleOrderIdMaterialRelateList) {
errorMsg += "销售订单号:" + ssoid.saleOrderCode + ",成品编码:" + ssoid.productCode + ",成品名称:" + ssoid.productName + ",成品规格:" + ssoid.productSpec + ";";
errorMsg += "销售订单号:" + ssoid.relateSaleOrderCode + ",成品编码:" + ssoid.productCode + ",成品名称:" + ssoid.productName + ",成品规格:" + ssoid.productSpec + ";";
}
this.$modal.msgError(errorMsg);
@ -1790,6 +1790,7 @@ export default {
this.submitLoading = true;
if (this.materialRelateForm.mesSaleOrderRelateList.length <= 1) {
this.$modal.msgError("请选择至少2条采购信息");
this.submitLoading = false;
return;
}
if (this.materialRelateForm.barcodeId && this.materialRelateForm.barcodeId != '') {

@ -104,8 +104,8 @@
label-width="68px">
<el-form-item label="订单编号" prop="poNo">
<el-input
v-model="allocatePurchaseOrderQueryParams.poNo"
placeholder="请输入物料编码"
v-model="purchaseOrderQueryParams.poNo"
placeholder="请输入订单编号"
style="width:140px;"
clearable
@keyup.enter.native="handleAllocateMaterialQuery"

@ -124,6 +124,7 @@
<el-radio label="C">菜单</el-radio>
<el-radio label="F">按钮</el-radio>
<el-radio label="P">PDA</el-radio>
<el-radio label="W">WCS</el-radio>
</el-radio-group>
</el-form-item>
</el-col>

Loading…
Cancel
Save