|
|
|
@ -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);
|
|
|
|
|